Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions script/ci/cargo-clean-on-new-rustc-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
set -e

manual_stamp_file=target/ci_manual_stamp
manual_stamp=0 # Change this to force a clean build on CI
manual_stamp=1 # Change this to force a clean build on CI

if [ -f $manual_stamp_file ]; then
if echo "$manual_stamp" | cmp -s $manual_stamp_file -; then
: # Do nothing, fall through to version check below
else
echo "A clean build has been requested, running cargo clean"
cargo clean
# The target/ directory is now gone, and the messages below will not be printed
fi
else
echo "Existing stamp not found, running cargo clean"
cargo clean
fi

# If `cargo clean` was run above, then the target/ directory is now
# gone and the messages below will not be printed

stamp_file=target/rustc_version_stamp
current_version=$(rustc --version)

Expand Down