Skip to content

Commit 96cd380

Browse files
committed
Avoid rerunning githash test all the time
1 parent 6ced54f commit 96cd380

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/githash/default.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ let
1515
project = haskell-nix.cabalProject' {
1616
inherit src;
1717
cabalProjectLocal = builtins.readFile ../cabal.project.local;
18-
# When haskell.nix has come from the store (e.g. on hydra) we need to provide
19-
# a suitable mock of the cleaned source with a .git dir.
20-
modules = (optional (!(src ? origSrc && __pathExists (src.origSrc + "/.git"))) {
18+
# Mock the .git dir to avoid rebuilding on every commit.
19+
modules = [{
2120
packages.githash-test.src =
2221
rec {
2322
origSrc = evalPackages.runCommand "githash-test-src" { nativeBuildInputs = [ evalPackages.gitReallyMinimal ]; } ''
@@ -32,7 +31,6 @@ let
3231
origSrcSubDir = origSrc + origSubDir;
3332
outPath = origSrcSubDir;
3433
};
35-
}) ++ [{
3634
packages.githash-test.components.exes.githash-test.build-tools = mkForce [ git ];
3735
}];
3836
inherit compiler-nix-name evalPackages;

0 commit comments

Comments
 (0)