-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
pkgsBuildBuild.pkgsi686Linux in pkgsCross is build for cross platform #212494
Comments
Eh... $ nix eval nixpkgs#legacyPackages.x86_64-linux.pkgsCross.armv7l-hf-multiplatform.pkgsBuildBuild.stdenv.hostPlatform.system
"x86_64-linux"
$ nix eval nixpkgs#legacyPackages.x86_64-linux.pkgsCross.armv7l-hf-multiplatform.pkgsBuildBuild.pkgsi686Linux.stdenv.hostPlatform.system
"armv7l-linux"
$ nix eval nixpkgs#legacyPackages.x86_64-linux.pkgsCross.armv7l-hf-multiplatform.pkgsBuildBuild.pkgsMusl.stdenv.hostPlatform.system
"armv7l-linux" |
It turns out that having
This would make sense to me but no... It turns out it is instead:
What makes it confusing is that this is the same package set, but it doesn't feel like it should be:
The core issue is then probably that It might also be desirable to resolve the confusion I fell into here. |
For completeness, my original entry point to this was |
I have more discoveries because nobody else seems to care about this... It turns out that behaviour, where |
@Cynerd I ran into this on multiple cross compilation attempts. What do you think would be a way forward? |
@wucke13 I think the core issue is that we can't set a target platform. We can only set |
I didn't fully understand this whole issue - but I fixed the fact that Can you try whatever you did here ;) on my branch again and see whether that helps? |
On my branch mentioned above:
This looks a lot more what you'd expect, I guess? |
The previous logic to decide whether to "go musl" or "go i686" or not was based on comparing stdenv.buildPlatform and stdenv.hostPlatform. Those are the same for something like pkgsCross.gnu64 on linux x64. This then leads to the following: > pkgsCross.gnu64.pkgsMusl.stdenv.buildPlatform.config "x86_64-unknown-linux-musl" > pkgsCross.gnu64.pkgsMusl.stdenv.hostPlatform.config "x86_65-unknown-linux-gnu" This means the addition of pkgsMusl changed the *local system* and not the *cross system* - which is surely not what is intended here. Instead the cross system should be changed to musl / i686. A better way to detect this is to check whether a crossSystem had already explicitly been passed to nixpkgsFun. This also makes the following work as expected: pkgsCross.aarch64-darwin.pkgsx86_64Darwin pkgsCross.mingwW64.pkgsLinux Both now change the cross system instead of the local system. Resolves NixOS#212494
@wolfgangwalther yep those look better, but the derivation @Cynerd wants is still not compiling (with their workaround reverted). Not sure why though, all 3 platforms seem fine, yet arm is still sneaking in somewhere $ git checkout eb5a92b773db407046e7481c594d2fcba5aa31a3
$ git revert adfac122cd6a669c65dcf5a7d51544d9c122b977
$ nix eval .#legacyPackages.x86_64-linux.pkgsCross.raspberryPi.buildPackages.pkgsi686Linux.buildPlatform.system
"x86_64-linux"
$ nix eval .#legacyPackages.x86_64-linux.pkgsCross.raspberryPi.buildPackages.pkgsi686Linux.hostPlatform.system
"i686-linux"
$ nix eval .#legacyPackages.x86_64-linux.pkgsCross.raspberryPi.buildPackages.pkgsi686Linux.targetPlatform.system
"i686-linux"
$ nix build .#legacyPackages.x86_64-linux.pkgsCross.raspberryPi.buildPackages.glibc_multi.out
error: builder for '/nix/store/dyaqx9i9c9zbggl7icf23xsakk4ww9h8-i686-unknown-linux-gnu-nolibc-gcc-13.3.0.drv' failed with exit code 2;
last 25 log lines:
> checking whether fwrite_unlocked is declared... yes
> checking whether getchar_unlocked is declared... yes
> checking whether getc_unlocked is declared... yes
> checking whether putchar_unlocked is declared... yes
> checking whether putc_unlocked is declared... yes
> checking whether getrlimit is declared... yes
> checking whether setrlimit is declared... yes
> checking whether getrusage is declared... yes
> checking whether mallinfo is declared... yes
> checking whether mallinfo2 is declared... yes
> checking whether ldgetname is declared... no
> checking whether times is declared... yes
> checking whether sigaltstack is declared... yes
> checking for struct tms... yes
> checking for clock_t... yes
> checking for F_SETLKW... yes
> checking for O_CLOEXEC... yes
> checking for fcntl.h... (cached) yes
> checking whether O_NONBLOCK is declared... yes
> checking for AF_UNIX... yes
> checking for AF_INET6... yes
> checking for _LK_LOCK... no
> checking if mkdir takes one argument... no
> Unknown CPU given in --with-arch=armv6kz.
> make: *** [Makefile:4544: configure-gcc] Error 1
For full logs, run 'nix log /nix/store/dyaqx9i9c9zbggl7icf23xsakk4ww9h8-i686-unknown-linux-gnu-nolibc-gcc-13.3.0.drv'.
error: 1 dependencies of derivation '/nix/store/dy7fwhipjcf4rkzpp5ia96855b3qwzkk-i686-unknown-linux-gnu-nolibc-gcc-wrapper-13.3.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4cxd0w2vd164b4r3m45fbddb07sar5hv-libgcc-i686-unknown-linux-gnu-13.3.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/72p2bvj3jalgk2ffjlwwjh8mhmciabxb-stdenv-linux.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gfv8cfiwpld8i7qrmw1ijxxnajzd6207-glibc-i686-unknown-linux-gnu-2.39-52.drv' failed to build
error: 1 dependencies of derivation '/nix/store/lnkg5jjz0dyshjrgk0hraj5pmkl3pdqg-glibc-multi-2.39-52.drv' failed to build |
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.gnu64 is a cross compilation from musl to glibc - pkgsCross.gnu64.pkgsMusl is a cross compilation to musl - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.gnu64 is a cross compilation from musl to glibc - pkgsCross.gnu64.pkgsMusl is a cross compilation to musl - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.gnu64 is a cross compilation from musl to glibc - pkgsCross.gnu64.pkgsMusl is a cross compilation to musl - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.aarch64-multiplatform is a cross compilation from musl to glibc/aarch64 - pkgsCross.aarch64-multiplatform.pkgsMusl is a cross compilation to musl/aarch64 - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.aarch64-multiplatform is a cross compilation from musl to glibc/aarch64 - pkgsCross.aarch64-multiplatform.pkgsMusl is a cross compilation to musl/aarch64 - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.aarch64-multiplatform is a cross compilation from musl to glibc/aarch64 - pkgsCross.aarch64-multiplatform.pkgsMusl is a cross compilation to musl/aarch64 - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.aarch64-multiplatform is a cross compilation from musl to glibc/aarch64 - pkgsCross.aarch64-multiplatform.pkgsMusl is a cross compilation to musl/aarch64 - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.aarch64-multiplatform is a cross compilation from musl to glibc/aarch64 - pkgsCross.aarch64-multiplatform.pkgsMusl is a cross compilation to musl/aarch64 - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.aarch64-multiplatform is a cross compilation from musl to glibc/aarch64 - pkgsCross.aarch64-multiplatform.pkgsMusl is a cross compilation to musl/aarch64 - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.aarch64-multiplatform is a cross compilation from musl to glibc/aarch64 - pkgsCross.aarch64-multiplatform.pkgsMusl is a cross compilation to musl/aarch64 - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
The various pkgsXYZ top-level package sets did not pass localSystem / crossSystem to lower levels, so far. This change propagates original arguments to lower levels, which include the overrides made by an upper package sets. There is an extensive test-suite to test various combinations of package sets in pkgs/test/top-level. There are a few basic promises made: - Package sets must be idempotent. pkgsMusl.pkgsMusl === pkgsMusl. - Once pkgsCross is used any subsequent package sets should affect the **host platform** and not the build platform. Examples: - pkgsMusl.pkgsCross.aarch64-multiplatform is a cross compilation from musl to glibc/aarch64 - pkgsCross.aarch64-multiplatform.pkgsMusl is a cross compilation to musl/aarch64 - Modifications from an earlier layer should not be lost, unless explicitly overwritten. Examples: - pkgsStatic.pkgsMusl should still be static. - pkgsStatic.pkgsCross.gnu64 should be static, but with glibc instead of musl. Exceptions / TODOs: - pkgsExtraHardening is currently not idempotent, because it applies the same flags over and over again. Supersedes NixOS#136549 Resolves NixOS#114510 Resolves NixOS#212494 Resolves NixOS#281596
Steps To Reproduce
Steps to reproduce the behavior:
nix build nixpkgs#legacyPackages.x86_64-linux.pkgsCross.armv7l-hf-multiplatform.pkgsBuildBuild.gcc_multi
Build log
From
config.log
for 32bit gcc.Additional context
The error is caused by missing file in
glibc-multi
. That is created by mergingglibc
andpkgsi686Linux.glibc
. It turns out that issue is inpkgsi686Linux.glibc
which for some reason uses some options from host platform. This is output ofnix show-derivation nixpkgs#legacyPackages.x86_64-linux.pkgsCross.armv7l-hf-multiplatform.pkgsBuildBuild.pkgsi686Linux.glibc
The system is according to it
i686-linux
but it doesn't look like it. I was unable to find the real reason for this. It might be something instage.nix
. I also tried other packages inpkgsi686Linux
; they all seem to contain paths to armv7l instead of i686.Notify maintainers
@johnae @matthewbauer @danbst
Metadata
The text was updated successfully, but these errors were encountered: