nix-prefetch-scripts: just don't depend on Nix (#395147)

This commit is contained in:
K900
2025-04-02 12:08:35 +03:00
committed by GitHub
8 changed files with 14 additions and 40 deletions
@@ -55,7 +55,6 @@ let
rustPlatform.fetchCargoVendor {
inherit src;
name = "mercurial-${version}";
allowGitDependencies = false;
hash = "sha256-k/K1BupCqnlB++2T7hJxu82yID0jG8HwLNmb2eyx29o=";
sourceRoot = "mercurial-${version}/rust";
}
+7 -12
View File
@@ -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
+2 -5
View File
@@ -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 ];
@@ -21,7 +21,6 @@ let
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
allowGitDependencies = false;
hash = "sha256-oTPGmoGlNfPVZ6qha/oXyPJp94fT2cNlVggbIGHf2bc=";
};
@@ -224,7 +224,6 @@ let
rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.pname}-${version}/${finalAttrs.cargoRoot}";
allowGitDependencies = false;
hash =
assert cargoHash != null;
cargoHash;
@@ -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=";
};
@@ -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
];
+2 -5
View File
@@ -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 ];