summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/ci
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /src/tools/rustfmt/ci
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rustfmt/ci')
-rwxr-xr-xsrc/tools/rustfmt/ci/build_and_test.bat6
-rwxr-xr-xsrc/tools/rustfmt/ci/build_and_test.sh6
-rwxr-xr-xsrc/tools/rustfmt/ci/check_diff.sh13
3 files changed, 22 insertions, 3 deletions
diff --git a/src/tools/rustfmt/ci/build_and_test.bat b/src/tools/rustfmt/ci/build_and_test.bat
index 69dae1fff..16608a4aa 100755
--- a/src/tools/rustfmt/ci/build_and_test.bat
+++ b/src/tools/rustfmt/ci/build_and_test.bat
@@ -6,7 +6,11 @@ rustc -Vv || exit /b 1
cargo -V || exit /b 1
:: Build and test main crate
-cargo build --locked || exit /b 1
+if "%CFG_RELEASE_CHANNEL%"=="nightly" (
+ cargo build --locked --all-features || exit /b 1
+) else (
+ cargo build --locked || exit /b 1
+)
cargo test || exit /b 1
:: Build and test other crates
diff --git a/src/tools/rustfmt/ci/build_and_test.sh b/src/tools/rustfmt/ci/build_and_test.sh
index 949918532..207da362f 100755
--- a/src/tools/rustfmt/ci/build_and_test.sh
+++ b/src/tools/rustfmt/ci/build_and_test.sh
@@ -10,7 +10,11 @@ rustc -Vv
cargo -V
# Build and test main crate
-cargo build --locked
+if [ "$CFG_RELEASE_CHANNEL" == "nightly" ]; then
+ cargo build --locked --all-features
+else
+ cargo build --locked
+fi
cargo test
# Build and test other crates
diff --git a/src/tools/rustfmt/ci/check_diff.sh b/src/tools/rustfmt/ci/check_diff.sh
index 062c2dd86..50c58b1f4 100755
--- a/src/tools/rustfmt/ci/check_diff.sh
+++ b/src/tools/rustfmt/ci/check_diff.sh
@@ -1,5 +1,10 @@
#!/bin/bash
+set -e
+
+# https://github.com/rust-lang/rustfmt/issues/5675
+export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib:$LD_LIBRARY_PATH
+
function print_usage() {
echo "usage check_diff REMOTE_REPO FEATURE_BRANCH [COMMIT_HASH] [OPTIONAL_RUSTFMT_CONFIGS]"
}
@@ -110,7 +115,7 @@ function compile_rustfmt() {
git fetch feature $FEATURE_BRANCH
cargo build --release --bin rustfmt && cp target/release/rustfmt $1/rustfmt
- if [ -z "$OPTIONAL_COMMIT_HASH" ]; then
+ if [ -z "$OPTIONAL_COMMIT_HASH" ] || [ "$FEATURE_BRANCH" = "$OPTIONAL_COMMIT_HASH" ]; then
git switch $FEATURE_BRANCH
else
git switch $OPTIONAL_COMMIT_HASH --detach
@@ -140,9 +145,15 @@ function check_repo() {
init_submodules $SUBMODULES
fi
+
+ # rustfmt --check returns 1 if a diff was found
+ # Also check_diff returns 1 if there was a diff between master rustfmt and the feature branch
+ # so we want to ignore the exit status check
+ set +e
check_diff $REPO_NAME
# append the status of running `check_diff` to the STATUSES array
STATUSES+=($?)
+ set -e
echo "removing tmp_dir $tmp_dir"
rm -rf $tmp_dir