Skip to content

Force a clean build on CI #1656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 10, 2019
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