From 2fac407642a443c02860a398e92a20d1dd5bc1a6 Mon Sep 17 00:00:00 2001 From: Diego Diverio Date: Fri, 20 Sep 2024 09:24:44 +0200 Subject: [PATCH 1/7] Update GHC 9.6.2 to 9.6.6. --- flake.lock | 42 +++++++++---------- flake.nix | 4 +- nix/{overlay-ghc962.nix => overlay-ghc96.nix} | 13 ++++-- 3 files changed, 32 insertions(+), 27 deletions(-) rename nix/{overlay-ghc962.nix => overlay-ghc96.nix} (77%) diff --git a/flake.lock b/flake.lock index d6b09d79fb..721f3f3d34 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -21,11 +21,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -37,11 +37,11 @@ "ghc-tcplugins-extra": { "flake": false, "locked": { - "lastModified": 1690791784, - "narHash": "sha256-RG9UpAYOjH276sFC+XrX847WR26qVhr/KHTsEOkw3rs=", + "lastModified": 1716385093, + "narHash": "sha256-pXQoPP22TicWFwpWub9CX1J+rpOKfyX2IyzlCg1qG84=", "owner": "clash-lang", "repo": "ghc-tcplugins-extra", - "rev": "92b5215273bc219da9550799e0869ea6934648f0", + "rev": "702dda2095c66c4f5148a749c8b7dbcc8a09f5c1", "type": "github" }, "original": { @@ -53,11 +53,11 @@ "ghc-typelits-extra": { "flake": false, "locked": { - "lastModified": 1690794410, - "narHash": "sha256-Q8zXP9ZcVBkUrniBOM00tYqgGipDhbbPqkVTCrs7vYo=", + "lastModified": 1716411282, + "narHash": "sha256-YH03Ce+TEWKHGAm7BhynitZomfpYeKpqvZAviw8yEPA=", "owner": "clash-lang", "repo": "ghc-typelits-extra", - "rev": "bbe2a40d6bc640ab065dd87db74ba59e584aa9f2", + "rev": "4dadc824a3ef9a511fcf6605167715a5a655ba0d", "type": "github" }, "original": { @@ -69,11 +69,11 @@ "ghc-typelits-knownnat": { "flake": false, "locked": { - "lastModified": 1690793234, - "narHash": "sha256-Y+Qjz8r+B0hUAhRVrxddQxnJLNVKLMAz5OLsRQ5behE=", + "lastModified": 1716408841, + "narHash": "sha256-A2v6GkMtSJqZXpTwWfIcwshieyRySeR1bP+NogUHNoo=", "owner": "clash-lang", "repo": "ghc-typelits-knownnat", - "rev": "2b72c495b4158d49ef46609036b08e414bcdba5c", + "rev": "2e57de3b709dab085fb1657cf73d4f5e833229ee", "type": "github" }, "original": { @@ -85,11 +85,11 @@ "ghc-typelits-natnormalise": { "flake": false, "locked": { - "lastModified": 1690792488, - "narHash": "sha256-1ZSF6FCSmh4Pd7aUEXa5VFkBibuOyE1tqbndGikO+sA=", + "lastModified": 1716387676, + "narHash": "sha256-G5p0NUy4CpjxGO1VNhb38fhkXESFPxGaZJM0qd6L74U=", "owner": "clash-lang", "repo": "ghc-typelits-natnormalise", - "rev": "3289e1a25df3d7752d6734aa83ba04782d6e43cd", + "rev": "84f500a9735675e96253181939c3473a567f6f7a", "type": "github" }, "original": { @@ -100,11 +100,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1694948089, - "narHash": "sha256-d2B282GmQ9o8klc22/Rbbbj6r99EnELQpOQjWMyv0rU=", + "lastModified": 1726583932, + "narHash": "sha256-zACxiQx8knB3F8+Ze+1BpiYrI+CbhxyWpcSID9kVhkQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db", + "rev": "658e7223191d2598641d50ee4e898126768fe847", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5bc52cb39c..e9a6e0a07f 100644 --- a/flake.nix +++ b/flake.nix @@ -36,12 +36,12 @@ # The versions of GHC that we want to be able to build / develop against # within the nix environment. Since nix is lazy, only derivations for # versions of GHC which are used are actually evaluated. - ghcVersions = [ "ghc902" "ghc962" ]; + ghcVersions = [ "ghc96" "ghc98"]; # We pick a single version of GHC to use by default within nix. This is # probably cleaner than always having N copies of each package / app and # being forced to refer to them by their GHC version. - defaultGhcVersion = "ghc962"; + defaultGhcVersion = "ghc96"; # Overlays are not per-system, so let's only compute them once. # For each version of GHC we produce a `pkgs.clashPackages-ghcVER`, e.g. diff --git a/nix/overlay-ghc962.nix b/nix/overlay-ghc96.nix similarity index 77% rename from nix/overlay-ghc962.nix rename to nix/overlay-ghc96.nix index d083933ac1..01b61305e3 100644 --- a/nix/overlay-ghc962.nix +++ b/nix/overlay-ghc96.nix @@ -8,6 +8,8 @@ in # is basically abandonware it catches fire with brick 1.0+. brick = doJailbreak prev.brick_0_70_1; + vty = prev.callHackage "vty" "5.39" { }; + # Marked as broken in nixpkgs, since it needs on a newer hashable than the # .cabal file currently uploaded to hackage. concurrent-supply = doJailbreak (markUnbroken prev.concurrent-supply); @@ -30,23 +32,26 @@ in # We want a version that matches with singletons-th, but the tests in here # are also a bit flaky since GHC 9.6 isn't officially supported. - singletons-base = dontCheck prev.singletons-base_3_2; + singletons-base = dontCheck (prev.callHackage "singletons-base" "3.2" { }); # dontCheck prev.singletons-base_3_2; # Use a newer version than the default in nixpkgs. - singletons-th = prev.singletons-th_3_2; + singletons-th = prev.callHackage "singletons-th" "3.2" { }; # prev.singletons-th_3_2; # Needs a newer text than the .cabal file currently uploaded to hackage. string-qq = doJailbreak prev.string-qq; # Needs a newer version than the default in nixpkgs. - th-desugar = prev.th-desugar_1_15; + th-desugar = prev.callHackage "th-desugar" "1.15" { }; # Needs a newer base than the .cabal file currently uploaded to hackage. vector-binary-instances = doJailbreak prev.vector-binary-instances; # Use an older version than the default in nixpkgs. - th-abstraction = prev.th-abstraction_0_5_0_0; + th-abstraction = prev.callHackage "th-abstraction" "0.5.0.0" {}; # type-errors 0.2.0.2 is bounded on doctest >=0.16.0.1 && <0.22 doctest = prev.callHackage "doctest" "0.21.1" { }; + + # Marken as broken, but compiles anyway. + hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata); } From 1448f07e16a4bad54abad825346b1f2b2b9b878a Mon Sep 17 00:00:00 2001 From: Diego Diverio Date: Tue, 24 Sep 2024 11:33:28 +0200 Subject: [PATCH 2/7] Enable GHC 9.8.2 and remove GHC 9.0.2. --- flake.nix | 2 +- nix/overlay-ghc902.nix | 33 --------------------------------- nix/overlay-ghc98.nix | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 34 deletions(-) delete mode 100644 nix/overlay-ghc902.nix create mode 100644 nix/overlay-ghc98.nix diff --git a/flake.nix b/flake.nix index e9a6e0a07f..816426404c 100644 --- a/flake.nix +++ b/flake.nix @@ -41,7 +41,7 @@ # We pick a single version of GHC to use by default within nix. This is # probably cleaner than always having N copies of each package / app and # being forced to refer to them by their GHC version. - defaultGhcVersion = "ghc96"; + defaultGhcVersion = "ghc98"; # Overlays are not per-system, so let's only compute them once. # For each version of GHC we produce a `pkgs.clashPackages-ghcVER`, e.g. diff --git a/nix/overlay-ghc902.nix b/nix/overlay-ghc902.nix deleted file mode 100644 index d64138de2b..0000000000 --- a/nix/overlay-ghc902.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs }: -final: prev: -let - inherit (pkgs.haskell.lib) doJailbreak dontCheck markUnbroken; -in -{ - # Use an older version than the default in nixpkgs. Since rewrite-inspector - # is basically abandonware it catches fire with brick 1.0+. - brick = doJailbreak prev.brick_0_70_1; - - # Marked as broken in nixpkgs for this version of GHC. - docopt = markUnbroken prev.docopt; - - # Marked as broken in nixpkgs, since it specifies much older dependencies - # than the defaults in nixpkgs. - rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector); - - singletons = prev.callHackage "singletons" "3.0" { }; - - # Lower the version to match `singletons-th`. - singletons-base = prev.callHackage "singletons-base" "3.0" { }; - - # The versions on nixpkgs are too new for GHC 9.0.2, which doesn't have - # type level `Char` literals. - singletons-th = prev.callHackage "singletons-th" "3.0" { - inherit (final) th-desugar; - }; - - # We can't use newer than 1.12 here: we need singletons 3.x (due to the cabal - # file of `clash-testsuite`) but the changed `DConP` constructor in 1.13 - # stops `singletons-th` from building. - th-desugar = prev.callHackage "th-desugar" "1.12" { }; -} diff --git a/nix/overlay-ghc98.nix b/nix/overlay-ghc98.nix new file mode 100644 index 0000000000..981317bbd1 --- /dev/null +++ b/nix/overlay-ghc98.nix @@ -0,0 +1,21 @@ +{ pkgs }: +final: prev: +let + inherit (pkgs.haskell.lib) doJailbreak markUnbroken; +in +{ + # Use an older version than the default in nixpkgs. Since rewrite-inspector + # is basically abandonware it catches fire with brick 1.0+. + brick = doJailbreak prev.brick_0_70_1; + + vty = doJailbreak (prev.callHackage "vty" "5.39" { }); + + # Marked as broken in nixpkgs, since it specifies much older dependencies + # than the defaults in nixpkgs. + rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector); + + derive-storable-plugin = doJailbreak prev.derive-storable-plugin; + + # Marken as broken, but compiles anyway. + hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata); +} From c878fa2c20459c6b994722d238b18ac16fbb94ed Mon Sep 17 00:00:00 2001 From: Diego Diverio Date: Tue, 24 Sep 2024 11:35:46 +0200 Subject: [PATCH 3/7] Export ghcVersion from flake.nix. --- flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake.nix b/flake.nix index 816426404c..bfc539381b 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,9 @@ in assert pkgs.lib.asserts.assertOneOf "defaultGhcVersion" defaultGhcVersion ghcVersions; { + # Export the variable so that other flakes can use it. + ghcVersion = defaultGhcVersion; + packages = { inherit (pkgs."clashPackages-${defaultGhcVersion}") clash-benchmark From 1ce338c4400ccdda930d0a6c8d5f3d725af0ec79 Mon Sep 17 00:00:00 2001 From: Diego Diverio Date: Tue, 24 Sep 2024 15:40:58 +0200 Subject: [PATCH 4/7] Remove Hackage calls for packages already in nixpkgs. --- flake.lock | 6 +++--- nix/overlay-ghc96.nix | 13 ------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/flake.lock b/flake.lock index 721f3f3d34..18f2471dc2 100644 --- a/flake.lock +++ b/flake.lock @@ -100,11 +100,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726583932, - "narHash": "sha256-zACxiQx8knB3F8+Ze+1BpiYrI+CbhxyWpcSID9kVhkQ=", + "lastModified": 1727089097, + "narHash": "sha256-ZMHMThPsthhUREwDebXw7GX45bJnBCVbfnH1g5iuSPc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "658e7223191d2598641d50ee4e898126768fe847", + "rev": "568bfef547c14ca438c56a0bece08b8bb2b71a9c", "type": "github" }, "original": { diff --git a/nix/overlay-ghc96.nix b/nix/overlay-ghc96.nix index 01b61305e3..a2eefc23d0 100644 --- a/nix/overlay-ghc96.nix +++ b/nix/overlay-ghc96.nix @@ -30,25 +30,12 @@ in # than the defaults in nixpkgs. rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector); - # We want a version that matches with singletons-th, but the tests in here - # are also a bit flaky since GHC 9.6 isn't officially supported. - singletons-base = dontCheck (prev.callHackage "singletons-base" "3.2" { }); # dontCheck prev.singletons-base_3_2; - - # Use a newer version than the default in nixpkgs. - singletons-th = prev.callHackage "singletons-th" "3.2" { }; # prev.singletons-th_3_2; - # Needs a newer text than the .cabal file currently uploaded to hackage. string-qq = doJailbreak prev.string-qq; - # Needs a newer version than the default in nixpkgs. - th-desugar = prev.callHackage "th-desugar" "1.15" { }; - # Needs a newer base than the .cabal file currently uploaded to hackage. vector-binary-instances = doJailbreak prev.vector-binary-instances; - # Use an older version than the default in nixpkgs. - th-abstraction = prev.callHackage "th-abstraction" "0.5.0.0" {}; - # type-errors 0.2.0.2 is bounded on doctest >=0.16.0.1 && <0.22 doctest = prev.callHackage "doctest" "0.21.1" { }; From 4d8d9444daa14f847c8ac8b4b3334e24778e956a Mon Sep 17 00:00:00 2001 From: Diego Diverio Date: Tue, 24 Sep 2024 16:51:19 +0200 Subject: [PATCH 5/7] Add GHC 9.10.1. --- flake.nix | 2 +- nix/overlay-ghc910.nix | 56 ++++++++++++++++++++++++++++++++++++++++++ nix/overlay.nix | 2 +- 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 nix/overlay-ghc910.nix diff --git a/flake.nix b/flake.nix index bfc539381b..e04d2603de 100644 --- a/flake.nix +++ b/flake.nix @@ -36,7 +36,7 @@ # The versions of GHC that we want to be able to build / develop against # within the nix environment. Since nix is lazy, only derivations for # versions of GHC which are used are actually evaluated. - ghcVersions = [ "ghc96" "ghc98"]; + ghcVersions = [ "ghc96" "ghc98" "ghc910" ]; # We pick a single version of GHC to use by default within nix. This is # probably cleaner than always having N copies of each package / app and diff --git a/nix/overlay-ghc910.nix b/nix/overlay-ghc910.nix new file mode 100644 index 0000000000..20a866b8cd --- /dev/null +++ b/nix/overlay-ghc910.nix @@ -0,0 +1,56 @@ +{ pkgs }: +final: prev: +let + inherit (pkgs.haskell.lib) dontCheck doJailbreak markUnbroken; +in +{ + # Use an older version than the default in nixpkgs. Since rewrite-inspector + # is basically abandonware it catches fire with brick 1.0+. + brick = doJailbreak prev.brick_0_70_1; + + vty = doJailbreak (prev.callHackage "vty" "5.39" { }); + + hint = doJailbreak prev.hint; + + th-desugar = prev.th-desugar_1_17; + + singletons-th = prev.singletons-th_3_4; + + # Marked as broken in nixpkgs, since it specifies much older dependencies + # than the defaults in nixpkgs. + rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector); + + derive-storable-plugin = doJailbreak prev.derive-storable-plugin; + + # Marken as broken, but compiles anyway. + hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata); + + # Fails on GHC 9.10 with: + # library/Text/Regex/PCRE/Heavy.hs:123: failure in expression `head $ scan [re|\s*entry (\d+) (\w+)\s*&?|] (" entry 1 hello &entry 2 hi" :: String)' + # expected: (" entry 1 hello &",["1","hello"]) + # but got: :55:1: warning: [GHC-63394] [-Wx-partial] + # ^ + # In the use of ‘head’ + # (imported from Prelude.Compat, but defined in GHC.Internal.List): + # "This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use "Data.List.NonEmpty"." + # (" entry 1 hello &",["1","hello"]) + + pcre-heavy = dontCheck prev.pcre-heavy; + + # Relies on older versions of text. + string-random = doJailbreak prev.string-random; + + singletons-base = prev.singletons-base_3_4; + + microstache = prev.microstache_1_0_3; + + # nixplgs doesn't include revision 1, changing dependency on template-haskell. + string-interpolate = pkgs.haskell.lib.compose.overrideCabal (drv: { + revision = "1"; + editedCabalFile = "sha256-oh0tR+LDFcVzQnm4kSrmhAU+P7wdai536d72Cvhzipg="; + }) (prev.callHackageDirect { + pkg = "string-interpolate"; + ver = "0.3.4.0"; + sha256 = "sha256-KA8P6cc6N7pZ9/ay3edcEGx4vpKtp+EY7tn8U1NrbG8="; + } { }); +} diff --git a/nix/overlay.nix b/nix/overlay.nix index 8d07568cf1..c0661c80ee 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -49,7 +49,7 @@ let "${ghc-typelits-natnormalise}" { }; # doctest-parallel = hprev.callHackage "doctest-parallel" "0.3.1" { }; - doctest-parallel = hprev.callHackageDirect { pkg = "doctest-parallel"; ver = "0.3.1"; sha256 = "sha256-j0mk4RTEau6Cl90E8vMWZiA/ldRRurtLSYbGGE+q/vk="; } {}; + # doctest-parallel = hprev.callHackageDirect { pkg = "doctest-parallel"; ver = "0.3.1"; sha256 = "sha256-j0mk4RTEau6Cl90E8vMWZiA/ldRRurtLSYbGGE+q/vk="; } {}; }; # An overlay with the packages in this repository. From 79ec2077486beb48f0a2c6593e5cfbdc76f264cf Mon Sep 17 00:00:00 2001 From: Diego Diverio Date: Wed, 25 Sep 2024 09:29:35 +0200 Subject: [PATCH 6/7] Add comments to overlays. --- nix/overlay-ghc910.nix | 12 ++++++++---- nix/overlay-ghc96.nix | 2 +- nix/overlay-ghc98.nix | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/nix/overlay-ghc910.nix b/nix/overlay-ghc910.nix index 20a866b8cd..4d229eea30 100644 --- a/nix/overlay-ghc910.nix +++ b/nix/overlay-ghc910.nix @@ -8,18 +8,17 @@ in # is basically abandonware it catches fire with brick 1.0+. brick = doJailbreak prev.brick_0_70_1; + # brick 0.70.1 requires vty < 6.0. vty = doJailbreak (prev.callHackage "vty" "5.39" { }); + # Relies on older versions of some libraries. hint = doJailbreak prev.hint; - th-desugar = prev.th-desugar_1_17; - - singletons-th = prev.singletons-th_3_4; - # Marked as broken in nixpkgs, since it specifies much older dependencies # than the defaults in nixpkgs. rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector); + # Requires some old versions of libraries, but still works. derive-storable-plugin = doJailbreak prev.derive-storable-plugin; # Marken as broken, but compiles anyway. @@ -40,10 +39,15 @@ in # Relies on older versions of text. string-random = doJailbreak prev.string-random; + # We need the newest version from nixpkgs for these packages. singletons-base = prev.singletons-base_3_4; microstache = prev.microstache_1_0_3; + th-desugar = prev.th-desugar_1_17; + + singletons-th = prev.singletons-th_3_4; + # nixplgs doesn't include revision 1, changing dependency on template-haskell. string-interpolate = pkgs.haskell.lib.compose.overrideCabal (drv: { revision = "1"; diff --git a/nix/overlay-ghc96.nix b/nix/overlay-ghc96.nix index a2eefc23d0..8e2e6291ab 100644 --- a/nix/overlay-ghc96.nix +++ b/nix/overlay-ghc96.nix @@ -1,7 +1,7 @@ { pkgs }: final: prev: let - inherit (pkgs.haskell.lib) doJailbreak dontCheck markUnbroken; + inherit (pkgs.haskell.lib) doJailbreak markUnbroken; in { # Use an older version than the default in nixpkgs. Since rewrite-inspector diff --git a/nix/overlay-ghc98.nix b/nix/overlay-ghc98.nix index 981317bbd1..b927fa380f 100644 --- a/nix/overlay-ghc98.nix +++ b/nix/overlay-ghc98.nix @@ -8,12 +8,14 @@ in # is basically abandonware it catches fire with brick 1.0+. brick = doJailbreak prev.brick_0_70_1; + # brick 0.70.1 requires vty < 6.0. vty = doJailbreak (prev.callHackage "vty" "5.39" { }); # Marked as broken in nixpkgs, since it specifies much older dependencies # than the defaults in nixpkgs. rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector); + # Requires some old versions of libraries, but still works. derive-storable-plugin = doJailbreak prev.derive-storable-plugin; # Marken as broken, but compiles anyway. From 029419bda7eda7baabde1969d2541bbc33b3126b Mon Sep 17 00:00:00 2001 From: Diego Diverio Date: Tue, 15 Oct 2024 10:04:26 +0200 Subject: [PATCH 7/7] Make GHC 9.10 the default in flake.nix. --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index e04d2603de..e72d702c84 100644 --- a/flake.nix +++ b/flake.nix @@ -41,7 +41,7 @@ # We pick a single version of GHC to use by default within nix. This is # probably cleaner than always having N copies of each package / app and # being forced to refer to them by their GHC version. - defaultGhcVersion = "ghc98"; + defaultGhcVersion = "ghc910"; # Overlays are not per-system, so let's only compute them once. # For each version of GHC we produce a `pkgs.clashPackages-ghcVER`, e.g.