+function REALLY_PIN_CC {
+ # -Zbuild-std fails if we have any dependencies of build-deps, which
+ # cc added in 1.0.80, thus we pin back to 1.0.79 to avoid that.
+ cargo update -p cc --precise "1.0.79" --verbose
+ ( cargo build --features=std -v --release -Zbuild-std=std,panic_abort > /dev/null 2>&1 ) || echo -n
+ ( cargo build --features=std -v --release --target aarch64-apple-darwin -Zbuild-std=std,panic_abort > /dev/null 2>&1 ) || echo -n
+ # Sadly, std also depends on cc, and we can't pin it in that tree
+ # directly. Instead, we have to delete the file out of the cargo
+ # registry and build --offline to avoid it using the latest version.
+ NEW_CC_DEP="$CARGO_HOME"
+ [ "$NEW_CC_DEP" = "" ] && NEW_CC_DEP="$HOME"
+ if [ -f "$NEW_CC_DEP/.cargo/registry/cache/github.com-"*/cc-1.0.79.crate ]; then
+ mv "$NEW_CC_DEP/.cargo/registry/cache/github.com-"*/cc-1.0.79.crate ./
+ fi
+ rm -f "$NEW_CC_DEP/.cargo/registry/cache/github.com-"*/cc-*.crate
+ [ -f ./cc-1.0.79.crate ] && mv ./cc-1.0.79.crate "$NEW_CC_DEP/.cargo/registry/cache/github.com-"*/
+}
+