tests.haskell.cabalSdist: avoid lib.fileset
This commit is contained in:
parent
6ff076b1b1
commit
f6cc18e0e4
@ -6,18 +6,7 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
src = lib.fileset.toSource {
|
localRaw = haskellPackages.callPackage ./generated.nix { };
|
||||||
root = ./local;
|
|
||||||
fileset = lib.fileset.unions [
|
|
||||||
./local/app
|
|
||||||
./local/CHANGELOG.md
|
|
||||||
./local/local.cabal
|
|
||||||
];
|
|
||||||
};
|
|
||||||
# This prevents the source from depending on the formatting of the ./local/generated.nix file
|
|
||||||
localRaw = haskell.lib.compose.overrideSrc {
|
|
||||||
inherit src;
|
|
||||||
} (haskellPackages.callPackage ./local/generated.nix { });
|
|
||||||
in
|
in
|
||||||
lib.recurseIntoAttrs rec {
|
lib.recurseIntoAttrs rec {
|
||||||
|
|
||||||
@ -28,7 +17,6 @@ lib.recurseIntoAttrs rec {
|
|||||||
|
|
||||||
localFromCabalSdist = haskellPackages.buildFromCabalSdist localRaw;
|
localFromCabalSdist = haskellPackages.buildFromCabalSdist localRaw;
|
||||||
|
|
||||||
# NOTE: ./local refers to the "./." path in `./local/generated.nix`.
|
|
||||||
# This test makes sure that localHasNoDirectReference can actually fail if
|
# This test makes sure that localHasNoDirectReference can actually fail if
|
||||||
# it doesn't do anything. If this test fails, either the test setup was broken,
|
# it doesn't do anything. If this test fails, either the test setup was broken,
|
||||||
# or Haskell packaging has changed the way `src` is treated in such a way that
|
# or Haskell packaging has changed the way `src` is treated in such a way that
|
||||||
@ -39,7 +27,7 @@ lib.recurseIntoAttrs rec {
|
|||||||
drvPath = builtins.unsafeDiscardOutputDependency localRaw.drvPath;
|
drvPath = builtins.unsafeDiscardOutputDependency localRaw.drvPath;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
grep ${src} $drvPath >/dev/null
|
grep ${localRaw.src} $drvPath >/dev/null
|
||||||
touch $out
|
touch $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -49,7 +37,7 @@ lib.recurseIntoAttrs rec {
|
|||||||
drvPath = builtins.unsafeDiscardOutputDependency localFromCabalSdist.drvPath;
|
drvPath = builtins.unsafeDiscardOutputDependency localFromCabalSdist.drvPath;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
grep -v ${src} $drvPath >/dev/null
|
grep -v ${localRaw.src} $drvPath >/dev/null
|
||||||
touch $out
|
touch $out
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# nix run ../../../../..#cabal2nix -- ./.
|
# nix run ../../../../..#cabal2nix -- ./local
|
||||||
{
|
{
|
||||||
mkDerivation,
|
mkDerivation,
|
||||||
base,
|
base,
|
||||||
@ -7,10 +7,11 @@
|
|||||||
mkDerivation {
|
mkDerivation {
|
||||||
pname = "local";
|
pname = "local";
|
||||||
version = "0.1.0.0";
|
version = "0.1.0.0";
|
||||||
src = ./.; # also referred to as ./local in the test; these are the same path constants
|
src = ./local;
|
||||||
isLibrary = false;
|
isLibrary = false;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
executableHaskellDepends = [ base ];
|
executableHaskellDepends = [ base ];
|
||||||
description = "Nixpkgs test case";
|
description = "Nixpkgs test case";
|
||||||
license = lib.licenses.mit;
|
license = lib.licenses.mit;
|
||||||
|
mainProgram = "local";
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user