Unverified Commit ff44cd76 authored by adisbladis's avatar adisbladis Committed by GitHub
Browse files

rustPlatform.fetchCargoVendor: Don't recompute internal data (#503609)

parents fdca1aec 9e00f0c8
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -22,6 +22,21 @@ let
    ];
  } (builtins.readFile ./replace-workspace-values.py);

  nix-prefetch-git' = nix-prefetch-git.override {
    git = gitMinimal;
    # 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
    git-lfs = null;
  };

  removedArgs = [
    "name"
    "pname"
    "version"
    "nativeBuildInputs"
    "hash"
  ];

  mkFetchCargoVendorUtil =
    name: src:
    writers.writePython3Bin name {
@@ -57,14 +72,6 @@ in
# TODO: add asserts about pname version and name

let
  removedArgs = [
    "name"
    "pname"
    "version"
    "nativeBuildInputs"
    "hash"
  ];

  vendorStaging = stdenvNoCC.mkDerivation (
    {
      name = "${name}-vendor-staging";
@@ -74,12 +81,7 @@ let
      nativeBuildInputs = [
        fetchCargoVendorUtilV2
        cacert
        (nix-prefetch-git.override {
          git = gitMinimal;
          # 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
          git-lfs = null;
        })
        nix-prefetch-git'
      ]
      ++ nativeBuildInputs;

@@ -108,7 +110,6 @@ let
    // removeAttrs args removedArgs
  );
in

runCommand "${name}-vendor"
  {
    inherit vendorStaging;