Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 16 additions & 2 deletions .github/workflows/failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,29 @@ jobs:
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
id: tests
run: |
${{ matrix.libgccjit_version.env_extra }} ./y.sh test --release --clean --build-sysroot --test-failing-rustc ${{ matrix.libgccjit_version.extra }} 2>&1 | tee output_log
# Without this, `tee` masks the exit status of `y.sh test`.
set -o pipefail
status=0
${{ matrix.libgccjit_version.env_extra }} ./y.sh test --release --clean --build-sysroot --test-failing-rustc ${{ matrix.libgccjit_version.extra }} 2>&1 | tee output_log || status=$?
# This suite runs the tests known to fail, so only a build system error must fail the job.
if [ "$status" -ne 0 ] && [ "$status" -ne 2 ]; then
exit "$status"
fi
rg --text "test result" output_log >> $GITHUB_STEP_SUMMARY

- name: Run failing ui pattern tests for ICE
# FIXME: re-enable those tests for libgccjit 12.
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
id: ui-tests
run: |
${{ matrix.libgccjit_version.env_extra }} ./y.sh test --release --test-failing-ui-pattern-tests ${{ matrix.libgccjit_version.extra }} 2>&1 | tee output_log_ui
# Without this, `tee` masks the exit status of `y.sh test`.
set -o pipefail
status=0
${{ matrix.libgccjit_version.env_extra }} ./y.sh test --release --test-failing-ui-pattern-tests ${{ matrix.libgccjit_version.extra }} 2>&1 | tee output_log_ui || status=$?
# This suite runs tests that fail, so only a build system error must fail the job here.
if [ "$status" -ne 0 ] && [ "$status" -ne 2 ]; then
exit "$status"
fi
if grep -q "the compiler unexpectedly panicked" output_log_ui; then
echo "Error: 'the compiler unexpectedly panicked' found in output logs. CI Error!!"
exit 1
Expand Down
18 changes: 18 additions & 0 deletions build_system/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu

// Builds libs
let mut rustflags = env.get("RUSTFLAGS").cloned().unwrap_or_default();

// Record the sysroot sources under the path the `rust-src` component uses, which is where
// rustc looks for them to turn a sysroot span into `/rustc/$hash`. Without this, ui tests
// print the build path where they expect `$SRC_DIR`.
let sysroot_source_dir = lib_path.join("rustlib/src/rust/library");
rustflags.push_str(&format!(
" --remap-path-prefix={library_dir}={sysroot_source_dir}",
library_dir = std::path::absolute(&library_dir)
.map_err(|error| format!(
"Failed to get the absolute path of the sysroot sources: {error:?}"
))?
.display(),
sysroot_source_dir = std::path::absolute(&sysroot_source_dir)
.map_err(|error| format!(
"Failed to get the absolute path of the sysroot sources: {error:?}"
))?
.display(),
));
if config.sysroot_panic_abort {
rustflags.push_str(" -Cpanic=abort -Zpanic-abort-tests");
}
Expand Down
5 changes: 4 additions & 1 deletion build_system/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ fn main() {
Command::CheckTodo => todo::run(),
} {
eprintln!("Command failed to run: {e}");
process::exit(1);
// CI needs to tell a build system error apart from the test failures some suites expect.
let exit_code =
if e == test::TESTS_FAILED_ERROR { test::TESTS_FAILED_EXIT_CODE } else { 1 };
process::exit(exit_code);
}
}
Loading
Loading