From 80cc0cb940d000304848156de4571f5976726a1a Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 22 Apr 2024 12:25:37 +0200 Subject: [PATCH 1/2] spago: 0.20.9 -> 0.21.0 --- .../configuration-hackage2nix/main.yaml | 3 +- .../haskell-modules/configuration-nix.nix | 27 +++--- .../haskell-modules/hackage-packages.nix | 67 +++++++++----- .../tools/purescript/spago/default.nix | 88 +++++++++---------- .../tools/purescript/spago/spago.nix | 13 +-- 5 files changed, 109 insertions(+), 89 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml index 5d9e21dc09377..2a9ba5dfbed6a 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml @@ -43,7 +43,6 @@ extra-packages: - attoparsec == 0.13.* # 2022-02-23: Needed to compile elm for now - base16-bytestring < 1 # required for cabal-install etc. - basement < 0.0.15 # 2022-08-30: last version to support GHC < 8.10 - - bower-json == 1.0.0.1 # 2022-05-21: Needed for spago 0.20.9 - brick == 0.70.* # 2022-08-13: needed by taskell - brittany == 0.13.1.2 # 2022-09-20: needed for hls on ghc 8.8 - crackNum < 3.0 # 2021-05-21: 3.0 removed the lib which sbv 7.13 uses @@ -109,6 +108,8 @@ extra-packages: - algebraic-graphs < 0.7 # 2023-08-14: Needed for building weeder < 2.6.0 - fuzzyset == 0.2.4 # 2023-12-20: Needed for building postgrest > 10 - ShellCheck == 0.9.0 # 2024-03-21: pinned by haskell-ci + - versions < 6 # 2024-04-22: required by spago-0.21 + - fsnotify < 0.4 # 2024-04-22: required by spago-0.21 package-maintainers: abbradar: diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index fb4afdde5bbaf..96dc1313c942d 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -849,8 +849,12 @@ self: super: builtins.intersectAttrs super { url = "https://github.com/purescript/purescript-docs-search/releases/download/v0.0.11/purescript-docs-search"; sha256 = "1hjdprm990vyxz86fgq14ajn0lkams7i00h8k2i2g1a0hjdwppq6"; }; - - spagoDocs = overrideCabal (drv: { + in + lib.pipe (super.spago.override { + versions = self.versions_5_0_5; + fsnotify = self.fsnotify_0_3_0_1; + }) [ + (overrideCabal (drv: { postUnpack = (drv.postUnpack or "") + '' # Spago includes the following two files directly into the binary # with Template Haskell. They are fetched at build-time from the @@ -875,21 +879,14 @@ self: super: builtins.intersectAttrs super { "$sourceRoot/templates/docs-search-app-0.0.11.js" \ "$sourceRoot/templates/purescript-docs-search-0.0.11" ''; - }) super.spago; - - spagoOldAeson = spagoDocs.overrideScope (hfinal: hprev: { - # spago is not yet updated for aeson 2.0 - aeson = hfinal.aeson_1_5_6_0; - # bower-json 1.1.0.0 only supports aeson 2.0, so we pull in the older version here. - bower-json = hprev.bower-json_1_0_0_1; - }); + })) # Tests require network access. - spagoWithoutChecks = dontCheck spagoOldAeson; - in - # spago doesn't currently build with ghc92. Top-level spago is pulled from - # ghc90 and explicitly marked unbroken. - markBroken spagoWithoutChecks; + dontCheck + + # Overly strict upper bound on text + doJailbreak + ]; # checks SQL statements at compile time, and so requires a running PostgreSQL # database to run it's test suite diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index f8a6812cb9b42..4ca5fabd6ebfb 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -53214,27 +53214,6 @@ self: { license = lib.licenses.bsd3; }) {}; - "bower-json_1_0_0_1" = callPackage - ({ mkDerivation, aeson, aeson-better-errors, base, bytestring - , deepseq, ghc-prim, mtl, scientific, tasty, tasty-hunit, text - , transformers, unordered-containers, vector - }: - mkDerivation { - pname = "bower-json"; - version = "1.0.0.1"; - sha256 = "0wvygg3rdbxzrmr61a9w6ddv9pfric85ih8hnxyk0ydzn7i59abs"; - libraryHaskellDepends = [ - aeson aeson-better-errors base bytestring deepseq ghc-prim mtl - scientific text transformers unordered-containers vector - ]; - testHaskellDepends = [ - aeson base bytestring tasty tasty-hunit text unordered-containers - ]; - description = "Read bower.json from Haskell"; - license = lib.licenses.mit; - hydraPlatforms = lib.platforms.none; - }) {}; - "bower-json" = callPackage ({ mkDerivation, aeson, aeson-better-errors, base, bytestring , deepseq, ghc-prim, mtl, scientific, tasty, tasty-hunit, text @@ -112143,6 +112122,30 @@ self: { broken = true; }) {}; + "fsnotify_0_3_0_1" = callPackage + ({ mkDerivation, async, base, bytestring, containers, directory + , filepath, hinotify, random, shelly, tasty, tasty-hunit, temporary + , text, time, unix, unix-compat + }: + mkDerivation { + pname = "fsnotify"; + version = "0.3.0.1"; + sha256 = "19bdbz9wb9jvln6yg6qm0hz0w84bypvkxf0wjhgrgd52f9gidlny"; + revision = "2"; + editedCabalFile = "12m0y5583plk9pikvwqy1rc0yyvicxf8j5nz0nwxb4grsgfqrv7v"; + libraryHaskellDepends = [ + async base bytestring containers directory filepath hinotify shelly + text time unix unix-compat + ]; + testHaskellDepends = [ + async base directory filepath random tasty tasty-hunit temporary + unix-compat + ]; + description = "Cross platform library for file change notification"; + license = lib.licenses.bsd3; + hydraPlatforms = lib.platforms.none; + }) {}; + "fsnotify" = callPackage ({ mkDerivation, async, base, bytestring, containers, directory , exceptions, filepath, hinotify, monad-control, random, retry @@ -209339,6 +209342,7 @@ self: { ]; description = "Safely evaluate pure Haskell expressions"; license = lib.licenses.bsd3; + badPlatforms = [ "aarch64-linux" ]; mainProgram = "mueval"; }) {}; @@ -318568,6 +318572,27 @@ self: { hydraPlatforms = lib.platforms.none; }) {}; + "versions_5_0_5" = callPackage + ({ mkDerivation, base, deepseq, hashable, megaparsec, microlens + , parser-combinators, QuickCheck, tasty, tasty-hunit + , tasty-quickcheck, text + }: + mkDerivation { + pname = "versions"; + version = "5.0.5"; + sha256 = "01kn3ilizzm5n05nz0qry1vjb6bj8dzinyqn3mbshds298acn70c"; + libraryHaskellDepends = [ + base deepseq hashable megaparsec parser-combinators text + ]; + testHaskellDepends = [ + base megaparsec microlens QuickCheck tasty tasty-hunit + tasty-quickcheck text + ]; + description = "Types and parsers for software version numbers"; + license = lib.licenses.bsd3; + hydraPlatforms = lib.platforms.none; + }) {}; + "versions" = callPackage ({ mkDerivation, base, deepseq, hashable, megaparsec, microlens , parser-combinators, tasty, tasty-hunit, template-haskell, text diff --git a/pkgs/development/tools/purescript/spago/default.nix b/pkgs/development/tools/purescript/spago/default.nix index 82d3be2fd4691..b9d97c351b6d7 100644 --- a/pkgs/development/tools/purescript/spago/default.nix +++ b/pkgs/development/tools/purescript/spago/default.nix @@ -1,7 +1,9 @@ { haskell +, haskellPackages , lib # The following are only needed for the passthru.tests: +, spago , cacert , git , nodejs @@ -9,53 +11,47 @@ , runCommand }: -let - spago = - lib.pipe - haskell.packages.ghc90.spago - [ haskell.lib.compose.justStaticExecutables - (haskell.lib.compose.overrideCabal (oldAttrs: { - changelog = "https://github.com/purescript/spago/releases/tag/${oldAttrs.version}"; - })) - ]; -in +lib.pipe + haskellPackages.spago + [ + haskell.lib.compose.justStaticExecutables -spago.overrideAttrs (oldAttrs: { - passthru = (oldAttrs.passthru or {}) // { - updateScript = ./update.sh; + (haskell.lib.compose.overrideCabal (oldAttrs: { + changelog = "https://github.com/purescript/spago/releases/tag/${oldAttrs.version}"; - # These tests can be run with the following command. The tests access the - # network, so they cannot be run in the nix sandbox. sudo is needed in - # order to change the sandbox option. - # - # $ sudo nix-build -A spago.passthru.tests --option sandbox relaxed - # - tests = - runCommand - "spago-tests" - { - __noChroot = true; - nativeBuildInputs = [ - cacert - git - nodejs - purescript - spago - ]; - } - '' - # spago expects HOME to be set because it creates a cache file under - # home. - HOME=$(pwd) + passthru = (oldAttrs.passthru or {}) // { + updateScript = ./update.sh; - spago --verbose init - spago --verbose build - spago --verbose test + # These tests can be run with the following command. The tests access the + # network, so they cannot be run in the nix sandbox. sudo is needed in + # order to change the sandbox option. + # + # $ sudo nix-build -A spago.passthru.tests --option sandbox relaxed + # + tests = + runCommand + "spago-tests" + { + __noChroot = true; + nativeBuildInputs = [ + cacert + git + nodejs + purescript + spago + ]; + } + '' + # spago expects HOME to be set because it creates a cache file under + # home. + HOME=$(pwd) - touch $out - ''; - }; - meta = (oldAttrs.meta or {}) // { - mainProgram = "spago"; - }; -}) + spago --verbose init + spago --verbose build + spago --verbose test + + touch $out + ''; + }; + })) + ] diff --git a/pkgs/development/tools/purescript/spago/spago.nix b/pkgs/development/tools/purescript/spago/spago.nix index e3636e16f58cf..d0455081111fa 100644 --- a/pkgs/development/tools/purescript/spago/spago.nix +++ b/pkgs/development/tools/purescript/spago/spago.nix @@ -9,16 +9,16 @@ , optparse-applicative, prettyprinter, process, QuickCheck, retry , rio, rio-orphans, safe, semver-range, stm, stringsearch, tar , template-haskell, temporary, text, time, transformers, turtle -, unliftio, unordered-containers, utf8-string, versions, with-utf8 -, zlib +, unliftio, unordered-containers, uri-encode, utf8-string, versions +, with-utf8, yaml, zlib }: mkDerivation { pname = "spago"; - version = "0.20.9"; + version = "0.21.0"; src = fetchgit { url = "https://github.com/purescript/spago.git"; - sha256 = "00vdqg7vaw3d9zwh47886lw9fhhlwjagzhaj3aqz4xm92pjavhih"; - rev = "d16d4914200783fbd820ba89dbdf67270454faf5"; + sha256 = "1v5y15nhw6smnir0y7y854pa70iv8asxsqph2y8rz1c9lkz5d41g"; + rev = "c354f4a461f65fcb83aaa843830ea1589f6c7179"; fetchSubmodules = true; }; isLibrary = true; @@ -31,7 +31,7 @@ mkDerivation { optparse-applicative prettyprinter process retry rio rio-orphans safe semver-range stm stringsearch tar template-haskell temporary text time transformers turtle unliftio unordered-containers - utf8-string versions with-utf8 zlib + uri-encode utf8-string versions with-utf8 yaml zlib ]; executableHaskellDepends = [ ansi-terminal base text turtle with-utf8 @@ -43,4 +43,5 @@ mkDerivation { testToolDepends = [ hspec-discover ]; homepage = "https://github.com/purescript/spago#readme"; license = lib.licenses.bsd3; + mainProgram = "spago"; } From 2a76047d229816dcac2957160d73f4e0b0657ddc Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 22 Apr 2024 12:27:22 +0200 Subject: [PATCH 2/2] spago: move completions override to configuration-nix.nix --- pkgs/development/haskell-modules/configuration-common.nix | 3 --- pkgs/development/haskell-modules/configuration-nix.nix | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 777cbef335970..b0cd19321c97f 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1333,9 +1333,6 @@ self: super: { # https://github.com/haskell/hoopl/issues/50 hoopl = dontCheck super.hoopl; - # Generate shell completion for spago - spago = self.generateOptparseApplicativeCompletions [ "spago" ] super.spago; - # https://github.com/DanielG/cabal-helper/pull/123 cabal-helper = doJailbreak super.cabal-helper; diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 96dc1313c942d..9f873eec2611c 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -886,6 +886,9 @@ self: super: builtins.intersectAttrs super { # Overly strict upper bound on text doJailbreak + + # Generate shell completion for spago + (self.generateOptparseApplicativeCompletions [ "spago" ]) ]; # checks SQL statements at compile time, and so requires a running PostgreSQL