From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 21 20:22:23 2019 Received: (at submit) by debbugs.gnu.org; 22 Apr 2019 00:22:23 +0000 Received: from localhost ([127.0.0.1]:49385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIMiz-0003cH-G1 for submit@debbugs.gnu.org; Sun, 21 Apr 2019 20:22:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIMiv-0003c3-Kn for submit@debbugs.gnu.org; Sun, 21 Apr 2019 20:22:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:57895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIMio-0008V9-RV for submit@debbugs.gnu.org; Sun, 21 Apr 2019 20:22:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIMij-0003yJ-96 for bug-guix@gnu.org; Sun, 21 Apr 2019 20:22:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FILL_THIS_FORM, FREEMAIL_FROM,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIMic-0008PM-RN for bug-guix@gnu.org; Sun, 21 Apr 2019 20:22:05 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:45963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIMia-0008OR-SG for bug-guix@gnu.org; Sun, 21 Apr 2019 20:21:57 -0400 Received: by mail-qk1-x732.google.com with SMTP id d5so3304070qko.12 for ; Sun, 21 Apr 2019 17:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=/2iFYkZfw2bGHhYWXO5065ywJHWZI9MpWbJFwdVVGl8=; b=HikD47hYavaiQpyQAH31WKDvE9ZZp2egMoC5KeXITcViy90cMK6Kr0qexi/fRpn66x THmI3sztUBGLQN+z/mL966xsAXpjN5bw6pSRb6QbJDaEhNaoYWNhvS9Cc/FWQV/uJONo HhcD/TbGVylap/kdfmkRf3TXQmwDCHIrTw6JppaD1nhtUPgnkcMZWyLdKairuwETxXcv x4kfymzglQyigBmtAGe0mgMPbSYGyfye5BqCAIOploDISFO+C4OxSZAbJoxtPLTP+jx6 oFTO9eSKdUpLL2JmyBNkVo04S0nohJnYcjiakyEf4IMF8AHduC5/vxrzmWP7ja1MPMGw H+tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=/2iFYkZfw2bGHhYWXO5065ywJHWZI9MpWbJFwdVVGl8=; b=MiiCqnxgUxxiOAx5S/gY56m+t54ffQoBf+6ky/9Ct/5NPY7cL44im4epwNI7v1VFWf Jn3bbBunypnUG/SggpUs/Ap5Ph861JIS7Cm6EiyNoF7irrOdqhkupCGXbxtNfpQvOtMD n+rHmObyBJvVFHJVa29WHVY8YOaM+UCMA+bmW5+FqXzbqd1cVq1LFhlPHfZTvJfAZGTj z6QlC+KeBg9lQVaf7pneCBKKcAqE1rxYstyBe660/sS+XXZt7/U8RJUfaxNyBb46DD1y b/kd5T+CvGT0jNX++fZjjrFeYIiGWiIMh2TJX1TpxeGjK6RRuEYheBELW1LRARdVuo4N FiPw== X-Gm-Message-State: APjAAAUdwhnhgDwHsgjGmyHj4tJHo/+7DC8KlVjCWeqJew6L58rEf39U hDIMFeFbiKWDJJHHSCxGrTVOgCjt X-Google-Smtp-Source: APXvYqxxttJBgwnqE/LYo3Bd3/ltqLwIGGVIKqb5g4/vvBc/yKLhafYe0m4J5afll1VaZ8rmwmOBrg== X-Received: by 2002:a37:a892:: with SMTP id r140mr5362551qke.285.1555892514550; Sun, 21 Apr 2019 17:21:54 -0700 (PDT) Received: from kwak (dsl-236-123-42.b2b2c.ca. [207.236.123.42]) by smtp.gmail.com with ESMTPSA id p6sm2241364qkc.13.2019.04.21.17.21.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Apr 2019 17:21:54 -0700 (PDT) From: Maxim Cournoyer To: bug-guix Subject: [core-updates] python-cffi fails its test suite Date: Sun, 21 Apr 2019 20:21:52 -0400 Message-ID: <87lg02zy73.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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--- From debbugs-submit-bounces@debbugs.gnu.org Sat May 04 23:27:43 2019 Received: (at 35371-done) by debbugs.gnu.org; 5 May 2019 03:27:43 +0000 Received: from localhost ([127.0.0.1]:52765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hN7oV-0005ps-0R for submit@debbugs.gnu.org; Sat, 04 May 2019 23:27:43 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:42847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hN7oT-0005pe-DV for 35371-done@debbugs.gnu.org; Sat, 04 May 2019 23:27:42 -0400 Received: by mail-qt1-f173.google.com with SMTP id p20so11124340qtc.9 for <35371-done@debbugs.gnu.org>; Sat, 04 May 2019 20:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=wOJPA6NUzJfXtr2qVi0QbjyESbhci5vXXGj11kE7/so=; b=h9BseqVNOR/4KRDM3fQDF0Aqu/+G9gaJzOlu/k8lNdwa+6mccKNUlw9Vbt0uwl+2wT 7dCLQgOx8jXox9voCqEumJONLEgky/u1owAKcsBvdfDaydPJZWKSzMpywouUqm/pQUFS ViMiqg09tDGAvuvIdmXhbj3HwqYYfQmsBIAEZ0mHEmH+gQp2wp31Mm3K25qTiefzfMb9 Tsi37vgZQeOtFymvcoF9AmJvUJsdaQCClOp6dmEttAyt5//5erke9SvvtpOhGTX340rk YrjHSvMarpzcu0wPX8GlrSy8xzSJShIaFRy69Nepl2PvtmDXsio1Dgb1AiNyMg7gkBI3 Qusg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=wOJPA6NUzJfXtr2qVi0QbjyESbhci5vXXGj11kE7/so=; b=gfDb/p02T2eOb1veqYnDhyVwlbYdVOhCPIzsA+uA2nik/9IhxAk47XZoRrzDYVICgE s6dFCfLD0IRcveco3pfZVODnzD8MQhgPDCcjSrXmZTGZTFC8d4NE8eyPEOzdKgUxUfCj gOXoJr/LwveGVJsmzKpFsBNr356dCKQRhMAEl+XFt7GYCW+yvac7uUXSViIm2OAg+pA6 H8+1D+YyijL7XMer2yYoBVC6moJJetZwERJ20l1TWEGzacy/tEc4hajTf8yclBD4bCD+ R3CLLs517fZ0zX46yiIne/76mbd25d8Wz14NsGpTnJKHfkKGl+i/ciw8SmQVlAxRPOzH 9Nvw== X-Gm-Message-State: APjAAAVMSrFk5sxccyg3nJU0NDS5cfQkEJp82MoQkmLRmdiTUNMs/1Zk cZF0xgMs81QDydMn/99EqE/3WJaD X-Google-Smtp-Source: APXvYqzrmQFOVLNAYbe/Raj6C3IS6KNEDC9uCmD+VtZ9aKO1MnBF0MF+Ywr9GpMBNJUvJnm66aoDNA== X-Received: by 2002:aed:22c5:: with SMTP id q5mr16152966qtc.386.1557026855693; Sat, 04 May 2019 20:27:35 -0700 (PDT) Received: from kwak (dsl-205-236-230-39.b2b2c.ca. [205.236.230.39]) by smtp.gmail.com with ESMTPSA id y64sm4130252qkd.71.2019.05.04.20.27.34 for <35371-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2019 20:27:34 -0700 (PDT) From: Maxim Cournoyer To: 35371-done@debbugs.gnu.org Subject: Re: bug#35371: [core-updates] python-cffi fails its test suite References: <87lg02zy73.fsf@gmail.com> Date: Sat, 04 May 2019 23:27:33 -0400 In-Reply-To: <87lg02zy73.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 21 Apr 2019 20:21:52 -0400") Message-ID: <87tve9k2ca.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35371-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Maxim Cournoyer 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 = > 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. From unknown Sat Sep 06 18:58:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 02 Jun 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator