From mboxrd@z Thu Jan 1 00:00:00 1970 From: zimoun Subject: (python) ctypes.util.find_library full path ? Date: Fri, 22 Feb 2019 15:51:17 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:35155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxCHn-0000ch-4p for guix-devel@gnu.org; Fri, 22 Feb 2019 09:58:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxCAp-0000j2-Qa for guix-devel@gnu.org; Fri, 22 Feb 2019 09:51:36 -0500 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:38092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxCAp-0000RT-FN for guix-devel@gnu.org; Fri, 22 Feb 2019 09:51:35 -0500 Received: by mail-qk1-x734.google.com with SMTP id p15so1270234qkl.5 for ; Fri, 22 Feb 2019 06:51:29 -0800 (PST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Guix Devel Dear, I would like to try WeasyPrint [1] to convert some HTML docs to PDF ones and maybe print them. Or maybe presentation etc. [1] https://weasyprint.org/ Well, excluding the check phase at first because some dependencies does not seem clean with Python2/Python3. Anyway! it is almost straightforward with `guix import pypi -r weasyprint'. Awesome ! (there is some tweaks in url: "cairosvg" -> "CairoSVG") However, the command `weasyprint` fails at run time. Because an issue about `dlopen'. To be precise, and from my understanding, the culprit is these lines: https://github.com/Kozea/cairocffi/blob/v1.0.2/cairocffi/__init__.py#L30-L31 In other word, ctypes.util.find_library('cairo') returns the expected 'libcairo.so.2'. But then it is not recognized by their `ffi.dlopen`. And if the full path is provided then it works, e.g., ffi.dlopen('/gnu/store/13i02w6r4awyb5d4n8plk8m0idvryib0-cairo-1.14.12/lib/libcairo.so.2') There is an old "similar" issue on the bug Nix tracker #7307 [2], asking if `ctypes.util.find_library` should return full path (so apply somehow a patch) or add another env variable. I do not know what is the status now. [2] https://github.com/NixOS/nixpkgs/issues/7307 My questions is: is there a fix for this kind of issue ? I guess, it should happen with Python packages. If yes, what is the trick ? If no, what should be the trick ? What do you think ? Thank you for any pointer and/or comments. All the best, simon