@@ -374,18 +374,24 @@ function REALLY_PIN_CC {
374
374
# -Zbuild-std fails if we have any dependencies of build-deps, which
375
375
# cc added in 1.0.80, thus we pin back to 1.0.79 to avoid that.
376
376
cargo update -p cc --precise " 1.0.79" --verbose
377
- ( cargo build --features=std -v --release -Zbuild-std=std,panic_abort > /dev/null 2>&1 ) || echo -n
378
- ( cargo build --features=std -v --release --target aarch64-apple-darwin -Zbuild-std=std,panic_abort > /dev/null 2>&1 ) || echo -n
377
+ ( RUSTC_BOOTSTRAP=1 cargo build --features=std -v --release --target x86_64-apple-darwin -Zbuild-std=std,panic_abort > /dev/null 2>&1 ) || echo -n
378
+ ( RUSTC_BOOTSTRAP=1 cargo build --features=std -v --release --target aarch64-apple-darwin -Zbuild-std=std,panic_abort > /dev/null 2>&1 ) || echo -n
379
379
# Sadly, std also depends on cc, and we can't pin it in that tree
380
380
# directly. Instead, we have to delete the file out of the cargo
381
381
# registry and build --offline to avoid it using the latest version.
382
382
NEW_CC_DEP=" $CARGO_HOME "
383
383
[ " $NEW_CC_DEP " = " " ] && NEW_CC_DEP=" $HOME "
384
- if [ -f " $NEW_CC_DEP /.cargo/registry/cache/github.com-" * /cc-1.0.79.crate ]; then
385
- mv " $NEW_CC_DEP /.cargo/registry/cache/github.com-" * /cc-1.0.79.crate ./
384
+ [ -d " $NEW_CC_DEP /.cargo/registry/cache/" github.com-* ] && CARGO_REGISTRY_CACHE=" $NEW_CC_DEP /.cargo/registry/cache/" github.com-*
385
+ [ -d " $NEW_CC_DEP /.cargo/registry/cache/" index.crates.io-* ] && CARGO_REGISTRY_CACHE=" $NEW_CC_DEP /.cargo/registry/cache/" index.crates.io-*
386
+ if [ -d " $CARGO_REGISTRY_CACHE " ]; then
387
+ if [ -f " $CARGO_REGISTRY_CACHE /cc-1.0.79.crate" ]; then
388
+ mv " $CARGO_REGISTRY_CACHE /cc-1.0.79.crate" ./
389
+ fi
390
+ rm -f " $CARGO_REGISTRY_CACHE /" * /cc-* .crate
391
+ [ -f ./cc-1.0.79.crate ] && mv ./cc-1.0.79.crate " $CARGO_REGISTRY_CACHE /"
392
+ else
393
+ echo " Couldn't find cargo cache, build-std builds are likely to fail!"
386
394
fi
387
- rm -f " $NEW_CC_DEP /.cargo/registry/cache/github.com-" * /cc-* .crate
388
- [ -f ./cc-1.0.79.crate ] && mv ./cc-1.0.79.crate " $NEW_CC_DEP /.cargo/registry/cache/github.com-" * /
389
395
}
390
396
391
397
# Then, check with memory sanitizer, if we're on Linux and have rustc nightly
0 commit comments