diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index b98fb69b40d9d..5d8d0ecc69356 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -4,7 +4,6 @@ fetchCargoTarball, fetchCargoVendor, stdenv, - callPackage, cargoBuildHook, cargoCheckHook, cargoInstallHook, @@ -24,7 +23,6 @@ lib.extendMkDerivation { excludeDrvArgNames = [ "depsExtraArgs" "cargoUpdateHook" - "cargoDeps" "cargoLock" ]; @@ -74,9 +72,11 @@ lib.extendMkDerivation { ... }@args: - let - - cargoDeps' = + lib.optionalAttrs (stdenv.hostPlatform.isDarwin && buildType == "debug") { + RUSTFLAGS = "-C split-debuginfo=packed " + (args.RUSTFLAGS or ""); + } + // { + cargoDeps = if cargoVendorDir != null then null else if cargoDeps != null then @@ -127,15 +127,6 @@ lib.extendMkDerivation { } // depsExtraArgs ); - - target = stdenv.hostPlatform.rust.rustcTargetSpec; - targetIsJSON = lib.hasSuffix ".json" target; - in - lib.optionalAttrs (stdenv.hostPlatform.isDarwin && buildType == "debug") { - RUSTFLAGS = "-C split-debuginfo=packed " + (args.RUSTFLAGS or ""); - } - // { - cargoDeps = cargoDeps'; inherit buildAndTestSubdir; cargoBuildType = buildType;