Skip to content

haskellPackages: reflect changed libdir location for hadrian built GHCs#212107

Merged
sternenseemann merged 7 commits intoNixOS:haskell-updatesfrom
sternenseemann:hadrian-libdir
Feb 5, 2023
Merged

haskellPackages: reflect changed libdir location for hadrian built GHCs#212107
sternenseemann merged 7 commits intoNixOS:haskell-updatesfrom
sternenseemann:hadrian-libdir

Conversation

@sternenseemann
Copy link
Member

@sternenseemann sternenseemann commented Jan 22, 2023

Description of changes

With hadrian ghc's libdir will be $out/lib/${targetPrefix}ghc-${version}/lib instead of $out/lib/${targetPrefix}ghc-${version}. This is relatively inconsequential for us, since we assemble our package dbs manually in most cases and we thus can register libraries located anywhere.

However, for ghcWithPackages we symlink our libraries into the same location as the package db shipped with GHC and run ghc-pkg recache. For this to work, the installation location of the libraries need to mirror GHC's libdir. This is what this PR does.

To facilitate this, haskellPackages.mkDerivation has been refactored a bit. It is best to review these commit by commit. If everything is done correctly, this PR should cause zero rebuilds.

Fixes #211608. cc @locallycompact for testing.

  • haskellPackages no rebuilds
  • pkgsCross.aarch64-multiplatform.haskellPackages no rebuilds
  • ghcHEAD withPackages
  • ghc8102Binary musl withPackages
  • ghc8107Binary musl withPackages
  • ghc924Binary musl withPackages
  • ghcHEAD ordinary package compilation
  • no rebuilds haskellPackages x86_64-darwin
  • no rebuilds pkgsStatic.haskellPackages
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Jan 22, 2023
@sternenseemann sternenseemann linked an issue Jan 22, 2023 that may be closed by this pull request
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jan 22, 2023
@locallycompact
Copy link
Contributor

Working for me now.

@sternenseemann
Copy link
Member Author

sternenseemann commented Jan 22, 2023

Need to investigate the darwin rebuilds still.

Edit: Working as intended, affects ghcHEAD – here the bindists used for bootstrapping are using hadrian, so the derivations used for building hadrian change.

Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with what exact changes are necessary now with the Hadrian stuff, but the stuff in this PR seems reasonable.

@sternenseemann sternenseemann merged commit 328d6f8 into NixOS:haskell-updates Feb 5, 2023
@sternenseemann sternenseemann deleted the hadrian-libdir branch February 5, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ghcWithPackages doesn't work for hadrian-built GHCs

3 participants