2019-06-03 06:26:28 +03:00
|
|
|
# This file contains the package set used by the release.nix jobset.
|
|
|
|
#
|
|
|
|
# It is separate from default.nix because that file is the public API
|
|
|
|
# of Haskell.nix, which shouldn't have tests, etc.
|
2020-03-31 04:12:40 +03:00
|
|
|
let
|
|
|
|
haskellNix = (import ./default.nix {});
|
|
|
|
in
|
2020-07-08 13:54:01 +03:00
|
|
|
{ nixpkgs ? haskellNix.sources.nixpkgs
|
2020-03-31 04:12:40 +03:00
|
|
|
, nixpkgsArgs ? haskellNix.nixpkgsArgs
|
|
|
|
, pkgs ? import nixpkgs nixpkgsArgs
|
2019-11-29 13:28:47 +03:00
|
|
|
, ifdLevel ? 1000
|
2020-07-08 13:54:01 +03:00
|
|
|
, compiler-nix-name ? throw "No `compiler-nix-name` passed to build.nix"
|
2019-06-03 06:26:28 +03:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
|
|
|
haskell = pkgs.haskell-nix;
|
2020-06-08 02:58:06 +03:00
|
|
|
buildHaskell = pkgs.buildPackages.haskell-nix;
|
|
|
|
tool = buildHaskell.tool;
|
2019-11-01 02:34:10 +03:00
|
|
|
in rec {
|
2020-07-08 13:54:01 +03:00
|
|
|
tests = import ./test/default.nix { inherit pkgs ifdLevel compiler-nix-name; };
|
2019-06-03 06:26:28 +03:00
|
|
|
|
2020-06-08 02:58:06 +03:00
|
|
|
tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
|
|
|
|
pkgs.recurseIntoAttrs {
|
2020-11-25 08:32:17 +03:00
|
|
|
cabal-latest = tool compiler-nix-name "cabal" "latest";
|
|
|
|
hls-latest = tool compiler-nix-name "haskell-language-server" "latest";
|
2021-03-18 03:08:53 +03:00
|
|
|
hlint-latest = tool compiler-nix-name "hlint" (if compiler-nix-name == "ghc865" then "3.2.7" else "latest");
|
2020-06-08 02:58:06 +03:00
|
|
|
}
|
|
|
|
);
|
2020-04-29 10:10:14 +03:00
|
|
|
|
2019-06-03 06:26:28 +03:00
|
|
|
# Scripts for keeping Hackage and Stackage up to date, and CI tasks.
|
2019-11-01 02:34:10 +03:00
|
|
|
# The dontRecurseIntoAttrs prevents these from building on hydra
|
|
|
|
# as not all of them can work in restricted eval mode (as they
|
|
|
|
# are not pure).
|
2019-06-03 06:26:28 +03:00
|
|
|
maintainer-scripts = pkgs.dontRecurseIntoAttrs {
|
2020-07-08 13:54:01 +03:00
|
|
|
update-hackage = import ./scripts/update-hackage.nix {
|
2021-02-10 15:07:16 +03:00
|
|
|
inherit (pkgs) stdenv lib writeScript coreutils glibc git
|
2020-07-08 13:54:01 +03:00
|
|
|
openssh nix-prefetch-git gawk bash curl findutils;
|
|
|
|
# Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
|
|
|
|
nix-tools = haskell.internal-nix-tools;
|
|
|
|
cabal-install = haskell.internal-cabal-install;
|
|
|
|
inherit (haskell) update-index-state-hashes;
|
|
|
|
};
|
|
|
|
update-stackage = haskell.callPackage ./scripts/update-stackage.nix {
|
2021-02-10 15:07:16 +03:00
|
|
|
inherit (pkgs) stdenv lib writeScript coreutils glibc git
|
2020-07-08 13:54:01 +03:00
|
|
|
openssh nix-prefetch-git gawk bash curl findutils;
|
|
|
|
# Update scripts use the internal nix-tools and cabal-install (compiled with a fixed GHC version)
|
|
|
|
nix-tools = haskell.internal-nix-tools;
|
|
|
|
cabal-install = haskell.internal-cabal-install;
|
|
|
|
};
|
2019-06-03 06:26:28 +03:00
|
|
|
update-pins = haskell.callPackage ./scripts/update-pins.nix {};
|
2019-11-20 03:47:15 +03:00
|
|
|
update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
|
2020-04-28 17:49:36 +03:00
|
|
|
generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
|
2019-06-15 08:11:52 +03:00
|
|
|
};
|
2019-11-29 13:28:47 +03:00
|
|
|
# Because this is going to be used to test caching on hydra, it must not
|
|
|
|
# use the darcs package from the haskell.nix we are testing. For that reason
|
|
|
|
# it uses `pkgs.buildPackages.callPackage` not `haskell.callPackage`
|
|
|
|
# (We could pull in darcs from a known good haskell.nix for hydra to
|
|
|
|
# use)
|
2019-11-20 03:47:15 +03:00
|
|
|
check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
|
|
|
|
check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
|
2020-07-08 13:54:01 +03:00
|
|
|
# Includes cabal-install since this is commonly used.
|
2020-06-02 07:45:54 +03:00
|
|
|
nix-tools = pkgs.linkFarm "common-tools" [
|
2020-07-08 13:54:01 +03:00
|
|
|
{ name = "nix-tools"; path = haskell.nix-tools.${compiler-nix-name}; }
|
|
|
|
{ name = "cabal-install"; path = haskell.cabal-install.${compiler-nix-name}; }
|
2020-06-02 07:45:54 +03:00
|
|
|
];
|
2019-11-20 03:47:15 +03:00
|
|
|
};
|
2020-06-16 12:02:37 +03:00
|
|
|
check-materialization-concurrency = pkgs.buildPackages.callPackage ./scripts/check-materialization-concurrency/check.nix {};
|
2020-07-07 12:13:27 +03:00
|
|
|
check-path-support = pkgs.buildPackages.callPackage ./scripts/check-path-support.nix {};
|
2019-06-03 06:26:28 +03:00
|
|
|
};
|
2019-11-01 02:34:10 +03:00
|
|
|
|
|
|
|
# These are pure parts of maintainer-script so they can be built by hydra
|
|
|
|
# and added to the cache to speed up buildkite.
|
2019-11-29 13:28:47 +03:00
|
|
|
maintainer-script-cache = pkgs.recurseIntoAttrs (
|
|
|
|
(pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isWindows {
|
|
|
|
inherit (maintainer-scripts) check-hydra;
|
|
|
|
})
|
|
|
|
// (pkgs.lib.optionalAttrs (ifdLevel > 2) {
|
|
|
|
inherit (maintainer-scripts) update-docs check-closure-size;
|
|
|
|
# Some of the dependencies of the impure scripts so that they will
|
|
|
|
# will be in the cache too for buildkite.
|
|
|
|
inherit (pkgs.buildPackages) glibc coreutils git openssh cabal-install nix-prefetch-git;
|
|
|
|
inherit (haskell) nix-tools;
|
|
|
|
})
|
|
|
|
);
|
2019-06-03 06:26:28 +03:00
|
|
|
}
|