Skip to content

Commit cb20a5a

Browse files
committed
Merge master into support-cabal-doctest
# Conflicts: # builder/comp-builder.nix # lib/check.nix # lib/default.nix # test/default.nix
2 parents 9caf1cd + 07df700 commit cb20a5a

File tree

953 files changed

+128870
-11384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

953 files changed

+128870
-11384
lines changed

.buildkite/pipeline.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
steps:
2-
- label: 'Run tests'
3-
command: "./test/tests.sh"
2+
- label: 'Run tests with ghc884'
3+
command: "./test/tests.sh ghc884"
44
agents:
55
system: x86_64-linux
66

@@ -14,9 +14,9 @@ steps:
1414
agents:
1515
system: x86_64-linux
1616

17-
- label: 'Check closure size'
17+
- label: 'Check closure size with ghc884'
1818
command:
19-
- nix-build build.nix -A maintainer-scripts.check-closure-size -o check-closure-size.sh
19+
- nix-build build.nix -A maintainer-scripts.check-closure-size --argstr compiler-nix-name ghc884 -o check-closure-size.sh
2020
- echo "+++ Closure size (MB)"
2121
- ./check-closure-size.sh
2222
agents:
@@ -28,3 +28,13 @@ steps:
2828
- ./update-docs.sh
2929
agents:
3030
system: x86_64-linux
31+
32+
- label: 'Make sure materialize function does not limit concurrency'
33+
command:
34+
- nix-build build.nix -A maintainer-scripts.check-materialization-concurrency -o check-materialization-concurrency.sh
35+
- ./check-materialization-concurrency.sh
36+
37+
- label: 'Make sure non store paths like can be used as src'
38+
command:
39+
- nix-build build.nix -A maintainer-scripts.check-path-support --argstr compiler-nix-name ghc884 -o check-path-support.sh
40+
- ./check-path-support.sh

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
nix-tools/.plan.nix/*.nix linguist-generated=true
55
nix-tools/pkgs.nix linguist-generated=true
66
.stack-to-nix.cache linguist-generated=true
7+
materialized/**/* linguist-generated=true

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# `haskell.nix` is infrastructure for building Haskell packages with Nix
2+
3+
[![](https://badge.buildkite.com/d453edcd29bd2f8f3f3b32c9b7d6777a33773d9671c37a6ccc.svg?branch=master)](https://buildkite.com/input-output-hk/haskell-dot-nix)
4+
[![](https://img.shields.io/buildkite/c8d5a20d3ff0f440f82adb9190b43c16c91e5e47e8adfa867a/master.svg?label=nightly%20updates)](https://buildkite.com/input-output-hk/haskell-dot-nix-nightly-updates)
5+
6+
`haskell.nix` can automatically translate your Cabal or Stack project and
7+
its dependencies into Nix code.
8+
9+
## Documentation
10+
11+
- [Introduction](https://input-output-hk.github.io/haskell.nix/)
12+
- [Getting Started](https://input-output-hk.github.io/haskell.nix/tutorials/getting-started/)
13+
- [Troubleshooting](https://input-output-hk.github.io/haskell.nix/troubleshooting/)
14+
- Explore the documentation from there to find further topics.
15+
16+
## Help! Something isn't working
17+
18+
The #1 problem that people have when using `haskell.nix` is that they find themselves building GHC.
19+
This should not happen, but you *must* follow the `haskell.nix` setup instructions properly to avoid it.
20+
If you find this happening to you, please check that you have followed the
21+
[getting started instructions](https://input-output-hk.github.io/haskell.nix/tutorials/getting-started/#setting-up-the-binary-cache) and
22+
consult the corresponding [troubleshooting section](https://input-output-hk.github.io/haskell.nix/troubleshooting/#why-am-i-building-ghc).
23+
24+
The troubleshooting documentation also contains some help for other common issues.
25+
Please give it a read before asking on IRC or opening an issue.
26+
27+
If you're still stuck, join the [#haskell.nix](https://www.irccloud.com/invite?channel=%23haskell.nix&hostname=irc.freenode.net&port=6697&ssl=1) channel on [irc.freenode.net](https://freenode.net/), or open an issue.
28+
29+
## Related repos
30+
31+
The `haskell.nix` repository contains the runtime system for building
32+
Haskell packages in Nix. It depends on other repos, which are:
33+
34+
- [`nix-tools`](https://github.com/input-output-hk/nix-tools) — provides the programs for generating Nix expressions from Haskell projects.
35+
36+
- [`hackage.nix`](https://github.com/input-output-hk/hackage.nix) — the latest contents of the [Hackage](https://hackage.haskell.org/) databases, converted to Nix expressions.
37+
38+
- [`stackage.nix`](https://github.com/input-output-hk/stackage.nix) — all of the [Stackage](https://www.stackage.org/) snapshots, converted to Nix expressions.
39+

README.org

Lines changed: 0 additions & 119 deletions
This file was deleted.

build.nix

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,48 @@
55
let
66
haskellNix = (import ./default.nix {});
77
in
8-
{ nixpkgs ? haskellNix.sources.nixpkgs-default
8+
{ nixpkgs ? haskellNix.sources.nixpkgs
99
, nixpkgsArgs ? haskellNix.nixpkgsArgs
1010
, pkgs ? import nixpkgs nixpkgsArgs
1111
, ifdLevel ? 1000
12+
, compiler-nix-name ? throw "No `compiler-nix-name` passed to build.nix"
1213
}:
1314

1415
let
1516
haskell = pkgs.haskell-nix;
17+
buildHaskell = pkgs.buildPackages.haskell-nix;
18+
tool = buildHaskell.tool;
1619
in rec {
17-
tests = import ./test/default.nix { inherit pkgs ifdLevel; };
20+
tests = import ./test/default.nix { inherit pkgs ifdLevel compiler-nix-name; };
1821

19-
tools = pkgs.lib.optionalAttrs (ifdLevel >= 3)
20-
(pkgs.recurseIntoAttrs
21-
(pkgs.lib.mapAttrs (_: ghc:
22-
let
23-
tool = name: version: pkgs.buildPackages.haskell-nix.tool name { inherit version ghc; };
24-
in pkgs.recurseIntoAttrs {
25-
cabal-32 = tool "cabal" "3.2.0.0";
26-
ghcide = tool "ghcide" "object-code";
27-
} // pkgs.lib.optionalAttrs (ghc.version == "8.6.5") {
28-
cabal-30 = tool "cabal" "3.0.0.0";
29-
}) { inherit (pkgs.buildPackages.haskell-nix.compiler) ghc865 ghc883; }));
22+
tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
23+
pkgs.recurseIntoAttrs {
24+
cabal-latest = tool compiler-nix-name "cabal" "latest";
25+
hls-latest = tool compiler-nix-name "haskell-language-server" "latest";
26+
hlint-latest = tool compiler-nix-name "hlint" "latest";
27+
}
28+
);
3029

3130
# Scripts for keeping Hackage and Stackage up to date, and CI tasks.
3231
# The dontRecurseIntoAttrs prevents these from building on hydra
3332
# as not all of them can work in restricted eval mode (as they
3433
# are not pure).
3534
maintainer-scripts = pkgs.dontRecurseIntoAttrs {
36-
update-hackage = haskell.callPackage ./scripts/update-hackage.nix {};
37-
update-stackage = haskell.callPackage ./scripts/update-stackage.nix {};
35+
update-hackage = import ./scripts/update-hackage.nix {
36+
inherit (pkgs) stdenv writeScript coreutils glibc git
37+
openssh nix-prefetch-git gawk bash curl findutils;
38+
# Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
39+
nix-tools = haskell.internal-nix-tools;
40+
cabal-install = haskell.internal-cabal-install;
41+
inherit (haskell) update-index-state-hashes;
42+
};
43+
update-stackage = haskell.callPackage ./scripts/update-stackage.nix {
44+
inherit (pkgs) stdenv writeScript coreutils glibc git
45+
openssh nix-prefetch-git gawk bash curl findutils;
46+
# Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
47+
nix-tools = haskell.internal-nix-tools;
48+
cabal-install = haskell.internal-cabal-install;
49+
};
3850
update-pins = haskell.callPackage ./scripts/update-pins.nix {};
3951
update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
4052
generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
@@ -46,8 +58,14 @@ in rec {
4658
# use)
4759
check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
4860
check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
49-
inherit (haskell) nix-tools;
61+
# Includes cabal-install since this is commonly used.
62+
nix-tools = pkgs.linkFarm "common-tools" [
63+
{ name = "nix-tools"; path = haskell.nix-tools.${compiler-nix-name}; }
64+
{ name = "cabal-install"; path = haskell.cabal-install.${compiler-nix-name}; }
65+
];
5066
};
67+
check-materialization-concurrency = pkgs.buildPackages.callPackage ./scripts/check-materialization-concurrency/check.nix {};
68+
check-path-support = pkgs.buildPackages.callPackage ./scripts/check-path-support.nix {};
5169
};
5270

5371
# These are pure parts of maintainer-script so they can be built by hydra

0 commit comments

Comments
 (0)