-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgsCross.python3Packages.cffi passes -I${buildPackages.python}/include to gcc #186525
Comments
Can't we change it to point to the correct python? |
I could not figure out how to do that. I the undesirable
|
Could you check whether this problem still occurs in staging? I think 2e7c392 should fix this. |
Yes! Cherry-picking that commit fixes this issue! Thank you @lopsided98! |
Python cross-compilation is quite difficult, and doesn't work in several situations, such as: NixOS#186525 Let's give people the option of cross-compiling `btrfs-progs` to hostPlatforms for which we cannot cross-compile python. Unfortunately btrfs-progs insists on a special configure flag `--disable-python`; simply being unable to find python isn't enough.
Note: I don't expect anybody else to fix this for me, but I also want to acknowledge that my python skills are totally inadequate for the task. This bug is filed mostly so I can reference it as justification for #186527.
Describe the bug
Cross-compilation of
python3Packages.cffi
(and probably many other packages too) ends up invoking the C compiler with a-I
flag pointing to the build platform's python headers. This works sometimes, but will fail if the build and host platform have differently-sizedlong
types. Theinclude/python3.10/pyconfig.h
file is platform-specific, so it matters whether the build'spyconfig.h
is used versus the host's. However we've probably been "getting away with it" when both host and build are ILP64 platforms.fails with (reformatted for readability):
The second
-I
flag above should point to/nix/store/...-python3-mips64el-unknown-linux-gnuabin32-3.10.5/include/python3.10
.Notify maintainers
@domenkozar
@LnL7
The text was updated successfully, but these errors were encountered: