From: Danny Milosavljevic <dannym@scratchpost.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: (python) ctypes.util.find_library full path ?
Date: Sun, 24 Feb 2019 20:02:33 +0100 [thread overview]
Message-ID: <20190224200233.1c029e22@scratchpost.org> (raw)
In-Reply-To: <CAJ3okZ2H9wYo76f=oUcwWjn6zwz23B0iv8UW+VAN9dNBn5NSjw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1609 bytes --]
Hi zimoun,
On Fri, 22 Feb 2019 15:51:17 +0100
zimoun <zimon.toutoune@gmail.com> wrote:
> 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')
> <Lib object for
> '/gnu/store/13i02w6r4awyb5d4n8plk8m0idvryib0-cairo-1.14.12/lib/libcairo.so.2'>
> 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 ?
One possibility:
(1) Make the guix package patch the file cairocffi/__init__.py in order
to make it pass the correct path to cairo.so.2 to dlopen. Furthermore,
make it remove the call to ctypes.util.find_library (replace by "do nothing").
The other possibility is to
(2) wrap weasyprint so LD_LIBRARY_PATH is set up.
In this case, since python-cairocffi is presumably also used by others,
set it up to do (1). But I checked guix master, the package
"python-cairocffi" there is already set up for (1).
Are you sure you didn't accidentially create a duplicate that doesn't?
Are you sure that the culprit isn't in python-cairosvg ?
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-02-24 19:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 14:51 (python) ctypes.util.find_library full path ? zimoun
2019-02-23 15:39 ` Alex Vong
2019-02-25 13:56 ` zimoun
2019-02-24 19:02 ` Danny Milosavljevic [this message]
2019-02-25 14:02 ` zimoun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190224200233.1c029e22@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=guix-devel@gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.