Package: guix;
Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Date: Mon, 22 Apr 2019 00:23:02 UTC
Severity: normal
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35371 in the body.
You can then email your comments to 35371 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-guix <at> gnu.org:bug#35371; Package guix.
(Mon, 22 Apr 2019 00:23:02 GMT) Full text and rfc822 format available.Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:bug-guix <at> gnu.org.
(Mon, 22 Apr 2019 00:23:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: bug-guix <bug-guix <at> gnu.org> Subject: [core-updates] python-cffi fails its test suite Date: Sun, 21 Apr 2019 20:21:52 -0400
It seems that something in Guix confuses the python-cffi code logic and
makes it "think" the platform should be 'win32', while it is 'linux'.
The errors output is copied below:
--8<---------------cut here---------------start------------->8---
=================================== FAILURES ===================================
______________________________ test_load_library _______________________________
def test_load_library():
> x = find_and_load_library('c')
c/test_c.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'c', flags = 2
def find_and_load_library(name, flags=RTLD_NOW):
import ctypes.util
if name is None:
path = None
else:
path = ctypes.util.find_library(name)
if path is None and name == 'c':
> assert sys.platform == 'win32'
E AssertionError: assert 'linux' == 'win32'
E - linux
E + win32
c/test_c.py:65: AssertionError
_________________________ test_load_and_call_function __________________________
def test_load_and_call_function():
BChar = new_primitive_type("char")
BCharP = new_pointer_type(BChar)
BLong = new_primitive_type("long")
BFunc = new_function_type((BCharP,), BLong, False)
> ll = find_and_load_library('c')
c/test_c.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'c', flags = 2
def find_and_load_library(name, flags=RTLD_NOW):
import ctypes.util
if name is None:
path = None
else:
path = ctypes.util.find_library(name)
if path is None and name == 'c':
> assert sys.platform == 'win32'
E AssertionError: assert 'linux' == 'win32'
E - linux
E + win32
c/test_c.py:65: AssertionError
______________________________ test_read_variable ______________________________
def test_read_variable():
## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard
## https://bugs.pypy.org/issue1643
if not sys.platform.startswith("linux"):
py.test.skip("untested")
BVoidP = new_pointer_type(new_void_type())
> ll = find_and_load_library('c')
c/test_c.py:1221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'c', flags = 2
def find_and_load_library(name, flags=RTLD_NOW):
import ctypes.util
if name is None:
path = None
else:
path = ctypes.util.find_library(name)
if path is None and name == 'c':
> assert sys.platform == 'win32'
E AssertionError: assert 'linux' == 'win32'
E - linux
E + win32
c/test_c.py:65: AssertionError
__________________ test_read_variable_as_unknown_length_array __________________
def test_read_variable_as_unknown_length_array():
## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard
## https://bugs.pypy.org/issue1643
if not sys.platform.startswith("linux"):
py.test.skip("untested")
BCharP = new_pointer_type(new_primitive_type("char"))
BArray = new_array_type(BCharP, None)
> ll = find_and_load_library('c')
c/test_c.py:1232:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'c', flags = 2
def find_and_load_library(name, flags=RTLD_NOW):
import ctypes.util
if name is None:
path = None
else:
path = ctypes.util.find_library(name)
if path is None and name == 'c':
> assert sys.platform == 'win32'
E AssertionError: assert 'linux' == 'win32'
E - linux
E + win32
c/test_c.py:65: AssertionError
_____________________________ test_write_variable ______________________________
def test_write_variable():
## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard
## https://bugs.pypy.org/issue1643
if not sys.platform.startswith("linux"):
py.test.skip("untested")
BVoidP = new_pointer_type(new_void_type())
> ll = find_and_load_library('c')
c/test_c.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'c', flags = 2
def find_and_load_library(name, flags=RTLD_NOW):
import ctypes.util
if name is None:
path = None
else:
path = ctypes.util.find_library(name)
if path is None and name == 'c':
> assert sys.platform == 'win32'
E AssertionError: assert 'linux' == 'win32'
E - linux
E + win32
c/test_c.py:65: AssertionError
__________________________________ test_FILE ___________________________________
def test_FILE():
if sys.platform == "win32":
py.test.skip("testing FILE not implemented")
#
BFILE = new_struct_type("struct _IO_FILE")
BFILEP = new_pointer_type(BFILE)
BChar = new_primitive_type("char")
BCharP = new_pointer_type(BChar)
BInt = new_primitive_type("int")
BFunc = new_function_type((BCharP, BFILEP), BInt, False)
BFunc2 = new_function_type((BFILEP, BCharP), BInt, True)
> ll = find_and_load_library('c')
c/test_c.py:2931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'c', flags = 2
def find_and_load_library(name, flags=RTLD_NOW):
import ctypes.util
if name is None:
path = None
else:
path = ctypes.util.find_library(name)
if path is None and name == 'c':
> assert sys.platform == 'win32'
E AssertionError: assert 'linux' == 'win32'
E - linux
E + win32
c/test_c.py:65: AssertionError
_________________________ test_FILE_only_for_FILE_arg __________________________
def test_FILE_only_for_FILE_arg():
if sys.platform == "win32":
py.test.skip("testing FILE not implemented")
#
B_NOT_FILE = new_struct_type("struct NOT_FILE")
B_NOT_FILEP = new_pointer_type(B_NOT_FILE)
BChar = new_primitive_type("char")
BCharP = new_pointer_type(BChar)
BInt = new_primitive_type("int")
BFunc = new_function_type((BCharP, B_NOT_FILEP), BInt, False)
> ll = find_and_load_library('c')
c/test_c.py:2962:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'c', flags = 2
def find_and_load_library(name, flags=RTLD_NOW):
import ctypes.util
if name is None:
path = None
else:
path = ctypes.util.find_library(name)
if path is None and name == 'c':
> assert sys.platform == 'win32'
E AssertionError: assert 'linux' == 'win32'
E - linux
E + win32
c/test_c.py:65: AssertionError
_______________________________ test_FILE_object _______________________________
def test_FILE_object():
if sys.platform == "win32":
py.test.skip("testing FILE not implemented")
#
BFILE = new_struct_type("FILE")
BFILEP = new_pointer_type(BFILE)
BChar = new_primitive_type("char")
BCharP = new_pointer_type(BChar)
BInt = new_primitive_type("int")
BFunc = new_function_type((BCharP, BFILEP), BInt, False)
BFunc2 = new_function_type((BFILEP,), BInt, False)
> ll = find_and_load_library('c')
c/test_c.py:2986:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'c', flags = 2
def find_and_load_library(name, flags=RTLD_NOW):
import ctypes.util
if name is None:
path = None
else:
path = ctypes.util.find_library(name)
if path is None and name == 'c':
> assert sys.platform == 'win32'
E AssertionError: assert 'linux' == 'win32'
E - linux
E + win32
c/test_c.py:65: AssertionError
_______________________________ TestFFI.test_sin _______________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff579b4e0>
def test_sin(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
double sin(double x);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
______________________________ TestFFI.test_sinf _______________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff5ef0128>
def test_sinf(self):
if sys.platform == 'win32':
py.test.skip("no sinf found in the Windows stdlib")
ffi = FFI(backend=self.Backend())
ffi.cdef("""
float sinf(float x);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_____________________ TestFFI.test_lround_no_return_value ______________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff5cb2eb8>
def test_lround_no_return_value(self):
# check that 'void'-returning functions work too
ffi = FFI(backend=self.Backend())
ffi.cdef("""
void lround(double x);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
__________________________ TestFFI.test_dlopen_flags ___________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff521bd30>
def test_dlopen_flags(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
double cos(double x);
""")
> m = ffi.dlopen(lib_m, ffi.RTLD_LAZY | ffi.RTLD_LOCAL)
testing/cffi0/test_function.py:79:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 1
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_________________________ TestFFI.test_dlopen_constant _________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff579b978>
def test_dlopen_constant(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
#define FOOBAR 42
static const float baz = 42.5; /* not visible */
double sin(double x);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:90:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
________________________ TestFFI.test_function_typedef _________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff5bdbef0>
def test_function_typedef(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
typedef double func_t(double);
func_t sin;
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
________________________ TestFFI.test_missing_function _________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff56e6e10>
def test_missing_function(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
int nonexistent();
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:368:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
________________________ TestFFI.test_wraps_from_stdlib ________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff45d8be0>
def test_wraps_from_stdlib(self):
import functools
ffi = FFI(backend=self.Backend())
ffi.cdef("""
double sin(double x);
""")
def my_decorator(f):
@functools.wraps(f)
def wrapper(*args):
return f(*args) + 100
return wrapper
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:382:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_____________________ TestFFI.test_stdcall_only_on_windows _____________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff4cdc780>
def test_stdcall_only_on_windows(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("double __stdcall sin(double x);") # stdcall ignored
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:482:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
________________________ TestFFI.test_dir_on_dlopen_lib ________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff5cb5438>
def test_dir_on_dlopen_lib(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
typedef enum { MYE1, MYE2 } myenum_t;
double myfunc(double);
double myvar;
const double myconst;
#define MYFOO 42
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:500:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_____________________________ TestFFI.test_dlclose _____________________________
self = <testing.cffi0.test_ffi_backend.TestFFI object at 0x7ffff4ca0be0>
def test_dlclose(self):
if self.Backend is CTypesBackend:
py.test.skip("not with the ctypes backend")
ffi = FFI(backend=self.Backend())
ffi.cdef("int foobar(void); int foobaz;")
> lib = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:508:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
____________________________ TestFunction.test_sin _____________________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff4b86470>
def test_sin(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
double sin(double x);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff4b86a90>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
____________________________ TestFunction.test_sinf ____________________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff5ba57f0>
def test_sinf(self):
if sys.platform == 'win32':
py.test.skip("no sinf found in the Windows stdlib")
ffi = FFI(backend=self.Backend())
ffi.cdef("""
float sinf(float x);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff5ba5978>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
___________________ TestFunction.test_lround_no_return_value ___________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff4cdc9e8>
def test_lround_no_return_value(self):
# check that 'void'-returning functions work too
ffi = FFI(backend=self.Backend())
ffi.cdef("""
void lround(double x);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff4cdcb00>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
________________________ TestFunction.test_dlopen_flags ________________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff5cb7710>
def test_dlopen_flags(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
double cos(double x);
""")
> m = ffi.dlopen(lib_m, ffi.RTLD_LAZY | ffi.RTLD_LOCAL)
testing/cffi0/test_function.py:79:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff5cb7c18>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
______________________ TestFunction.test_dlopen_constant _______________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff5ca9b70>
def test_dlopen_constant(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
#define FOOBAR 42
static const float baz = 42.5; /* not visible */
double sin(double x);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:90:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff5ca9c88>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
______________________ TestFunction.test_function_typedef ______________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff4cb46d8>
def test_function_typedef(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
typedef double func_t(double);
func_t sin;
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff4cb45c0>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
______________________ TestFunction.test_missing_function ______________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff4d5eb00>
def test_missing_function(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
int nonexistent();
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:368:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff4d5e8d0>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_____________________ TestFunction.test_wraps_from_stdlib ______________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff4934438>
def test_wraps_from_stdlib(self):
import functools
ffi = FFI(backend=self.Backend())
ffi.cdef("""
double sin(double x);
""")
def my_decorator(f):
@functools.wraps(f)
def wrapper(*args):
return f(*args) + 100
return wrapper
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:382:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff570da90>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
__________________ TestFunction.test_stdcall_only_on_windows ___________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff4cd1630>
def test_stdcall_only_on_windows(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("double __stdcall sin(double x);") # stdcall ignored
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:482:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff4cd1208>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_____________________ TestFunction.test_dir_on_dlopen_lib ______________________
self = <testing.cffi0.test_function.TestFunction object at 0x7ffff525fb70>
def test_dir_on_dlopen_lib(self):
ffi = FFI(backend=self.Backend())
ffi.cdef("""
typedef enum { MYE1, MYE2 } myenum_t;
double myfunc(double);
double myvar;
const double myconst;
#define MYFOO 42
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_function.py:500:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <cffi.backend_ctypes.CTypesBackend object at 0x7ffff525fa58>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_________________________________ test_simple __________________________________
def test_simple():
ffi = FFI(backend=FakeBackend())
ffi.cdef("double sin(double x);")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_parsing.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <testing.cffi0.test_parsing.FakeBackend object at 0x7ffff4ca0278>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_____________________________ test_remove_comments _____________________________
def test_remove_comments():
ffi = FFI(backend=FakeBackend())
ffi.cdef("""
double /*comment here*/ sin // blah blah
/* multi-
line-
//comment */ (
// foo
double // bar /* <- ignored, because it's in a comment itself
x, double/*several*//*comment*/y) /*on the same line*/
;
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_parsing.py:166:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <testing.cffi0.test_parsing.FakeBackend object at 0x7ffff4d69f98>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
____________________ test_remove_line_continuation_comments ____________________
def test_remove_line_continuation_comments():
ffi = FFI(backend=FakeBackend())
ffi.cdef("""
double // blah \\
more comments
x(void);
double // blah\\\\
y(void);
double // blah\\ \
etc
z(void);
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_parsing.py:183:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <testing.cffi0.test_parsing.FakeBackend object at 0x7ffff52951d0>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
______________________ test_line_continuation_in_defines _______________________
def test_line_continuation_in_defines():
ffi = FFI(backend=FakeBackend())
ffi.cdef("""
#define ABC\\
42
#define BCD \\
43
""")
> m = ffi.dlopen(lib_m)
testing/cffi0/test_parsing.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <testing.cffi0.test_parsing.FakeBackend object at 0x7ffff4ca0e10>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
_________________________________ test_dlopen __________________________________
def test_dlopen():
ffi = FFI()
ffi.cdef("double sin(double x);")
> m = ffi.dlopen(lib_m) # unicode literal
testing/cffi0/test_unicode_literals.py:65:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cffi/api.py:141: in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
cffi/api.py:802: in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
name = 'm', flags = 0
def _load_backend_lib(backend, name, flags):
import os
if name is None:
if sys.platform != "win32":
return backend.load_library(None, flags)
name = "c" # Windows: load_library(None) fails, but this works
# on Python 2 (backward compatibility hack only)
first_error = None
if '.' in name or '/' in name or os.sep in name:
try:
return backend.load_library(name, flags)
except OSError as e:
first_error = e
import ctypes.util
path = ctypes.util.find_library(name)
if path is None:
if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
raise OSError("dlopen(None) cannot work on Windows for Python 3 "
"(see http://bugs.python.org/issue23606)")
msg = ("ctypes.util.find_library() did not manage "
"to locate a library called %r" % (name,))
if first_error is not None:
msg = "%s. Additionally, %s" % (first_error, msg)
> raise OSError(msg)
E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
cffi/api.py:797: OSError
--8<---------------cut here---------------end--------------->8---
Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:Message #10 received at 35371-done <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 35371-done <at> debbugs.gnu.org Subject: Re: bug#35371: [core-updates] python-cffi fails its test suite Date: Sat, 04 May 2019 23:27:33 -0400
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
[...]
> _________________________________ test_dlopen __________________________________
>
> def test_dlopen():
> ffi = FFI()
> ffi.cdef("double sin(double x);")
>> m = ffi.dlopen(lib_m) # unicode literal
>
> testing/cffi0/test_unicode_literals.py:65:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> cffi/api.py:141: in dlopen
> lib, function_cache = _make_ffi_library(self, name, flags)
> cffi/api.py:802: in _make_ffi_library
> backendlib = _load_backend_lib(backend, libname, flags)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> backend = <module '_cffi_backend' from '/tmp/guix-build-python-cffi-1.11.5.drv-0/cffi-1.11.5/build/lib.linux-x86_64-3.7/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'>
> name = 'm', flags = 0
>
> def _load_backend_lib(backend, name, flags):
> import os
> if name is None:
> if sys.platform != "win32":
> return backend.load_library(None, flags)
> name = "c" # Windows: load_library(None) fails, but this works
> # on Python 2 (backward compatibility hack only)
> first_error = None
> if '.' in name or '/' in name or os.sep in name:
> try:
> return backend.load_library(name, flags)
> except OSError as e:
> first_error = e
> import ctypes.util
> path = ctypes.util.find_library(name)
> if path is None:
> if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
> raise OSError("dlopen(None) cannot work on Windows for Python 3 "
> "(see http://bugs.python.org/issue23606)")
> msg = ("ctypes.util.find_library() did not manage "
> "to locate a library called %r" % (name,))
> if first_error is not None:
> msg = "%s. Additionally, %s" % (first_error, msg)
>> raise OSError(msg)
> E OSError: ctypes.util.find_library() did not manage to locate a library called 'm'
>
> cffi/api.py:797: OSError
The problem was caused by find_library not being able to open linker
scripts (it only understands ELF binaries); libm.so is a linker
script. The solution is to replace the shared library references by
their absolute, ELF binary location (e.g., for libm, that is
/gnu/store/...-glibc-2.28/lib/libm.so.6).
Fixed by commit 4e933afda42c41a5425fe460a0ee7ba5435e612b.
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org.
(Sun, 02 Jun 2019 11:24:05 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.