Skip to content

Commit

Permalink
Replace ghc 8.8.3 with 8.8.4 (#766)
Browse files Browse the repository at this point in the history
Also adds some tooling/docs for adding new ghc versions (see `docs/adding-new-ghc.md`)
  • Loading branch information
hamishmack committed Jul 21, 2020
1 parent d6cf503 commit cacfba0
Show file tree
Hide file tree
Showing 107 changed files with 15,701 additions and 67 deletions.
10 changes: 5 additions & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
- label: 'Run tests with ghc883'
command: "./test/tests.sh ghc883"
- label: 'Run tests with ghc884'
command: "./test/tests.sh ghc884"
agents:
system: x86_64-linux

Expand All @@ -14,9 +14,9 @@ steps:
agents:
system: x86_64-linux

- label: 'Check closure size with ghc883'
- label: 'Check closure size with ghc884'
command:
- nix-build build.nix -A maintainer-scripts.check-closure-size --argstr compiler-nix-name ghc883 -o check-closure-size.sh
- nix-build build.nix -A maintainer-scripts.check-closure-size --argstr compiler-nix-name ghc884 -o check-closure-size.sh
- echo "+++ Closure size (MB)"
- ./check-closure-size.sh
agents:
Expand All @@ -36,5 +36,5 @@ steps:

- label: 'Make sure non store paths like can be used as src'
command:
- nix-build build.nix -A maintainer-scripts.check-path-support --argstr compiler-nix-name ghc883 -o check-path-support.sh
- nix-build build.nix -A maintainer-scripts.check-path-support --argstr compiler-nix-name ghc884 -o check-path-support.sh
- ./check-path-support.sh
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
This file contains a summary of changes to Haskell.nix and `nix-tools`
that will impact users.

## July ?, 2020
## July 21, 2020
* Added GHC 8.8.4 and replaced 8.8.3 in tests and as the ghc
used to build nix-tools for stack projects.

## July 20, 2020
* Changed `haskell-nix.roots` and `p.roots` to single derivations.

## July 8, 2020
Expand Down
2 changes: 1 addition & 1 deletion ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(import ./default.nix { inherit checkMaterialization; }).nixpkgsArgs) ({
ghc865 = {};
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
ghc883 = {};
ghc884 = {};
ghc8101 = {};
});
systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
Expand Down
31 changes: 31 additions & 0 deletions docs/adding-new-ghc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Adding a new GHC version to haskell.nix

## Update `overlays/bootstrap.nix`

Each ghc version is defined in this file. Duplicate one of the exising
ghc version definitions and replace the version numbers. Make sure
you update the `spec.sha256` or the other versions source will be used.
Check the LLVM version that should be used in the
[ghc wiki](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/backends/llvm/installing).


## Update the materialized files

In the haskell.nix repo run:

```
mkdir materialized/ghc884
nix-build scripts/check-compiler-materialization --argstr compiler-nix-name ghc884
```

The `nix-build` command will fail with something like:

```
Materialized nix used for dummy-data-x86_64-unknown-linux-musl-ghc-8.10.1 incorrect. To fix run: /nix/store/wnwpyrhv4nxgyljz3f20gdpspjxvm7h4-updateMaterialized
```

Run the `updateMaterialized` script and repat the `nix-build` until it no longer fails.
If the failure is not a problem with materialization and no `updateMaterialized` script
is provided then you may need to fix the failure another way or (if it only relates to
one of the cross compilers) modify `scripts/check-compiler-materialization/default.nix`
so that it skips that compiler.
4 changes: 2 additions & 2 deletions docs/dev/installing-nix-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To build the latest `nix-tools` and store the result at `./nt`, run:

```bash
nix build -f https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz pkgs.haskell-nix.nix-tools.ghc883 --out-link nt
nix build -f https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz pkgs.haskell-nix.nix-tools.ghc884 --out-link nt
```

If you would like to then install `nix-tools` into your profile, run:
Expand All @@ -22,5 +22,5 @@ understand something that the documentation doesn't cover.
git clone https://github.com/input-output-hk/nix-tools
git clone https://github.com/input-output-hk/haskell.nix
cd haskell.nix
nix build -f . pkgs.haskell-nix.nix-tools.ghc883 --arg sourcesOverride '{ nix-tools = ../nix-tools; }' --out-link nt
nix build -f . pkgs.haskell-nix.nix-tools.ghc884 --arg sourcesOverride '{ nix-tools = ../nix-tools; }' --out-link nt
```
2 changes: 1 addition & 1 deletion docs/reference/library.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ needed for `importAndFilterProject`.
|----------------------|------|---------------------|
| `name` | String | Optional name for better error messages. |
| `src` | Path | Location of the cabal project files. |
| `compiler-nix-name` | String | The name of the ghc compiler to use eg. "ghc883" |
| `compiler-nix-name` | String | The name of the ghc compiler to use eg. "ghc884" |
| `index-state` | Timestamp | Optional hackage index-state, eg. "2019-10-10T00:00:00Z". |
| `index-sha256` | Sha256 | Optional hash of the truncated hackage index-state. |
| `plan-sha256` | Sha256 | Optional hash of the plan-to-nix output (makes the plan-to-nix step a fixed output derivation). |
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ So this is expected, unfortunately.

### How do I prevent the evaluation-time dependencies of my project from being garbage-collected?

The `haskell-nix.roots "ghc883"` should include all the evaluation-time dependencies
The `haskell-nix.roots "ghc884"` should include all the evaluation-time dependencies
and the main build time dependecies of a project using ghc 8.8.3.
So you can add that to the relevant GC root.
In practice, if you're using a CI system like Hydra/Hercules, this means adding it to a job in `release.nix`/`ci.nix`.
2 changes: 1 addition & 1 deletion docs/tutorials/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Add `default.nix`:
src = ./.;
};
# For `cabal.project` based projects specify the GHC version to use.
compiler-nix-name = "ghc883"; # Not used for `stack.yaml` based projects.
compiler-nix-name = "ghc884"; # Not used for `stack.yaml` based projects.
}
```

Expand Down
14 changes: 7 additions & 7 deletions docs/tutorials/materialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ file that looks like this:
let inherit (import ./. {}) sources nixpkgsArgs;
pkgs = import sources.nixpkgs nixpkgsArgs;
hlint = pkgs.haskell-nix.hackage-package {
compiler-nix-name = "ghc883";
compiler-nix-name = "ghc884";
name = "hlint";
version = "2.2.11";
};
Expand All @@ -67,7 +67,7 @@ inputs. For cabal projects this means we must specify the
let inherit (import ./. {}) sources nixpkgsArgs;
pkgs = import sources.nixpkgs nixpkgsArgs;
hlint = pkgs.haskell-nix.hackage-package {
compiler-nix-name = "ghc883";
compiler-nix-name = "ghc884";
name = "hlint";
version = "2.2.11";
index-state = "2020-04-15T00:00:00Z";
Expand Down Expand Up @@ -96,7 +96,7 @@ stack projects)
let inherit (import ./. {}) sources nixpkgsArgs;
pkgs = import sources.nixpkgs nixpkgsArgs;
hlint = pkgs.haskell-nix.hackage-package {
compiler-nix-name = "ghc883";
compiler-nix-name = "ghc884";
name = "hlint";
version = "2.2.11";
index-state = "2020-04-15T00:00:00Z";
Expand Down Expand Up @@ -126,7 +126,7 @@ To capture the nix we can do something like:
let inherit (import ./. {}) sources nixpkgsArgs;
pkgs = import sources.nixpkgs nixpkgsArgs;
hlint = pkgs.haskell-nix.hackage-package {
compiler-nix-name = "ghc883";
compiler-nix-name = "ghc884";
name = "hlint";
version = "2.2.11";
index-state = "2020-04-15T00:00:00Z";
Expand Down Expand Up @@ -161,7 +161,7 @@ If we choose to add the `checkMaterialization` flag you would have:
let inherit (import ./. {}) sources nixpkgsArgs;
pkgs = import sources.nixpkgs nixpkgsArgs;
hlint = pkgs.haskell-nix.hackage-package {
compiler-nix-name = "ghc883";
compiler-nix-name = "ghc884";
name = "hlint";
version = "2.2.10";
index-state = "2020-04-15T00:00:00Z";
Expand Down Expand Up @@ -206,7 +206,7 @@ For instance:
let inherit (import ./. {}) sources nixpkgsArgs;
pkgs = import sources.nixpkgs nixpkgsArgs;
hlint = pkgs.haskell-nix.hackage-project {
compiler-nix-name = "ghc883";
compiler-nix-name = "ghc884";
name = "hlint";
version = "2.2.10";
index-state = "2020-04-15T00:00:00Z";
Expand Down Expand Up @@ -245,7 +245,7 @@ let inherit (import ./. {}) sources nixpkgsArgs;
pkgs = import sources.nixpkgs nixpkgsArgs;
hlintPlan = /nix/store/kk047cqsjvbj4w8psv4l05abdcnyrqdc-hlint-plan-to-nix-pkgs;
hlint = pkgs.haskell-nix.hackage-package {
compiler-nix-name = "ghc883";
compiler-nix-name = "ghc884";
name = "hlint";
version = "2.2.11";
index-state = "2020-04-15T00:00:00Z";
Expand Down
2 changes: 1 addition & 1 deletion lib/call-cabal-project-to-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let readIfExists = src: fileName:
in
{ name ? src.name or null # optional name for better error messages
, src
, compiler-nix-name # The name of the ghc compiler to use eg. "ghc883"
, compiler-nix-name # The name of the ghc compiler to use eg. "ghc884"
, index-state ? null # Hackage index-state, eg. "2019-10-10T00:00:00Z"
, index-sha256 ? null # The hash of the truncated hackage index-state
, plan-sha256 ? null # The hash of the plan-to-nix output (makes the plan-to-nix step a fixed output derivation)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cacfba0

Please sign in to comment.