-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
pkgsMusl.pkgsStatic.stdenv is broken #114510
Comments
Isn't
I'm not sure what the difference should be when comparing To me, it feels like |
Musl is not necessarily static, so pkgsMusl can be dynamic. I think pkgsStatic implies musl but only because glibc is bad at static linking. So I think pkgsStatic.pkgsMusl would be redundant but pkgsMusl.pkgsStatic would not be. |
Yes, sorry, I should have made it clear that they shouldn't be expected to be equivalent, but at the current time, I would have assumed them to be equivalent. Since I'm wondering what are the differences in semantics that makes (the current implementation details heavy) |
Hmm yeah that's really weird. I'm not sure of the underlying cause, but here's one observable difference:
|
Wait a minute, that makes no sense. Shouldn't pkgsStatic.pkgsMusl mean musl and static? Does the pkgsMusl set "start over" and forget that it's still supposed to be static? |
Definitions:
I guess one difference is the possible use of Though I don't really grok how this "resets" Should |
Thanks for posting that, I had assumed the pkgsStatic/pkgsMusl logic would be too complicated to skim but that's actually very well-contained and self-documenting. Is the "resetting" just a matter of pkgsMusl setting Also, I think I understand the non-commutativity now. When pkgsMusl is native, it switches over the build system to use musl as well. I think this is because the ordinary linux stdenv is able to bootstrap with musl or glibc, so we can take the native compilation pathway as it's more reliable.
However, there is no native static stdenv. The static stdenv still uses a dynamic buildPlatform, and goes the cross-compilation route to produce a final static package. So pkgsMusl.pkgsStatic is cross-compiling from dynamic to static musl, while pkgsStatic.pkgsMusl triggers the Primitive demo: for set in pkgsMusl.pkgsStatic pkgsStatic.pkgsMusl; do
for platform in buildPlatform hostPlatform; do
x=nixpkgs.$set.stdenv.$platform
echo $set.$platform: $(nix eval $x.config) $(nix eval $x.isStatic)
done
done
Ultimately this is all pretty tangential to the original issue, lol. I guess my conclusion is that pkgsMusl.pkgsStatic is broken due to the issue in the OP but otherwise sound and useful. Meanwhile pkgsStatic.pkgsMusl is completely busted. |
I marked this as stale due to inactivity. → More info |
pkgsMusl.pkgsStatic.stdenv was fixed by #119625. pkgsStatic.pkgsMusl.stdenv is still broken. |
I marked this as stale due to inactivity. → More info |
Opened a new issue for |
This makes combinations work, where pkgsi686Linux or pkgsMusl are used on another package set, for example: - Keeps pkgsStatic.pkgsMusl.stdenv.hostPlatform.isStatic at "true" - Keeps pkgsCross.ppc64-musl.pkgsMusl.stdenv.hostPlatform.gcc.abi at "elfv2" - Keeps pkgsLLVM.pkgsi686Linux.stdenv.hostPlatform.useLLVM at "true" Supersedes NixOS#136549 Resolves NixOS#114510
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
Describe the bug
The gcc used for pkgsMusl.pkgsStatic.stdenv fails to build on x86_64-linux, due to a faulty bintools setup, as pointed out by Sandro here: #112096 (comment).
I think the reason for this is that the binutils hostPlatform is different from the targetPlatform (host is dynamic musl, target is static) but the configs are both
x86_64-unknown-linux-musl
. So our package definitions expect the resulting bintools to have ax86_64-unknown-linux-musl
targetPrefix, but they do not because the autotools configure script only sees matching host/target configs, so it produces unprefixedld
,as
, etc binaries.To Reproduce
nix-build '<nixpkgs>' -A pkgsMusl.pkgsStatic.stdenv
Notify maintainers
Nixpkgs cross maintainers: @matthewbauer @Ericson2314
Metadata
"x86_64-linux"
Linux 5.4.87, NixOS, 21.03pre268206.536fe36e23a (Okapi)
yes
yes
nix-env (Nix) 2.3.10
"nixos-21.03pre268206.536fe36e23a"
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information:
The text was updated successfully, but these errors were encountered: