Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6678349

Browse files
authoredJun 3, 2021
Rollup merge of #85977 - ehuss:linkcheck-nightly, r=Mark-Simulacrum
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).
2 parents 26cf10e + 095f09a commit 6678349

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/tools/linkchecker/linkcheck.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ fi
8585
if [ ! -e "linkchecker/main.rs" ] || [ "$iterative" = "0" ]
8686
then
8787
echo "Downloading linkchecker source..."
88+
nightly_hash=$(rustc +nightly -Vv | grep commit-hash | cut -f2 -d" ")
89+
url="https://raw.githubusercontent.com/rust-lang/rust"
8890
mkdir linkchecker
89-
curl -o linkchecker/Cargo.toml \
90-
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/Cargo.toml
91-
curl -o linkchecker/main.rs \
92-
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/main.rs
91+
curl -o linkchecker/Cargo.toml ${url}/${nightly_hash}/src/tools/linkchecker/Cargo.toml
92+
curl -o linkchecker/main.rs ${url}/${nightly_hash}/src/tools/linkchecker/main.rs
9393
fi
9494

9595
echo "Building book \"$book_name\"..."
@@ -106,7 +106,7 @@ else
106106
check_path="linkcheck/$book_name"
107107
fi
108108
echo "Running linkchecker on \"$check_path\"..."
109-
cargo run --manifest-path=linkchecker/Cargo.toml -- "$check_path"
109+
cargo run --release --manifest-path=linkchecker/Cargo.toml -- "$check_path"
110110

111111
if [ "$iterative" = "0" ]
112112
then

0 commit comments

Comments
 (0)
Please sign in to comment.