1{ stdenv, lib, haskell-nix, haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, runCommand, gitMinimal, buildPackages }:
6 src = testSrc "githash";
8 # Using the cross compiled version here, but currently git does not
9 # seem to cross compile (so this test is disabled for cross compilation in
10 # the test/default.nix file).
11 # Using buildPackages here is not right, but at least gets musl64 test to pass.
12 if stdenv.hostPlatform != stdenv.buildPlatform
13 then buildPackages.buildPackages.gitReallyMinimal
15 project = haskell-nix.cabalProject' {
17 # When haskell.nix has come from the store (e.g. on hydra) we need to provide
18 # a suitable mock of the cleaned source with a .git dir.
19 modules = (optional (!(src ? origSrc && __pathExists (src.origSrc + "/.git"))) {
20 packages.githash-test.src =
22 origSrc = runCommand "githash-test-src" { nativeBuildInputs = [ git ]; } ''
23 mkdir -p $out/test/githash
26 cp -r ${src}/* test/githash
28 git -c "user.name=unknown" -c "user.email=unknown" commit -m 'Initial Commit'
30 origSubDir = "/test/githash";
31 origSrcSubDir = origSrc + origSubDir;
32 outPath = origSrcSubDir;
35 packages.githash-test.components.exes.githash-test.build-tools = mkForce [ git ];
37 inherit compiler-nix-name;
40 packages = project.hsPkgs;
42 packages.githash-test.components.exes.githash-test;
45 # githash runs git from TH code and this needs a cross compiled git exe
46 # to work correctly. Cross compiling git is currently brocken.
47 meta.disabled = compiler-nix-name == "ghc901" || haskellLib.isCrossHost;
50 inherit (project) plan-nix;
53 run = stdenv.mkDerivation {
54 name = "run-githash-test";
57 exe="${githash-test}/bin/githash-test${stdenv.hostPlatform.extensions.executable}"
58 echo Checking that the error message is generated and that it came from the right place:
59 (${toString githash-test.config.testWrapper} $exe || true) 2>&1 \
60 | grep "error, called at src/Main.hs:5:13 in main:Main"
64 meta.platforms = platforms.all;
67 # Used for debugging with nix repl
68 inherit project packages;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list