about summary refs log tree commit diff
path: root/pkgs/build-support/rust
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-03-26 06:01:39 +0000
committerGitHub <noreply@github.com>2023-03-26 06:01:39 +0000
commit72fc224baa1dcccdbd0dc4832b25c0f500038f3d (patch)
tree3f69af62ba32b4842bdceb50b88a66b6e7d480d8 /pkgs/build-support/rust
parent8e40747e62943327c390fb8f7e4a3988d9e6e1cd (diff)
parentff3e86d2b497bb8bf0d07ffe31702a7ce228074d (diff)
Merge staging-next into staging
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r--pkgs/build-support/rust/fetch-cargo-tarball/default.nix11
-rw-r--r--pkgs/build-support/rust/import-cargo-lock.nix3
2 files changed, 13 insertions, 1 deletions
diff --git a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix
index 36ab931697410..adbfe98d81039 100644
--- a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix
+++ b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix
@@ -76,6 +76,17 @@ in stdenv.mkDerivation ({
     # Override the `http.cainfo` option usually specified in `.cargo/config`.
     export CARGO_HTTP_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt
 
+    if grep '^source = "git' Cargo.lock; then
+        echo
+        echo "ERROR: The Cargo.lock contains git dependencies"
+        echo
+        echo "This is currently not supported in the fixed-output derivation fetcher."
+        echo "Use cargoLock.lockFile / importCargoLock instead."
+        echo
+
+        exit 1
+    fi
+
     cargo vendor $name --respect-source-config | cargo-vendor-normalise > $CARGO_CONFIG
 
     # Create an empty vendor directory when there is no dependency to vendor
diff --git a/pkgs/build-support/rust/import-cargo-lock.nix b/pkgs/build-support/rust/import-cargo-lock.nix
index 814035966d2a9..b23bae1090b70 100644
--- a/pkgs/build-support/rust/import-cargo-lock.nix
+++ b/pkgs/build-support/rust/import-cargo-lock.nix
@@ -152,6 +152,7 @@ let
               inherit (gitParts) url;
               rev = gitParts.sha;
               allRefs = true;
+              submodules = true;
             }
           else
             missingHash;
@@ -187,7 +188,7 @@ let
         echo Found crate ${pkg.name} at $crateCargoTOML
         tree=$(dirname $crateCargoTOML)
 
-        cp -prvd "$tree/" $out
+        cp -prvL "$tree/" $out
         chmod u+w $out
 
         if grep -q workspace "$out/Cargo.toml"; then