-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
ghc: Add variantSuffix
, fix musl
+integer-simple
#138524
Conversation
d7d99e4
to
bc5a969
Compare
I can confirm that this works in my project ( |
* Experiment: Bump nixpkgs to latest master This is to see if there are problems coming up. Some of the things in nix/haskell-packages.nix can probably be cleaned up now. Originally https://github.com/dfinity-lab/ic-ref/commit/dce1286a900525607fcc21171b82940e3ec3385f * Bump again Originally https://github.com/dfinity-lab/ic-ref/commit/b43f83609fd3a99e0a8ecd8700f4baee0c53b863 * Bump once more Originally https://github.com/dfinity-lab/ic-ref/commit/a0746ed7be49c8f1619e5b75ba84d5c832730cf8 * Fix merge issue * Fix path * Back to master * Try winter master * Remove many haskell package changes * More simplification and upstream cache use * Update freeze file * Less versionoverrides needed * Remove nix/haskell-packages, more DNRY * Fix patch handling * Add .gitattributes to mark generated files as such * s/ / / * Run github actions with ghc-8.10.7 * Fix docs jobs * Fix docs jobs some more * Update cabal.project * Bump candid some more * Checkout before setting up the cache * Fix cabal keys * Don’t set active-repositories in freeze file * Rename workflow * naersk changed it seems * Try pkgsStatic, not pkgsMusl as the latter doesn’t seem to work any more since NixOS/nixpkgs#130441 * Fix static cborg build * Try static-haskell-nix * Revert "Try static-haskell-nix" This reverts commit b375ad4. * Revert "Try pkgsStatic, not pkgsMusl" This reverts commit d1f64f1. * Try pkgsMusl again pulling in NixOS/nixpkgs#138429 * Update freeze file * Right GHC version * Try NixOS/nixpkgs#138524
@@ -139,7 +145,7 @@ in | |||
stdenv.mkDerivation rec { | |||
inherit version; | |||
|
|||
name = "ghc-${version}-binary"; | |||
name = "ghc-${version}-binary${binDistUsed.variantSuffix}"; |
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.
Appending something to a derivation name
is usually a bad idea since builtins.parseDrvName
interprets everything after the first number after a dash as the version.
We are already doing this for the binary ones, but we shouldn't expand this. So let's take this opportunity to redo the naming of the binary derivations as well and move the -binary
suffix before the version number (maybe in a separate commit?):
name = "ghc-${version}-binary${binDistUsed.variantSuffix}"; | |
name = "ghc-binary${binDistUsed.variantSuffix}-${version}"; |
Of course would need to be reflected in the other derivations as well. If you don't feel like doing it, I can also take care of that for you.
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.
That's a good point.
I think we should do it the way you suggest.
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.
This was done in #139164 which I've already merged into haskell-updates
(with the variant suffix changes as well).
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.
This was done in PR #139164.
@@ -77,7 +77,7 @@ in { | |||
# aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar | |||
# Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them | |||
else if stdenv.isAarch64 || stdenv.targetPlatform.isMusl then |
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.
You can drop the aarch64-darwin
condition above, since stdenv.isAarch64
will also catch that.
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.
Yes, that makes sense.
@@ -91,7 +91,7 @@ in { | |||
# aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar |
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.
You can drop the aarch64-darwin condition above, since stdenv.isAarch64 will also catch that.
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.
Yes, that makes sense.
@@ -108,19 +108,19 @@ in { | |||
packages.ghc8107BinaryMinimal |
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.
You can drop the aarch64-darwin condition above, since stdenv.isAarch64 will also catch that.
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.
Yes, that makes sense.
…endency. GHC HQ switched the musl bindists from gmp to `integer-simple` with GHC >= 8.10.6, but this was not reflected in the nixpkgs update: * commit 6f12424: ghc: 8.10.5-binary -> 8.10.7-binary From PR NixOS#135453 See also NixOS#130441.
When debugging musl builds, I often have to sift through thousands of lines of `nix-store -q --tree` or `nix-store -qR` output. Until now, `pkgsMusl` and normal `pkgs` GHCs looked exactly the same in there, making that task tough. Same for `integer-simple`, which makes debugging `gmp` issues easier. This commit introduces a suffix to tell them apart easily. Note that this is different from `targetPrefix` which is for cross-compilation, which `pkgsMusl` does not do.
bc5a969
to
8ec92c5
Compare
Closing in favour of these PRs that include all these changes, rebased: |
Motivation for this change
musl
+integer-simple
combination unbroken (was marked as broken in PR ghc: mark broken for musl + integer-simple builds #130441).gmp
, but was built againstinteger-simple
itself.name
for all GHCs so that you can tell whether it's a-musl
and/or-integer-simple
variant, making inspection withnix-store -q --tree
much easier, and copy-pasted nix error messages more obvious (you know which GHC variant failed to build).Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)TODO
if stdenv.isAarch64 || stdenv.isAarch32
blocks as well, and I cannot test those, so somebody else needs to help with that.