on iko/ghcjs-patch-master help sign in
Update nixpkgs 20.03 (matches with iohk-nix) (#671)

* Use hydra-migration in check-hydra.nix * mkdocs fix is now in nixpkgs 20.03 (so this drops our work around) * Adds sanity checks for #660 * Add missing ${targetPrefix} to NIX_LDFLAGS * Use eval system for callStackToNix. * Improves pins.

commitedc948e0e8dc9b71b22b61ac06be2b4d5f54591d authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateSun 14 Jun 2020, 22:54 (6 years ago) parentc7e6531
5 files changed+43−21
compiler/ghc/default.nix+21−2 nix/sources.json+6−6 overlays/haskell.nix+12−7 scripts/check-hydra.nix+2−2 scripts/update-docs.nix+2−4
compiler/ghc/default.nix+21−2
@@ -181,7 +181,7 @@ in let configured-src = stdenv.mkDerivation (rec {
181181 echo -n "${buildMK}" > mk/build.mk
182182 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
183183 '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
184− export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
184+ export NIX_LDFLAGS+=" -rpath $out/lib/${targetPrefix}ghc-${version}"
185185 '' + stdenv.lib.optionalString stdenv.isDarwin ''
186186 export NIX_LDFLAGS+=" -no_dtrace_dof"
187187 '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
@@ -330,7 +330,26 @@ in let configured-src = stdenv.mkDerivation (rec {
330330 -e 's/ghcprog="ghc-/ghcprog="${targetPrefix}ghc-/' \
331331 $i
332332 done
333− '' + installDeps targetPrefix;
333+ ${installDeps targetPrefix}
334+
335+ # Sanity checks for https://github.com/input-output-hk/haskell.nix/issues/660
336+ if [[ ! -f "$out/bin/${targetPrefix}ghc" ]]; then
337+ echo "ERROR: Missing file $out/bin/${targetPrefix}ghc"
338+ exit 0
339+ fi
340+ if [[ ! -f "$out/bin/${targetPrefix}ghc-pkg" ]]; then
341+ echo "ERROR: Missing file $out/bin/${targetPrefix}ghc-pkg"
342+ exit 0
343+ fi
344+ if [[ ! -d "$out/lib/${targetPrefix}ghc-${version}" ]]; then
345+ echo "ERROR: Missing directory $out/lib/${targetPrefix}ghc-${version}"
346+ exit 0
347+ fi
348+ if (( $(ls -1 "$out/lib/${targetPrefix}ghc-${version}" | wc -l) < 30 )); then
349+ echo "ERROR: Expected more files in $out/lib/${targetPrefix}ghc-${version}"
350+ exit 0
351+ fi
352+ '';
334353
335354 passthru = {
336355 inherit bootPkgs targetPrefix;
nix/sources.json+6−6
@@ -29,10 +29,10 @@
2929 "homepage": null,
3030 "owner": "NixOS",
3131 "repo": "nixpkgs",
32− "rev": "cac363c661817666e43d047addfaa722610d425f",
33− "sha256": "0fi8hgddy8qh2jrsa40jw7jxnr5lrhq2ji6a2xbndllivhzc31kf",
32+ "rev": "05a32d8e771dc39438835ba0e3141d68ad4e3068",
33+ "sha256": "0w8824m4f15km3mngji35qjs9sgfvfpl57b0dq6hch5gmhlal679",
3434 "type": "tarball",
35− "url": "https://github.com/NixOS/nixpkgs/archive/cac363c661817666e43d047addfaa722610d425f.tar.gz",
35+ "url": "https://github.com/NixOS/nixpkgs/archive/05a32d8e771dc39438835ba0e3141d68ad4e3068.tar.gz",
3636 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3737 },
3838 "nixpkgs-default": {
@@ -41,10 +41,10 @@
4141 "homepage": null,
4242 "owner": "NixOS",
4343 "repo": "nixpkgs",
44− "rev": "cac363c661817666e43d047addfaa722610d425f",
45− "sha256": "0fi8hgddy8qh2jrsa40jw7jxnr5lrhq2ji6a2xbndllivhzc31kf",
44+ "rev": "05a32d8e771dc39438835ba0e3141d68ad4e3068",
45+ "sha256": "0w8824m4f15km3mngji35qjs9sgfvfpl57b0dq6hch5gmhlal679",
4646 "type": "tarball",
47− "url": "https://github.com/NixOS/nixpkgs/archive/cac363c661817666e43d047addfaa722610d425f.tar.gz",
47+ "url": "https://github.com/NixOS/nixpkgs/archive/05a32d8e771dc39438835ba0e3141d68ad4e3068.tar.gz",
4848 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
4949 }
5050}
overlays/haskell.nix+12−7
@@ -258,9 +258,9 @@ final: prev: {
258258
259259 # Function to call stackToNix
260260 callStackToNix = import ../lib/call-stack-to-nix.nix {
261− pkgs = final.buildPackages.pkgs;
262− inherit (final.buildPackages.pkgs) runCommand;
263− inherit (final.buildPackages.haskell-nix) nix-tools mkCacheFile materialize;
261+ pkgs = final.evalPackages.pkgs;
262+ inherit (final.evalPackages.pkgs) runCommand;
263+ inherit (final.evalPackages.haskell-nix) nix-tools mkCacheFile materialize;
264264 };
265265
266266 # given a source location call `cabal-to-nix` (from nix-tools) on it
@@ -563,6 +563,9 @@ final: prev: {
563563 haskellNixRoots = final.recurseIntoAttrs {
564564 Level0 = haskellNixRoots' 0;
565565 Level1 = haskellNixRoots' 1;
566+ # Should be safe to use this now we have materialized everything
567+ # except the tests
568+ Level2 = haskellNixRoots' 2;
566569 };
567570
568571 haskellNixRoots' = ifdLevel:
@@ -570,10 +573,12 @@ final: prev: {
570573 in final.recurseIntoAttrs ({
571574 # Things that require no IFD to build
572575 inherit (final.buildPackages.haskell-nix) source-pins;
573− # Double buildPackages (since evalPackages implies buildPackages) is intentional,
576+ # Double buildPackages is intentional,
574577 # see comment in lib/default.nix for details.
575− inherit (final.evalPackages.buildPackages) gitMinimal nix-prefetch-git;
576− inherit (final.evalPackages) nix;
578+ # Using buildPackages rather than evalPackages so both darwin and linux
579+ # versions will get pinned (evalPackages on darwin systems will be for darwin).
580+ inherit (final.buildPackages.buildPackages) gitMinimal nix-prefetch-git;
581+ inherit (final.buildPackages) nix;
577582 } // final.lib.optionalAttrs (final.stdenv.hostPlatform.libc == "glibc") {
578583 inherit (final) glibcLocales;
579584 } // final.lib.optionalAttrs (ifdLevel > 0) {
@@ -591,7 +596,7 @@ final: prev: {
591596 inherit (final.buildPackages.haskell-nix.haskellPackages.hpack.components.exes) hpack;
592597 inherit (final.buildPackages.haskell-nix) cabal-install dotCabal nix-tools alex happy;
593598 # These seem to be the only things we use from `ghc-extra-packages`
594− # in haskell.nix itfinal.
599+ # in haskell.nix itself.
595600 inherit (final.ghc-extra-packages."${defaultCompilerNixName}"
596601 .iserv-proxy.components.exes) iserv-proxy;
597602 inherit (final.ghc-extra-packages."${defaultCompilerNixName}"
scripts/check-hydra.nix+2−2
@@ -1,4 +1,4 @@
1−{ stdenv, writeScript, coreutils, time, gnutar, gzip, hydra, jq }:
1+{ stdenv, writeScript, coreutils, time, gnutar, gzip, hydra-migration, jq }:
22
33with stdenv.lib;
44
@@ -7,7 +7,7 @@ writeScript "check-hydra.sh" ''
77
88 set -euo pipefail
99
10− export PATH="${makeBinPath [ coreutils time gnutar gzip hydra jq ]}"
10+ export PATH="${makeBinPath [ coreutils time gnutar gzip hydra-migration jq ]}"
1111
1212 echo '~~~ Evaluating release.nix with --arg ifdLevel '$1
1313 command time --format '%e' -o eval-time.txt \
scripts/update-docs.nix+2−4
@@ -1,13 +1,11 @@
11{ stdenv, writeScript, coreutils, glibc, git, openssh, gnused, mkdocs
2−, python3, generatedOptions }:
2+, generatedOptions }:
33
44with stdenv.lib;
55
66let
77 repo = "git@github.com:input-output-hk/haskell.nix.git";
88 sshKey = "/run/keys/buildkite-haskell-dot-nix-ssh-private";
9− # Doesn't work with Python 2 in 20.03, fixed in master in https://github.com/NixOS/nixpkgs/commit/ee17a6a8379ffd791309b13143d76431f2f671df
10− py3mkdocs = mkdocs.override { python = python3; };
119in
1210 # update-docs depends on glibc which doesn't build on darwin
1311 meta.addMetaAttrs { platforms = platforms.linux; } (writeScript "update-docs.sh" ''
@@ -15,7 +13,7 @@ in
1513
1614 set -euo pipefail
1715
18− export PATH="${makeBinPath [ coreutils glibc git openssh gnused py3mkdocs ]}"
16+ export PATH="${makeBinPath [ coreutils glibc git openssh gnused mkdocs ]}"
1917
2018 source ${./git.env}
2119