forked from input-output-hk/haskell.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ghc 8.4.4 based tools to ghc 8.6.5 (input-output-hk#618)
Although the default ghc used by haskell.nix is ghc 8.6.5 many of the tools used in haskell.nix are still built with the boot compiler ghc 8.4.4. These include * haskell-nix.cabal-install * haskell-nix.alex * haskell-nix.happy This change updates those to ghc 8.6.5 and includes materializations for the new versions. When cabal-install is built it is careful to disable materialization checks on the version of itself used during the build to avoid infinite recursion. There was a version of nix-tools built with the boot ghc which was only used when `checkMaterialization = true`. It was used for the boot versions of alex, happy and hscolour. These have been update to use the default (ghc 8.6.5) version of nix-tools and checkMaterialization is forced off when they are being used to build ghc. This means the materialization will only be checked for these when they are built independently (they are included in the test set via haskellNixRoots). Three new arguments are added to `default.nix`: * `defaultCompilerNixName` if not specified "ghc865" is used * `checkMaterialization` makes it easier to switch on materialization checks * `system` defaults to `builtins.currentSystem` This change also moves the work needed for hydra eval to the eval system using a new `evalPackages` feature. This includes: * Fetching from git with `fetchgit` * Building scripts with `runCommand` and `writeTextFile` * `git ls-files` in `cleanGit` * running `cabal v2-configure` * copying materialized files (we are not sure why this is necessary but if we do not `cp -r` the files nix will not load them on hydra) Reduce size of `make-config-files.nix` strings by around 80%. These are unlikely to be the cause of hydra eval time memory issues in the GB range, but were still quite large (around 10MB for the `cabal-simple` test case). There was issue causing excessive builds of the `git` package when cross compiling. Gory details are a comment in `lib/defaults.nix` but in short if you use `git` you need an extra `.buildPackages` one is not enough because it depends on `gdb` and that will be different in `buildPackages` compared to `buildPackages.buildPackages`. Adds missing materialization files for ghc 8.4.4 (only needed when `checkMaterialization` is on because of other materialiazations, but good to have).
- Loading branch information
1 parent
78bc725
commit 099d830
Showing
52 changed files
with
6,257 additions
and
437 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,50 @@ | ||
let haskellNix = rec { | ||
let haskellNix = { | ||
checkMaterialization ? false, # Allows us to easily switch on materialization checking | ||
defaultCompilerNixName ? null, # Quick way to override the default compiler e.g. "ghc883" | ||
system ? builtins.currentSystem, | ||
... }: rec { | ||
sources = { | ||
inherit (import ./nixpkgs/default.nix) nixpkgs-1909 nixpkgs-2003 nixpkgs-default; | ||
}; | ||
|
||
config = import ./config.nix; | ||
overlays = [ allOverlays.combined ]; | ||
overlays = [ allOverlays.combined ] ++ ( | ||
if checkMaterialization == true | ||
then [( | ||
final: prev: { | ||
haskell-nix = prev.haskell-nix // { | ||
checkMaterialization = true; | ||
}; | ||
} | ||
)] | ||
else [] | ||
) ++ ( | ||
if defaultCompilerNixName != null | ||
then [( | ||
final: prev: { | ||
haskell-nix = prev.haskell-nix // { | ||
inherit defaultCompilerNixName; | ||
}; | ||
} | ||
)] | ||
else [] | ||
); | ||
allOverlays = import ./overlays; | ||
nixpkgsArgs = { inherit config overlays; }; | ||
nixpkgsArgs = { inherit config overlays system; }; | ||
pkgs = import sources.nixpkgs-default nixpkgsArgs; | ||
}; | ||
|
||
haskellNixV1 = haskellNix.nixpkgsArgs; | ||
haskellNixV1 = (haskellNix {}).nixpkgsArgs; | ||
haskellNixV2 = haskellNix; | ||
|
||
v1DeprecationMessage = "Version 1 is deprecated: use version 2 (nixpkgs arguments are available as the `nixpkgsArgs` attribute of version 2)"; | ||
# If no arguments, then you get V1 | ||
# I'd like to make importing directly issue a warning, but I couldn't figure out a way to make it happen | ||
in haskellNixV1 // { | ||
__functor = _: { version ? 2 }: | ||
__functor = _: { version ? 2, ... }@args: | ||
if version == 1 | ||
then builtins.trace v1DeprecationMessage haskellNixV1 | ||
else if version == 2 | ||
then haskellNixV2 | ||
then haskellNixV2 args | ||
else builtins.throw ("haskell.nix: unknown version: " + (builtins.toString version)); | ||
} |
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.