diff --git a/lib/buildWithCargo.nix b/lib/buildWithCargo.nix index 3e65f1c..63d58dd 100644 --- a/lib/buildWithCargo.nix +++ b/lib/buildWithCargo.nix @@ -39,7 +39,7 @@ let cargoLock = path + /Cargo.lock; in if builtins.pathExists cargoToml && builtins.pathExists cargoLock - then (buildDepsOnly args).target + then buildDepsOnly args else throw '' unable to find Cargo.toml and Cargo.lock at ${path}. please ensure one of the following: @@ -68,7 +68,6 @@ in # as including them will make Nix pull in all sources when installing any binaries. , doRemapSourcePathPrefix ? true , nativeBuildInputs ? [ ] -, outputs ? [ "out" ] , ... }@args: let @@ -93,8 +92,6 @@ let }; additions = { - outputs = outputs ++ lib.optional doCopyTargetToOutput "target"; - nativeBuildInputs = nativeBuildInputs ++ [ cargo configureCargoCommonVarsHook diff --git a/pkgs/copyCargoTargetToOutputHook.sh b/pkgs/copyCargoTargetToOutputHook.sh index e6a8a9b..2f14108 100644 --- a/pkgs/copyCargoTargetToOutputHook.sh +++ b/pkgs/copyCargoTargetToOutputHook.sh @@ -1,7 +1,7 @@ prepareCargoTargetDirAndCopyToDir() { # Allow for calling with customized parameters # or fall back to defaults if none are provided - local dir="${1:-${target}}" + local dir="${1:-${out}}" local cargoTargetDir="${2:-${CARGO_TARGET_DIR:-target}}" local dest="${dir}/target.tar.zst" diff --git a/tests/compilesFresh.nix b/tests/compilesFresh.nix index eb23232..9735f91 100644 --- a/tests/compilesFresh.nix +++ b/tests/compilesFresh.nix @@ -25,7 +25,7 @@ buildWithCargo { # NB: explicit call here so that the buildDepsOnly call # doesn't inherit our build commands - cargoArtifacts = (buildDepsOnly { inherit src; }).target; + cargoArtifacts = buildDepsOnly { inherit src; }; nativeBuildInputs = [ jq ];