Skip to content

Commit

Permalink
fetchCargoTarball: fail on git dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-re-ka committed Mar 17, 2023
1 parent 72c9cbe commit 0319ecc
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 --pcre2 '^source = "(?!registry)' Cargo.toml; 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 0319ecc

Please sign in to comment.