Skip to content

Commit

Permalink
rustPlatform.fetchCargoTarball: fail on git dependencies
Browse files Browse the repository at this point in the history
The reason is that we can not expect the extended logic run on git
dependencies starting from Cargo 1.68 to be reproducible in future
 versions, and thus the output hash would not be sufficiently stable.
rust-lang/cargo#11414
  • Loading branch information
yu-re-ka committed Mar 26, 2023
1 parent 34aef86 commit 4329de1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/build-support/rust/fetch-cargo-tarball/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4329de1

Please sign in to comment.