Skip to content

Commit 92b210c

Browse files
committed
Pin compiler_builtins to 0.1.109 when building std
See rust-lang/compiler-builtins#610
1 parent 00b6a5e commit 92b210c

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "compiler-builtins-dummy"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
compiler_builtins = "=0.1.109"

deterministic-build-wrappers/compiler-builtins-dummy/src/lib.rs

Whitespace-only changes.

genbindings.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,19 +376,27 @@ function REALLY_PIN_CC {
376376
cargo update -p cc --precise "1.0.79" --verbose
377377
( 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
378378
( 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+
pushd ../deterministic-build-wrappers/compiler-builtins-dummy
380+
cargo build > /dev/null 2>&1 || echo -n
381+
popd
379382
# Sadly, std also depends on cc, and we can't pin it in that tree
380383
# directly. Instead, we have to delete the file out of the cargo
381384
# registry and build --offline to avoid it using the latest version.
382385
NEW_CC_DEP="$CARGO_HOME"
383386
[ "$NEW_CC_DEP" = "" ] && NEW_CC_DEP="$HOME"
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-*
387+
[ -d "$NEW_CC_DEP/.cargo/registry/cache/"github.com-* ] && CARGO_REGISTRY_CACHE="$(echo "$NEW_CC_DEP/.cargo/registry/cache/"github.com-*)"
388+
[ -d "$NEW_CC_DEP/.cargo/registry/cache/"index.crates.io-* ] && CARGO_REGISTRY_CACHE="$(echo "$NEW_CC_DEP/.cargo/registry/cache/"index.crates.io-*)"
386389
if [ -d "$CARGO_REGISTRY_CACHE" ]; then
390+
if [ -f "$CARGO_REGISTRY_CACHE/compiler_builtins-0.1.109.crate" ]; then
391+
mv "$CARGO_REGISTRY_CACHE/compiler_builtins-0.1.109.crate" ./
392+
fi
387393
if [ -f "$CARGO_REGISTRY_CACHE/cc-1.0.79.crate" ]; then
388394
mv "$CARGO_REGISTRY_CACHE/cc-1.0.79.crate" ./
389395
fi
390396
rm -f "$CARGO_REGISTRY_CACHE/"*/cc-*.crate
391397
[ -f ./cc-1.0.79.crate ] && mv ./cc-1.0.79.crate "$CARGO_REGISTRY_CACHE/"
398+
rm -f "$CARGO_REGISTRY_CACHE/"*/compiler_builtins-*.crate
399+
[ -f ./compiler_builtins-0.1.109.crate ] && mv ./compiler_builtins-0.1.109.crate "$CARGO_REGISTRY_CACHE/"
392400
else
393401
echo "Couldn't find cargo cache, build-std builds are likely to fail!"
394402
fi

0 commit comments

Comments
 (0)