Skip to content

Commit

Permalink
Rollup merge of #85977 - ehuss:linkcheck-nightly, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Fix linkcheck script from getting out of sync.

When there are changes to the linkcheck script, the CI jobs used in the books would download the latest version on master, but run it against nightly. During that 24 hour window, the CI can fail if the script has changes that are incompatible with the last nightly. This fixes it so that it downloads the linkchecker that matches the version of nightly.

This also includes a fix to build with release to make it run much faster (I forgot to add this in #85652).
  • Loading branch information
JohnTitor committed Jun 4, 2021
2 parents 0a12431 + 095f09a commit edb8f65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tools/linkchecker/linkcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ fi
if [ ! -e "linkchecker/main.rs" ] || [ "$iterative" = "0" ]
then
echo "Downloading linkchecker source..."
nightly_hash=$(rustc +nightly -Vv | grep commit-hash | cut -f2 -d" ")
url="https://raw.githubusercontent.com/rust-lang/rust"
mkdir linkchecker
curl -o linkchecker/Cargo.toml \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/Cargo.toml
curl -o linkchecker/main.rs \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/main.rs
curl -o linkchecker/Cargo.toml ${url}/${nightly_hash}/src/tools/linkchecker/Cargo.toml
curl -o linkchecker/main.rs ${url}/${nightly_hash}/src/tools/linkchecker/main.rs
fi

echo "Building book \"$book_name\"..."
Expand All @@ -106,7 +106,7 @@ else
check_path="linkcheck/$book_name"
fi
echo "Running linkchecker on \"$check_path\"..."
cargo run --manifest-path=linkchecker/Cargo.toml -- "$check_path"
cargo run --release --manifest-path=linkchecker/Cargo.toml -- "$check_path"

if [ "$iterative" = "0" ]
then
Expand Down

0 comments on commit edb8f65

Please sign in to comment.