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
swig: fix cross compilation #51172
swig: fix cross compilation #51172
Conversation
@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.buildPackages.swig |
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec { | |||
sha256 = "1wyffskbkzj5zyhjnnpip80xzsjcr3p0q5486z3wdwabnysnhn8n"; | |||
}; | |||
|
|||
nativeBuildInputs = [ autoconf automake libtool bison ]; | |||
nativeBuildInputs = [ autoconf automake libtool bison pcre.dev ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is in nativeBuildInputs
I wonder why this is the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcre-config is missing when pcre is in buildInputs. See pcre drv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, rebuild linux 500+ :( Could you also check the normal compilation? Got scard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can push this to staging.
Success on aarch64-linux (full log) Attempted: pkgsCross.aarch64-multiplatform.buildPackages.swig Partial log (click to expand)
|
Ah it was already staging. Nevermind. I merged it in 8e97e80 |
Timed out, unknown build status on x86_64-linux (full log) Attempted: pkgsCross.aarch64-multiplatform.buildPackages.swig Partial log (click to expand)
|
Timed out, unknown build status on x86_64-darwin (full log) Attempted: pkgsCross.aarch64-multiplatform.buildPackages.swig Partial log (click to expand)
|
This doesn't look right... you should not use buildPackages pcre-config. Instead, something like this is recommended:
|
well. This does not work either when pcre-config is compiled for the wrong architecture. |
It should be a bash script in this case at least |
But the shebang is still incorrect. |
Yeah ideally it would use /usr/bin/env sh in this case. Although it is safe for now to just assume the build platform will always be the same in nix. build1 -> target will be a different drv from build2-> target even though they should in theory be the same. |
There is no |
An more general solution for the problem could be to have a build support hook that puts the right binary/variant in the PATH. Which means that pcre-config in |
Motivation for this change
Fixes #51171
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)