-
-
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
Build failure: pkgsCross.mingwW64.pkgsStatic.stdenv #281596
Comments
|
nixpkgs/pkgs/top-level/stage.nix Lines 265 to 278 in 2fba629
The Windows case doesn't seem to be covered here, since for MinGW-w64, nixpkgs/lib/systems/examples.nix Lines 311 to 316 in cefcf19
So I guess |
Bump, this issue is quite unfortunate when attempting to build static apps through nix. |
This makes combinations work, where pkgsStatic is used on another package set, for example: - Keeps pkgsCross.mingwW64.pkgsStatic.stdenv.hostPlatform.config at "x86_64-w64-mingw32" - Keeps pkgsLLVM.pkgsStatic.stdenv.hostPlatform.useLLVM at "true" Makes pkgsCross.mingwW64.pkgsStatic.stdenv build. Not sure whether it actually builds static executables already, though. Resolves NixOS#281596
I was able to build a static windows (mingwW64) executable with 34cefd7. edit: It seems #303849 is not merged yet. So I'm just leaving this information here. |
Hi, is there any possible work around for this? |
The work-around is to "properly" instantiate cross compilation. Compare the following on nixos-24.05 at dc2e002. ❯ nix-build '<nixpkgs>' -A pkgsCross.mingwW64.pkgsStatic.stdenv
[..]
checking host system type... Invalid configuration 'x86_64-w64-windows-gnu': Kernel 'windows' not known to work with OS 'gnu'.
configure: error: /nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin/bash ./build-aux/config.sub x86_64-w64-windows-gnu failed
error: builder for '/nix/store/j8yx9qfk3yyfq2p5w7k0lmg2xkbypfkr-mingw_w64-headers-static-11.0.1.drv' failed with exit code 1; vs ❯ nix-build --expr '(import <nixpkgs> { crossSystem = { config = "x86_64-w64-mingw32"; isStatic = true; }; }).stdenv'
/nix/store/m77b2dla2w3k8cx4ggjdmm2j8nldy6j6-stdenv-linux The problem is not that static mingw64 cross-compilation is broken. The problem is that |
Whether that's "proper" or not... is a question of it's own. For example for linux, So imho, there is too much knowledge / dependency in nixpkgs about pkgsStatic already to say it's not correct to use it. Also.. is it really the composition that is broken? What about the following?
Yup, broken as well. |
What is the difference between |
It does - but it's not static anymore. Semantically it would mean something else than the first line. The second line would be: "Use a statically compiled build system to cross-compile to dynamically linked mingw". |
I see, that makes sense. |
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
Steps To Reproduce
Steps to reproduce the behavior:
Build log
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: