diff --git a/pkgs/test/haskell/cabalSdist/default.nix b/pkgs/test/haskell/cabalSdist/default.nix index d9dc2bada6e22a..147602126ded63 100644 --- a/pkgs/test/haskell/cabalSdist/default.nix +++ b/pkgs/test/haskell/cabalSdist/default.nix @@ -6,18 +6,7 @@ }: let - src = lib.fileset.toSource { - 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 { }); + localRaw = haskellPackages.callPackage ./generated.nix { }; in lib.recurseIntoAttrs rec { @@ -28,7 +17,6 @@ lib.recurseIntoAttrs rec { localFromCabalSdist = haskellPackages.buildFromCabalSdist localRaw; - # NOTE: ./local refers to the "./." path in `./local/generated.nix`. # 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, # 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; } '' - grep ${src} $drvPath >/dev/null + grep ${localRaw.src} $drvPath >/dev/null touch $out ''; @@ -49,7 +37,7 @@ lib.recurseIntoAttrs rec { drvPath = builtins.unsafeDiscardOutputDependency localFromCabalSdist.drvPath; } '' - grep -v ${src} $drvPath >/dev/null + grep -v ${localRaw.src} $drvPath >/dev/null touch $out ''; } diff --git a/pkgs/test/haskell/cabalSdist/local/generated.nix b/pkgs/test/haskell/cabalSdist/generated.nix similarity index 55% rename from pkgs/test/haskell/cabalSdist/local/generated.nix rename to pkgs/test/haskell/cabalSdist/generated.nix index f0f52a03e0d038..6e09a86a94d382 100644 --- a/pkgs/test/haskell/cabalSdist/local/generated.nix +++ b/pkgs/test/haskell/cabalSdist/generated.nix @@ -1,16 +1,13 @@ -# nix run ../../../../..#cabal2nix -- ./. -{ - mkDerivation, - base, - lib, -}: +# nix run ../../../../..#cabal2nix -- ./local +{ mkDerivation, base, lib }: mkDerivation { pname = "local"; version = "0.1.0.0"; - src = ./.; # also referred to as ./local in the test; these are the same path constants + src = ./local; isLibrary = false; isExecutable = true; executableHaskellDepends = [ base ]; description = "Nixpkgs test case"; license = lib.licenses.mit; + mainProgram = "local"; }