Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Compiling Python packages with C extensions with per-package directories
@ 2019-11-30 19:20 Asaf Kahlon
  2019-11-30 20:07 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Asaf Kahlon @ 2019-11-30 19:20 UTC (permalink / raw)
  To: buildroot

Hello,

As now some work on per-package directories has been merged for the
next release, I tried to play with it a little and encountered the
following problem:
When compiling a Python package with C sources, the compilation fails.
An example from python-cryptography (same for python-cffi, and others):
/home/asaf/repos/buildroot/output/per-package/python3/host/bin/i586-linux-gcc
-shared -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -Os -pthread
build/temp.linux-x86_64-3.8/build/temp.linux-x86_64-3.8/_openssl.o
-L/home/asaf/repos/buildroot/output/per-package/python-cryptography/host/i586-buildroot-linux-gnu/sysroot/usr/lib
-lssl -lcrypto -o
build/lib.linux-x86_64-3.8/cryptography/hazmat/bindings/_openssl.abi3.so
/opt/host/bin/../lib/gcc/i586-buildroot-linux-gnu/8.3.0/../../../../i586-buildroot-linux-gnu/bin/ld:
cannot find /lib/libc.so.6
/opt/host/bin/../lib/gcc/i586-buildroot-linux-gnu/8.3.0/../../../../i586-buildroot-linux-gnu/bin/ld:
cannot find /usr/lib/libc_nonshared.a

As one can notice - we used gcc from the python3 directory and not the
one from python-cryptography. When trying to understand the problem, I
did 2 things:
* Replacing the compiler to the one from python-cryptography.
* Replacing the "-L" part to the correspondent one from python3 directory.
Each of the above (individually) fixes the problem, but I don't think
the second option is good because it uses a compiler from another
sysroot.
I think the problem occurs since the _sysconfigdata file is installed
when compiling Python and contains paths from the python3 directory,
although it's used by many other Python packages (I also verified that
by manually replacing relevant paths from the copy at
python-cryptography).

So, what do we want to do with this?
I don't think we want to tweak the _sysconfigdata file for every
python package (although it would lead to a more "correct" situation,
in which every sysroot contains _sysconfidata with proper paths).
In addition, I wonder why do we need to copy all the toolchain-related
files for every single package? (Maybe a symlink can help?)
Any other suggestions?

Thanks,
Asaf.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-30 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-30 19:20 [Buildroot] Compiling Python packages with C extensions with per-package directories Asaf Kahlon
2019-11-30 20:07 ` Thomas Petazzoni
2019-11-30 20:57   ` Asaf Kahlon
2019-11-30 21:27     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox