diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index dac493910d9a..3b6270bf8c65 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -55,7 +55,6 @@ let rustPlatform.fetchCargoVendor { inherit src; name = "mercurial-${version}"; - allowGitDependencies = false; hash = "sha256-k/K1BupCqnlB++2T7hJxu82yID0jG8HwLNmb2eyx29o="; sourceRoot = "mercurial-${version}/rust"; } diff --git a/pkgs/build-support/rust/fetch-cargo-vendor.nix b/pkgs/build-support/rust/fetch-cargo-vendor.nix index ce015b099382..5f5a16440778 100644 --- a/pkgs/build-support/rust/fetch-cargo-vendor.nix +++ b/pkgs/build-support/rust/fetch-cargo-vendor.nix @@ -35,9 +35,6 @@ in name ? if args ? pname && args ? version then "${args.pname}-${args.version}" else "cargo-deps", hash ? (throw "fetchCargoVendor requires a `hash` value to be set for ${name}"), nativeBuildInputs ? [ ], - # This is mostly for breaking infinite recursion where dependencies - # of nix-prefetch-git use fetchCargoVendor. - allowGitDependencies ? true, ... }@args: @@ -58,15 +55,13 @@ let impureEnvVars = lib.fetchers.proxyImpureEnvVars; - nativeBuildInputs = - [ - fetchCargoVendorUtil - cacert - ] - ++ lib.optionals allowGitDependencies [ - nix-prefetch-git - ] - ++ nativeBuildInputs; + nativeBuildInputs = [ + fetchCargoVendorUtil + cacert + # break loop of nix-prefetch-git -> git-lfs -> asciidoctor -> ruby (yjit) -> fetchCargoVendor -> nix-prefetch-git + # Cargo does not currently handle git-lfs: https://github.com/rust-lang/cargo/issues/9692 + (nix-prefetch-git.override { git-lfs = null; }) + ] ++ nativeBuildInputs; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/md/mdbook/package.nix b/pkgs/by-name/md/mdbook/package.nix index cd6c6ebe79b9..21d3dd72fba7 100644 --- a/pkgs/by-name/md/mdbook/package.nix +++ b/pkgs/by-name/md/mdbook/package.nix @@ -22,11 +22,8 @@ rustPlatform.buildRustPackage rec { hash = "sha256-XTvC2pGRVat0kOybNb9TziG32wDVexnFx2ahmpUFmaA="; }; - cargoDeps = rustPlatform.fetchCargoVendor { - inherit pname version src; - allowGitDependencies = false; - hash = "sha256-ASPRBAB+elJuyXpPQBm3WI97wD3mjoO1hw0fNHc+KAw="; - }; + useFetchCargoVendor = true; + cargoHash = "sha256-ASPRBAB+elJuyXpPQBm3WI97wD3mjoO1hw0fNHc+KAw="; nativeBuildInputs = [ installShellFiles ]; diff --git a/pkgs/development/compilers/rust/cargo-auditable.nix b/pkgs/development/compilers/rust/cargo-auditable.nix index a8cd829c59d0..95143226b041 100644 --- a/pkgs/development/compilers/rust/cargo-auditable.nix +++ b/pkgs/development/compilers/rust/cargo-auditable.nix @@ -21,7 +21,6 @@ let cargoDeps = rustPlatform.fetchCargoVendor { inherit pname version src; - allowGitDependencies = false; hash = "sha256-oTPGmoGlNfPVZ6qha/oXyPJp94fT2cNlVggbIGHf2bc="; }; diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index befb945e1fe4..20aee447d6aa 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -224,7 +224,6 @@ let rustPlatform.fetchCargoVendor { inherit (finalAttrs) src; sourceRoot = "${finalAttrs.pname}-${version}/${finalAttrs.cargoRoot}"; - allowGitDependencies = false; hash = assert cargoHash != null; cargoHash; diff --git a/pkgs/tools/package-management/lix/default.nix b/pkgs/tools/package-management/lix/default.nix index 5c351b2542a2..d6b44473fd9c 100644 --- a/pkgs/tools/package-management/lix/default.nix +++ b/pkgs/tools/package-management/lix/default.nix @@ -89,7 +89,6 @@ lib.makeExtensible (self: { docCargoDeps = rustPlatform.fetchCargoVendor { name = "lix-doc-${version}"; inherit src; - allowGitDependencies = false; sourceRoot = "${src.name or src}/lix-doc"; hash = "sha256-VPcrf78gfLlkTRrcbLkPgLOk0o6lsOJBm6HYLvavpNU="; }; @@ -120,7 +119,6 @@ lib.makeExtensible (self: { docCargoDeps = rustPlatform.fetchCargoVendor { name = "lix-doc-${version}"; inherit src; - allowGitDependencies = false; sourceRoot = "${src.name or src}/lix-doc"; hash = "sha256-U820gvcbQIBaFr2OWPidfFIDXycDFGgXX1NpWDDqENs="; }; diff --git a/pkgs/tools/package-management/nix-prefetch-scripts/default.nix b/pkgs/tools/package-management/nix-prefetch-scripts/default.nix index 059b06362f16..040535f63ed8 100644 --- a/pkgs/tools/package-management/nix-prefetch-scripts/default.nix +++ b/pkgs/tools/package-management/nix-prefetch-scripts/default.nix @@ -13,18 +13,6 @@ git-lfs, gnused, mercurial, - # FIXME: These scripts should not depend on Nix, they should depend on a - # `.nar` hasher compatible with Nix. - # - # The fact that these scripts depend on Nix means that e.g. Chromium depends - # on Nix. - # - # Also should be fixed: - # - prefetch-yarn-deps - # - nurl, nix-init - # - # Gridlock is one such candidate: https://github.com/lf-/gridlock - nixForLinking, subversion, }: @@ -49,7 +37,6 @@ let ++ [ coreutils gnused - nixForLinking ] ) } \ @@ -66,6 +53,9 @@ let }; in rec { + # No explicit dependency on Nix, as these can be used inside builders, + # and thus will cause dependency loops. When used _outside_ builders, + # we expect people to have a Nix implementation available ambiently. nix-prefetch-bzr = mkPrefetchScript "bzr" ../../../build-support/fetchbzr/nix-prefetch-bzr [ breezy ]; diff --git a/pkgs/tools/text/mdbook-linkcheck/default.nix b/pkgs/tools/text/mdbook-linkcheck/default.nix index 3d544fd4068d..474f4f5004c5 100644 --- a/pkgs/tools/text/mdbook-linkcheck/default.nix +++ b/pkgs/tools/text/mdbook-linkcheck/default.nix @@ -21,11 +21,8 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-ZbraChBHuKAcUA62EVHZ1RygIotNEEGv24nhSPAEj00="; }; - cargoDeps = rustPlatform.fetchCargoVendor { - inherit pname version src; - allowGitDependencies = false; - hash = "sha256-Tt7ljjWv2CMtP/ELZNgSH/ifmBk/42+E0r9ZXQEJNP8="; - }; + useFetchCargoVendor = true; + cargoHash = "sha256-Tt7ljjWv2CMtP/ELZNgSH/ifmBk/42+E0r9ZXQEJNP8="; buildInputs = if stdenv.hostPlatform.isDarwin then [ Security ] else [ openssl ];