Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cabal2json to static-nix-tools #2185

Merged
merged 16 commits into from
Apr 22, 2024
2 changes: 1 addition & 1 deletion ci.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
# on a machine with e.g. no way to build the Darwin IFDs you need!
{ ifdLevel ? 3
{ ifdLevel # This is passed in from flake.nix
, checkMaterialization ? false
, system ? builtins.currentSystem
, evalSystem ? builtins.currentSystem or "x86_64-linux"
Expand Down
11 changes: 7 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
let
callFlake = import flake-compat;

ifdLevel = 3;
compiler = "ghc928";
config = import ./config.nix;

Expand Down Expand Up @@ -208,7 +209,7 @@
stripAttrsForHydra (filterDerivations (
# This is awkward.
import ./ci.nix {
inherit system;
inherit ifdLevel system;
haskellNix = self;
})));

Expand Down Expand Up @@ -250,7 +251,9 @@
};
in cf.defaultNix.hydraJobs;
in
self.allJobs.${system} // { nix-tools = nix-tools-hydraJobs.${system} or {}; }
self.allJobs.${system}
// lib.optionalAttrs (ifdLevel > 2)
{ nix-tools = nix-tools-hydraJobs.${system} or {}; }
);

devShells = forEachSystemPkgs (pkgs:
Expand Down Expand Up @@ -284,7 +287,7 @@
"ghc921" "ghc922" "ghc923"])
);
}; in with (import nixpkgs { system = "x86_64-linux"; });
traceHydraJobs (lib.recursiveUpdate flake {
traceHydraJobs (lib.recursiveUpdate flake (lib.optionalAttrs (ifdLevel > 2) {
hydraJobs.nix-tools = pkgs.releaseTools.aggregate {
name = "nix-tools";
constituents = [
Expand All @@ -299,7 +302,7 @@
(writeText "gitrev" (self.rev or "0000000000000000000000000000000000000000"))
];
};
});
}));

# --- Flake Local Nix Configuration ----------------------------
nixConfig = {
Expand Down
10 changes: 5 additions & 5 deletions nix-tools-static.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
pkgs: let baseurl = "https://github.com/input-output-hk/haskell.nix/releases/download/nix-tools-0.1.7/"; in {
pkgs: let baseurl = "https://github.com/input-output-hk/haskell.nix/releases/download/nix-tools-0.1.8/"; in {
aarch64-darwin = pkgs.fetchurl {
name = "aarch64-darwin-nix-tools-static";
url = "${baseurl}aarch64-darwin-nix-tools-static.zip";
sha256 = "sha256-f8XbWzHV+yriUvPCxEOt7CuVN5pfE4rbz37OPRG8j7U=";
sha256 = "sha256-du+QOnEkjVQFHiwHr7NGOku/fmvBUCFYRPipzU/MRPc=";
};
x86_64-darwin = pkgs.fetchurl {
name = "x86_64-darwin-nix-tools-static";
url = "${baseurl}x86_64-darwin-nix-tools-static.zip";
sha256 = "sha256-kLy9lqJKaISgnfkyiQf7uupRImt3vR/szwXxR+rmDic=";
sha256 = "sha256-I55Mn6iKYxy3uoQp3DyhuJOvUJ+mDP9In9DyuEaw6K4=";
};
aarch64-linux = pkgs.fetchurl {
name = "aarch64-linux-nix-tools-static";
url = "${baseurl}aarch64-linux-nix-tools-static.zip";
sha256 = "sha256-GBq5/JsZamuUZLIXEWxVk5Xnj6eZeQU6vX7ceAcBmAM=";
sha256 = "sha256-kx06o5tzow6PCdkV+mlQW4TQHdkEZGtSvH4sij5ZaYk=";
};
x86_64-linux = pkgs.fetchurl {
name = "x86_64-linux-nix-tools-static";
url = "${baseurl}x86_64-linux-nix-tools-static.zip";
sha256 = "sha256-+tFokn7TNptt2BkROc6QVy2KgWNmPzPVv4tUCm/E7vI=";
sha256 = "sha256-02mBvbW5WT+0fY9n2RIbrNnMwpJIHZ5obgmFXDTz8Ds=";
};
}
10 changes: 7 additions & 3 deletions nix-tools/cabal.project
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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=
70 changes: 35 additions & 35 deletions nix-tools/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nix-tools/nix-tools/nix-tools.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions nix-tools/overlay.nix
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions nix-tools/static/project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};


Expand All @@ -53,6 +56,9 @@ let
packages.nix-tools.ghcOptions = [
"-L${pkgs.lib.getLib pkgs.static-gmp}/lib"
];
packages.Cabal-syntax-json.ghcOptions = [
"-L${pkgs.lib.getLib pkgs.static-gmp}/lib"
];
};


Expand Down
1 change: 1 addition & 0 deletions nix-tools/static/zipped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down