From d58d4117a2361d3c783e953a6b15a56b509ddd42 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 17 Apr 2024 18:22:14 +1200 Subject: [PATCH] Add cabal2json to static-nix-tools --- nix-tools/cabal.project | 10 +++++++--- nix-tools/nix-tools/nix-tools.cabal | 4 ++-- nix-tools/overlay.nix | 7 +++++-- nix-tools/static/project.nix | 5 ++++- nix-tools/static/zipped.nix | 1 + 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/nix-tools/cabal.project b/nix-tools/cabal.project index 9a4777ccaa..4c5b85330a 100644 --- a/nix-tools/cabal.project +++ b/nix-tools/cabal.project @@ -1,13 +1,11 @@ index-state: 2024-03-28T00:00:00Z -with-compiler: ghc-9.2.8 - packages: nix-tools -- haskell.nix expects nix-tools to provide the cabal and hpack executables -- so we put these two packages here, so they will be present even if nix-tools -- dependencies change -extra-packages: cabal-install, hpack +extra-packages: cabal-install, hpack, Cabal-syntax-json test-show-details: direct @@ -29,3 +27,9 @@ source-repository-package location: https://github.com/michaelpj/hackage-db.git tag: f3b9240212b036391871e4ea09891e91efcea7a1 --sha256: sha256-n0ATmkwtR68E2FuZK3QIQgZirVmWbd21vIQmzhGKsRw= + +source-repository-package + type: git + location: https://github.com/andreabedini/Cabal-syntax-json.git + tag: bf97be0038489239a11c61653b55afc77356ac1e + --sha256: sha256-i9TEqQqRqFM07q1Lr6wcMlURhBkhkVxHhP1jQjSE+Yg= diff --git a/nix-tools/nix-tools/nix-tools.cabal b/nix-tools/nix-tools/nix-tools.cabal index 5488268cfc..5936f46958 100644 --- a/nix-tools/nix-tools/nix-tools.cabal +++ b/nix-tools/nix-tools/nix-tools.cabal @@ -29,7 +29,7 @@ library , Stack2nix.External.Resolve , Stack2nix.Project , Stack2nix.Stack - build-depends: base >= 4 && <4.18 + build-depends: base >= 4 && <4.20 , Cabal >= 3.10.3 && <3.11 , Cabal-syntax >= 3.10 && <3.11 , aeson >= 2.0 && <2.3 @@ -46,7 +46,7 @@ library -- Needs https://github.com/input-output-hk/iohk-nix/commit/6a8c29117eff36ce975e02e01efc8b25d93fcb90#diff-6fb0c6517b547a8baf082d5d2d604842 -- to work with the data-dir issues when building components. -- This commit is included since 0.6.5. - , hnix >= 0.6.5 && <0.17 + , hnix >= 0.6.5 && <0.18 , hpack , http-client , http-client-tls diff --git a/nix-tools/overlay.nix b/nix-tools/overlay.nix index 55fc6365bb..5d63272fbf 100644 --- a/nix-tools/overlay.nix +++ b/nix-tools/overlay.nix @@ -1,7 +1,7 @@ final: _prev: let - compiler-nix-name = "ghc8107"; + compiler-nix-name = "ghc964"; nix-tools = nix-tools-set { nix-tools = nix-tools-unchecked; @@ -18,7 +18,7 @@ let src = ./.; compiler-nix-name = final.lib.mkDefault compiler-nix-name; - compilerSelection = p: p.haskell.compiler; + # compilerSelection = p: p.haskell.compiler; # tests need to fetch hackage configureArgs = final.lib.mkDefault "--disable-tests"; @@ -54,6 +54,9 @@ let inherit (project.hsPkgs.hpack.components.exes) hpack; + + inherit (project.hsPkgs.Cabal-syntax-json.components.exes) + cabal2json; }; warning = final.lib.mapAttrs diff --git a/nix-tools/static/project.nix b/nix-tools/static/project.nix index fa275759f3..df00d692f4 100644 --- a/nix-tools/static/project.nix +++ b/nix-tools/static/project.nix @@ -40,6 +40,9 @@ let plan-to-nix.dontStrip = false; stack-repos.dontStrip = false; }; + packages.cabal-install.components.exes.cabal.dontStrip = false; + packages.hpack.components.exes.hpack.dontStrip = false; + packages.Cabal-syntax-json.components.exes.cabal2json.dontStrip = false; }; @@ -58,7 +61,7 @@ let static-nix-tools-project = pkgs.haskell-nix.project' { - compiler-nix-name = "ghc928"; + compiler-nix-name = "ghc964"; src = ../.; diff --git a/nix-tools/static/zipped.nix b/nix-tools/static/zipped.nix index 44898d49c1..c6390818c6 100644 --- a/nix-tools/static/zipped.nix +++ b/nix-tools/static/zipped.nix @@ -35,6 +35,7 @@ let drvs' = [ hsPkgs.cabal-install.components.exes.cabal hsPkgs.hpack.components.exes.hpack + hsPkgs.Cabal-syntax-json.components.exes.cabal2json ] ++ strippedNixToolsComponents; };