-
-
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
justStaticExecutables: Forbid references to GHC #304352
justStaticExecutables: Forbid references to GHC #304352
Conversation
I like this. A bit sad that this makes justStaticExecutables better than enableSeparateBinOutput. I forgot whether there is a per output option regarding requisites. We will need to make sure that this doesn’t break any of the Haskell binaries that we ship in nixpkgs so this definitely needs to merge into haskell-updates. |
@maralorn Agreed, how do I do that? Just change the merge target? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disallowedRequisites
needs to become an argument to haskellPackages.mkDerivation
and transparently passed on to stdenv.mkDerivation
in there. Otherwise disallowedRequisites
will only be set depending on override order, i.e. any overrideCabal
-based function applied after justStaticExecutables
would revert the change again, as it uses a different fix point from overrideAttrs
.
@sternenseemann I'm not sure how to make that work; I can add Maybe it could be made to work with some functor magic, but I wouldn't know how to wire it up robustly. |
@9999years |
Ah, I get what you mean. In principle you can literally add an |
Or |
49ce66f
to
dc0af03
Compare
@sternenseemann Still looking for a review on this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the wait!
dc0af03
to
e1bc2ba
Compare
PTAL |
d83abc3
to
9e9a2f2
Compare
I've realized that we can't backport this anymore since this is technically a breaking change. I've moved the changelog entry to the 24.11 release notes as a result. We could backport a version of this which adds the new arguments to I've also noticed that we haven't documented |
@9999years Evals newer than 1806586 of haskell-updates contain your change. There are already a few regressions I've seen on aarch64-darwin. This is not really surprising as GHC can't properly eliminate dead code on that platform. It may be prudent to ignore |
Which attributes are impacted? |
@9999years They should accumulate here. Note that a lot of builds are still pending so the list will get longer as time goes on. |
Fixes `cabal-install` to remove references to GHC, mostly through other libraries that are included in the binary. See: NixOS#304352
Remove references to `hpack` and `distribution-nixpkgs` paths so that `cabal2nix` can build on macOS. See: NixOS#304352
Remove references to `hpack` and `distribution-nixpkgs` paths so that `cabal2nix` can build on macOS. See: #304352
Fixes `cabal-install` to remove references to GHC, mostly through other libraries that are included in the binary. See: #304352 Co-authored-by: sternenseemann <[email protected]>
All these references would (indirectly) incur a GHC requisite which is prevented by NixOS#304352 via justStaticExecutables. Consequently, we can stop setting disallowedReferences. As it turns out the references we were removing aren't currently created, so our life gets even easier.
All these references would (indirectly) incur a GHC requisite which is prevented by #304352 via justStaticExecutables. Consequently, we can stop setting disallowedReferences. As it turns out the references we were removing aren't currently created, so our life gets even easier.
This commit disables justStaticExecutables for packages on aarch64-darwin that incur a (usually incorrect) reference on GHC. justStaticExecutables now fails when a GHC reference remains in the output (#304352). Due to this reference justStaticExecutables (before these changes) would only marginally reduce closure size. In the future, we'll be able to re-introduce justStaticExecutables after (manually) removing the incorrect references stemming from the use of Paths_* modules. Tracking Issue: #318013
Description of changes
This makes
justStaticExecutables
error if the produced store path contains references to GHC. This is almost always erroneous and due to the generatedPaths_*
module being imported. This helps preventjustStaticExecutables
from producing binaries with closure sizes in the gigabytes.See: #164630
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.