Skip to content

make pkgsStatic composable by not overriding all of hostPlatform#434771

Closed
Qyriad wants to merge 1 commit intoNixOS:stagingfrom
Qyriad:fix-pkgs-static-forwarding
Closed

make pkgsStatic composable by not overriding all of hostPlatform#434771
Qyriad wants to merge 1 commit intoNixOS:stagingfrom
Qyriad:fix-pkgs-static-forwarding

Conversation

@Qyriad
Copy link
Member

@Qyriad Qyriad commented Aug 18, 2025

pkgsStatic was keeping hostPlatform.parsed, but all other configured parts of hostPlatform (AKA crossSystem) were discarded. This fixes that, making pkgsStatic work like pkgsLLVM, pkgsZig, etc.

Fixes #434755.

I'm not sure what of pkgsStatic.* or pkgsLLVM.* Hydra builds, so I've targeted staging instead of master.

cc @emilazy, @wolfgangwalther; you (reasonably) are against nesting the pkgs variants selectors in the first place, but since the fix is trivial I figure you can take a look

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

`pkgsStatic` was keeping `hostPlatform.parsed`, but all other configured
parts of `hostPlatform` (AKA `crossSystem`) were discarded. This fixes
that, making `pkgsStatic` work like `pkgsLLVM`, `pkgsZig`, etc.

And now `pkgsLLVM.pkgsStatic` is the same as `pkgsStatic.pkgsLLVM` 🎉
@nix-owners nix-owners bot requested a review from Ericson2314 August 18, 2025 17:22
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Aug 18, 2025
@wolfgangwalther
Copy link
Contributor

you (reasonably) are against nesting the pkgs variants selectors in the first place, but since the fix is trivial I figure you can take a look

I can assure you, none of this is trivial. Your change leads to this:

nix-repl> pkgsLLVM.pkgsStatic.stdenv.hostPlatform.config
"x86_64-unknown-linux-musl"

nix-repl> pkgsLLVM.pkgsStatic.stdenv.hostPlatform.libc
"glibc"

Nope, this is not going to work. As @emilazy pointed out, if you're interested in that, you should look at #380342 and its predecessor #303849 - and some more linked PRs in there.

Beware of getting too deep into the rabbit-hole, though...

@emilazy
Copy link
Member

emilazy commented Aug 18, 2025

FWIW I do want to fix the lack of input vs. output separation in platform definitions that would make this kind of operation possible to do in a way that makes sense. (I just think the package variant sets are a dubious interface to begin with.)

Unfortunately it is hard.

@Qyriad
Copy link
Member Author

Qyriad commented Aug 18, 2025

Yeeeep. Well, I figured it was worth a try to make it mildly-less-broken over a Proper Fix, but alas 😔

@Qyriad Qyriad closed this Aug 18, 2025
@Qyriad Qyriad deleted the fix-pkgs-static-forwarding branch August 18, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants