From a05531fe002d9188c14e62dde3c2e66a3c86b979 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Sun, 2 Apr 2023 12:28:59 +0200 Subject: [PATCH] build-style/cargo: use env var to select sparse index mode --- common/build-style/cargo.sh | 6 +++--- common/environment/build-style/cargo.sh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/build-style/cargo.sh b/common/build-style/cargo.sh index 9f30a1e5c2d521..387e711060bc82 100644 --- a/common/build-style/cargo.sh +++ b/common/build-style/cargo.sh @@ -5,13 +5,13 @@ do_build() { : ${make_cmd:=cargo auditable} - ${make_cmd} --config 'registries.crates-io.protocol="sparse"' build --release --target ${RUST_TARGET} ${configure_args} + ${make_cmd} build --release --target ${RUST_TARGET} ${configure_args} } do_check() { : ${make_cmd:=cargo auditable} - ${make_check_pre} ${make_cmd} --config 'registries.crates-io.protocol="sparse"' test --release --target ${RUST_TARGET} ${configure_args} \ + ${make_check_pre} ${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \ ${make_check_args} } @@ -19,7 +19,7 @@ do_install() { : ${make_cmd:=cargo auditable} : ${make_install_args:=--path .} - ${make_cmd} --config 'registries.crates-io.protocol="sparse"' install --target ${RUST_TARGET} --root="${DESTDIR}/usr" \ + ${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" \ --offline --locked ${configure_args} ${make_install_args} rm -f "${DESTDIR}"/usr/.crates.toml diff --git a/common/environment/build-style/cargo.sh b/common/environment/build-style/cargo.sh index 473750c7a359ea..bc836b06cf066e 100644 --- a/common/environment/build-style/cargo.sh +++ b/common/environment/build-style/cargo.sh @@ -8,4 +8,6 @@ if [ "$CROSS_BUILD" ]; then makedepends+=" rust-std" fi +export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + build_helper+=" rust"