on iko/ghcjs-patch-master help sign in
Update nixpkgs pins to include 20.03 (#557)

* Update nixpkgs pins to include 20.03, wobble - Add 20.03 - Remove 19.03 (and old 18.09 file) - Update 19.09 to latest - Update github pin to 20.03 - Remove workarounds for 19.03 * Mark openssl as allowedInsecure * Force python3 for mkdocs

commit701c83fb43179d303c06a3f60003ae68597ccebc authorMichael Peyton Jones <michael.peyton-jones@iohk.io> dateTue 28 Apr 2020, 15:49 (7 years ago) parenta826b77
15 files changed+39−106
build.nix+1−6 builder/default.nix+2−3 ci.nix+3−3 config.nix+3 default.nix+1−1 nixpkgs/default.nix+1−1 nixpkgs/github.json+6−4 nixpkgs/release-18.09.json−7 nixpkgs/release-19.03.json−7 nixpkgs/release-19.09.json+6−4 nixpkgs/release-20.03.json+9 overlays/default.nix+1−2 overlays/release-19.03.nix−64 release.nix+2−2 scripts/update-docs.nix+4−2
build.nix+1−6
@@ -25,12 +25,7 @@ in rec {
2525 update-stackage = haskell.callPackage ./scripts/update-stackage.nix {};
2626 update-pins = haskell.callPackage ./scripts/update-pins.nix {};
2727 update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
28− generatedOptions = import ./scripts/options-doc.nix {
29− # nixpkgs 19.09 changes "Option has no description" from an
30− # error into a warning. That is quite helpful when hardly any
31− # of our options are documented, thanks @oxij.
32− pkgs = import (import ./nixpkgs/default.nix).nixpkgs-1909 {};
33− };
28+ generatedOptions = pkgs.callPackage ./scripts/options-doc.nix { };
3429 };
3530 # Because this is going to be used to test caching on hydra, it must not
3631 # use the darcs package from the haskell.nix we are testing. For that reason
builder/default.nix+2−3
@@ -39,10 +39,9 @@ let
3939
4040
4141 hoogleLocal = let
42− # Use the latest default nixpkgs hoogle.nix, as the 19.03 one does not work with cross compilers
43− nixpkgsHoogleLocal = import ((import (import ../nixpkgs).nixpkgs-default {}).path + /pkgs/development/haskell-modules/hoogle.nix);
42+ nixpkgsHoogle = import (pkgs.path + /pkgs/development/haskell-modules/hoogle.nix);
4443 in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.haskellPackages.hoogle.components.exes.hoogle }:
45− haskellLib.weakCallPackage pkgs nixpkgsHoogleLocal {
44+ haskellLib.weakCallPackage pkgs nixpkgsHoogle {
4645 # For musl we can use haddock from the buildGHC
4746 ghc = if stdenv.hostPlatform.isLinux && stdenv.targetPlatform.isMusl
4847 then ghc.buildGHC
ci.nix+3−3
@@ -8,8 +8,8 @@ let
88 inherit (import ./ci-lib.nix) dimension platformFilterGeneric filterAttrsOnlyRecursive;
99 inherit (import ./default.nix {}) sources nixpkgsArgs;
1010 nixpkgsVersions = {
11− "R1903" = "nixpkgs-1903";
1211 "R1909" = "nixpkgs-1909";
12+ "R2003" = "nixpkgs-2003";
1313 };
1414 systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
1515 # I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
@@ -20,8 +20,8 @@ let
2020 # We need to use the actual nixpkgs version we're working with here, since the values
2121 # of 'lib.systems.examples' are not understood between all versions
2222 let lib = nixpkgs.lib;
23− in lib.optionalAttrs (system == "x86_64-linux" || nixpkgsName == "R1903") {
24− # Windows cross compilation is currently broken on macOS for nixpkgs 19.09 (works on 19.03)
23+ in lib.optionalAttrs (system == "x86_64-linux") {
24+ # Windows cross compilation is currently broken on macOS
2525 inherit (lib.systems.examples) mingwW64;
2626 } // lib.optionalAttrs (system == "x86_64-linux") {
2727 # Musl cross only works on linux
config.nix+3
@@ -6,6 +6,9 @@
66 wine.build = "wine64";
77 wine.release = "stable";
88
9+ # This is marked insecure on 20.03, but many packages still depend on it
10+ permittedInsecurePackages = [ "openssl-1.0.2u" ];
11+
912 # sadly we need to patch GHC a bit.
1013 packageOverrides = ps: with ps; let
1114 in rec {
default.nix+1−1
@@ -1,6 +1,6 @@
11let haskellNix = rec {
22 sources = {
3− inherit (import ./nixpkgs/default.nix) nixpkgs-1903 nixpkgs-1909 nixpkgs-default;
3+ inherit (import ./nixpkgs/default.nix) nixpkgs-1909 nixpkgs-2003 nixpkgs-default;
44 };
55
66 config = import ./config.nix;
nixpkgs/default.nix+1−1
@@ -10,7 +10,7 @@ let
1010 };
1111in
1212{
13+ nixpkgs-2003 = fetch (./. + "/release-20.03.json");
1314 nixpkgs-1909 = fetch (./. + "/release-19.09.json");
14− nixpkgs-1903 = fetch (./. + "/release-19.03.json");
1515 nixpkgs-default = fetch (./. + "/github.json");
1616}
nixpkgs/github.json+6−4
@@ -1,7 +1,9 @@
11{
22 "url": "https://github.com/NixOS/nixpkgs",
3− "rev": "a81842b6994ce710ebad13303fde29438f610e8c",
4− "date": "2020-03-07T09:04:39+01:00",
5− "sha256": "0ch8mnx4iicsh8j6a2a6sgdshbgn6wxhzgf35pnq72avc9pdf2xi",
6− "fetchSubmodules": false
3+ "rev": "cac363c661817666e43d047addfaa722610d425f",
4+ "date": "2020-03-24T13:44:58+01:00",
5+ "sha256": "0fi8hgddy8qh2jrsa40jw7jxnr5lrhq2ji6a2xbndllivhzc31kf",
6+ "fetchSubmodules": false,
7+ "deepClone": false,
8+ "leaveDotGit": false
79}
nixpkgs/release-18.09.jsondeleted−7
@@ -1,7 +0,0 @@
1−{
2− "url": "https://github.com/nixos/nixpkgs",
3− "rev": "68b3bff32da3fadb16d5fdcbca2b4b69f6b97eb6",
4− "date": "2019-07-29T20:46:01-04:00",
5− "sha256": "129w6rk6brdmq0m8l2py5qkpzzzy7zwd1h03cqlbjq2ff6zh49nc",
6− "fetchSubmodules": false
7−}
nixpkgs/release-19.03.jsondeleted−7
@@ -1,7 +0,0 @@
1−{
2− "url": "https://github.com/NixOS/nixpkgs",
3− "rev": "34c7eb7545d155cc5b6f499b23a7cb1c96ab4d59",
4− "date": "2020-02-10T19:09:03-05:00",
5− "sha256": "11z6ajj108fy2q5g8y4higlcaqncrbjm3dnv17pvif6avagw4mcb",
6− "fetchSubmodules": false
7−}
nixpkgs/release-19.09.json+6−4
@@ -1,7 +1,9 @@
11{
22 "url": "https://github.com/NixOS/nixpkgs",
3− "rev": "a81842b6994ce710ebad13303fde29438f610e8c",
4− "date": "2020-03-07T09:04:39+01:00",
5− "sha256": "0ch8mnx4iicsh8j6a2a6sgdshbgn6wxhzgf35pnq72avc9pdf2xi",
6− "fetchSubmodules": false
3+ "rev": "9237a09d8edbae9951a67e9a3434a07ef94035b7",
4+ "date": "2020-04-19T11:10:38+05:30",
5+ "sha256": "05bizymljzzd665bpsjbhxamcgzq7bkjjzjfapkl2nicy774ak4x",
6+ "fetchSubmodules": false,
7+ "deepClone": false,
8+ "leaveDotGit": false
79}
nixpkgs/release-20.03.jsonnew file+9
@@ -0,0 +1,9 @@
1+{
2+ "url": "https://github.com/NixOS/nixpkgs",
3+ "rev": "cac363c661817666e43d047addfaa722610d425f",
4+ "date": "2020-03-24T13:44:58+01:00",
5+ "sha256": "0fi8hgddy8qh2jrsa40jw7jxnr5lrhq2ji6a2xbndllivhzc31kf",
6+ "fetchSubmodules": false,
7+ "deepClone": false,
8+ "leaveDotGit": false
9+}
overlays/default.nix+1−2
@@ -2,7 +2,6 @@
22 # Hide nixpkgs haskell and haskellPackages from the haskell-nix overlays.
33 # This should prevent us inadvertantly depending on them.
44 (_: super: { haskell = {}; haskellPackages = {}; haskell-nix-super = super; })
5− (import ./release-19.03.nix)
65 (import ./wine.nix)
76 #(import ./ghcjs-asterius-triple.nix)
87 #(import ./python.nix)
@@ -15,4 +14,4 @@
1514 (import ./musl.nix)
1615 # Restore nixpkgs haskell and haskellPackages
1716 (_: super: { inherit (super.haskell-nix-super) haskell haskellPackages; })
18−]
17+]
overlays/release-19.03.nixdeleted−64
@@ -1,64 +0,0 @@
1−# bug-fix overlay for nixpkgs:release-19.03
2−self: super: super.lib.optionalAttrs (super.lib.versions.majorMinor super.lib.version == "19.03") {
3− #11420 (unbreak gcc on darwin)
4− binutils-unwrapped = super.binutils-unwrapped.overrideAttrs (old: {
5− buildInputs = old.buildInputs
6− ++ self.lib.optional self.stdenv.isDarwin self.gettext;
7− });
8− #44172 TMPDIR=$NIX_BUILD_TOP is supposed to fix it, but doesn't.
9− nix = super.nix.overrideAttrs (oldAttrs: {
10− TMPDIR="/tmp";
11− preInstallCheck = self.lib.optional self.stdenv.isDarwin ''
12− export TMPDIR=/tmp
13− '';
14− });
15− # Avoid dependency on perl for windows as it fails to build.
16− openssl = if self.stdenv.hostPlatform.isWindows
17− then let static = false; # TODO check that it is ok to assume this (or find a way to detect without instanciating perl)
18− in super.openssl.overrideAttrs (attrs: {
19− # This is the `postInstall` from 19.03 nixpkgs but with the line
20− # substituteInPlace $out/bin/c_rehash --replace ${buildPackages.perl} ${perl}
21− # removed (as including it requires perl to build).
22− # (code is copied here because modifying `attrs.postInstall` would still
23− # introducing the same dependency)
24− postInstall = self.stdenv.lib.optionalString (!static) ''
25− # If we're building dynamic libraries, then don't install static
26− # libraries.
27− if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
28− rm "$out/lib/"*.a
29− fi
30−
31− '' +
32− ''
33− mkdir -p $bin
34− mv $out/bin $bin/
35−
36− mkdir $dev
37− mv $out/include $dev/
38−
39− # remove dependency on Perl at runtime
40− rm -r $out/etc/ssl/misc
41−
42− rmdir $out/etc/ssl/{certs,private}
43− '';
44− # Skip this step on windows as it checks for references to buildPackages.perl
45− # and we are keeping them.
46− postFixup = "";
47− })
48− else super.openssl;
49− winePackages = super.winePackages // {
50− minimal = super.winePackages.minimal.overrideAttrs (oldAttrs: {
51− # Needed for CFNotificationCenterAddObserver symbols.
52− buildInputs = oldAttrs.buildInputs ++ self.lib.optional self.stdenv.isDarwin
53− self.buildPackages.darwin.cf-private;
54− # the relevant check in configure.ac will fail under nix as we are not
55− # using the system supplied compiler tools. We will subsequently *not*
56− # pass `-mmacosx-version-min` in the LDFLAGS, and end up with a linked
57− # binary against 10.14 which *does* contain a __DATA,__dyld section and
58− # then horribly fail to run on Mojave.
59− postConfigure = self.lib.optional (self.stdenv.hostPlatform.isDarwin) ''
60− sed -i 's|-nostartfiles -nodefaultlibs|-nostartfiles -nodefaultlibs -mmacosx-version-min=10.7|g' loader/Makefile
61− '';
62− });
63− };
64−}
release.nix+2−2
@@ -15,9 +15,9 @@ in allJobs // {
1515 required = genericPkgs.releaseTools.aggregate {
1616 name = "haskell.nix-required";
1717 meta.description = "All jobs required to pass CI";
18− # Hercules will require all of these, we just require the 1909 jobs
18+ # Hercules will require all of these, we just require the 20.03 jobs
1919 # to avoid stressing Hydra too much
20− constituents = lib.collect lib.isDerivation allJobs.R1909.linux.native;
20+ constituents = lib.collect lib.isDerivation allJobs.R2003.linux.native;
2121 };
2222 }
2323
scripts/update-docs.nix+4−2
@@ -1,11 +1,13 @@
11{ stdenv, writeScript, coreutils, glibc, git, openssh, gnused, mkdocs
2−, generatedOptions }:
2+, python3, 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; };
911in
1012 # update-docs depends on glibc which doesn't build on darwin
1113 meta.addMetaAttrs { platforms = platforms.linux; } (writeScript "update-docs.sh" ''
@@ -13,7 +15,7 @@ in
1315
1416 set -euo pipefail
1517
16− export PATH="${makeBinPath [ coreutils glibc git openssh gnused mkdocs ]}"
18+ export PATH="${makeBinPath [ coreutils glibc git openssh gnused py3mkdocs ]}"
1719
1820 source ${./git.env}
1921