haskell.compiler: use wrapper scripts over propagating#147361
Merged
sternenseemann merged 7 commits intoNixOS:haskell-updatesfrom Nov 25, 2021
Merged
haskell.compiler: use wrapper scripts over propagating#147361sternenseemann merged 7 commits intoNixOS:haskell-updatesfrom
sternenseemann merged 7 commits intoNixOS:haskell-updatesfrom
Conversation
Member
Author
|
@ofborg build haskell.compiler.ghc8107 |
Copy the approach from the normal GHC derivations for adding an `export PATH` into the scripts in `$out/bin` and use it to put the specific LLVM version of the binary GHC into its PATH. This will prevent the LLVM version of the GHC we are building later to take precedence over the LLVM version this GHC needs.
This brings the binary GHCs on parity with the source built ones in terms of the wrapper. The upshot of this is that compiling something using the binary GHCs no longer depends on PATH being populated with the tools included in stdenv at all. We can even test this by running the installCheck with an empty environment (via `env -i`).
8f9d548 to
d8cf2dc
Compare
Member
Author
|
@ofborg build haskell.compiler.ghc865Binary haskell.compiler.ghc8102Binary haskell.compiler.ghc8107Binary pkgsMusl.haskell.compiler.gh8102Binary pkgsMusl.haskell.compiler.ghc8107Binary |
This will prevent freak accidents where the wrong tools are used because they are in PATH by chance.
This has two main benefits: * GHC will work reliably outside of stdenv, even when using -fllvm since everything it'll call at runtime will be provided in PATH via the wrapper scripts. * LLVM will no longer leak into haskell packages' configure scripts. This was an issue with llvm-hs which fails to build if the LLVM version of the compiler since the propagatedBuildInputs of GHC take precedence over the nativeBuildInputs added in the derivation.
d8cf2dc to
a7c5645
Compare
Member
Author
|
@ofborg build haskell.packages.ghc901.hello |
Since GHC now will have LLVM available when needed, we don't need to add it in the wrapper anymore. It can still be added if NCG is available, but -fllvm should be used (e. g. to work around an NCG bug).
aarch64-darwin NCG was added in 9.2.1 which makes it unnecessary to include LLVM in the wrapper.
9248dad to
ef081bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Currently the C compiler and LLVM binaries used by GHC are
propagatedBuildInputs. This has several downsides:stdenvornixpkgs, propagation is not respected and these binaries will not be inPATH— and GHC won't work.the binary GHC, causing a lot of warnings about unsupported LLVM versions to show up.
llvm-hs9.0.1 to fail onaarch64-linuxwhen compiling with a GHC which uses the LLVM backend and a more recent LLVM version.TODO:
aarch64-linux)ghcWithPackageswrapper for the fact that LLVM only needs to be injected after explicit request nowThings done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes