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
[WIP] netbsd.compat: fix build with musl #41537
Conversation
Is that the right way to use Musl? @dtzWill had me testing with this:
Which hopefully still works. Either way your changes look good. No need to build install for musl if it's already available in buildPackages. |
crossSystem vs localSystem: "build musl-native or cross-compile to musl using glibc tools". I'm shocked that coreutils isn't building--looks like something indeed is rather wrong with cross wrapper and indeed the compiler isn't finding anything it should (and used to!). Will look into this... |
Works on staging, "phew". Looks like it's this: #41429 |
I broke cross on staging a few weeks ago. 645f03b fixes it on staging yesterday. Maybe we should get that to master sooner? |
Haha @dtzWill beat me. |
re:this PR, as-is I think the coreutils used might not run on the builder at all--consider cross-compiling to aarch64? I'm not sure best way to express these things re:strings, I think this should work though. UPDATE: Yep, here's cross-compiling to aarch64: https://gist.github.com/dtzWill/6b5db001e14e714563a696ede76bfd62 |
I think @orivej are the best way. AFAICT Nixpkgs splicing will rewrite "native" build inputs to buildPackages automatically. If you're referencing it outside of the inputs, buildPackages will accomplish the same thing for you. |
On staging I'm getting this: https://gist.github.com/dtzWill/f3a12fc18d2c16a9616f1ceb448003bc Which looks like we need to specify/provide a host-native compiler... |
Yeah I am still a noob on cross compiling - but that looks like it might work. |
Note that the zlib thing is an issue with dropbear as well: |
dropbear seems to work on staging for me, both local and cross. Is that perhaps an old job (without the fix mentioned earlier in this thread)? |
@Ericson2314 hmm, yes this would be nice to fix on master. Can you look into that? Is it just picking that commit? |
I think we'll have to wait for it to work through staging. It's a true mass rebuild - every single hash will change. FWIW I think we need to add some cross-compilation tests to release.nix to prevent this from happening again. The channel should block on some cross compilation things that we know should work. |
Merging for now because this is a step in the right direction. More PRs on this stuff are definitely welcome though. |
I am trying to make this succeed:
The first issue I encountered is that coreutils don't build for musl, but luckily they are only needed for the build platform. Here:
I could have added
coreutils
tonativeBuildInputs
and deletedmakeFlags
, but the definition seems to be making a point of using them only forinstall
, so I have qualified them withbuildPackages
.The next issue is that
netbsd.compat
configure fails to findzlib.h
. Fromconfig.log
:My test using the environment of the failed build:
So the issue is that
x86_64-unknown-linux-musl-gcc
is not usingNIX_TARGET_CFLAGS_COMPILE
, but I am not sure what exactly goes wrong.