Skip to content

Add another example for hanging compilation #374

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 1 commit into from
Apr 1, 2025
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
18 changes: 18 additions & 0 deletions guide/src/examples/slow.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,21 @@ cargo-bisect-rustc --start=2021-09-01 --end=2021-10-02 --timeout 30 -- build --r
You may need to adjust the timeout value based on the speed of your system.

> **Note**: `--timeout` is currently not working on macOS. See <https://github.com/rust-lang/cargo-bisect-rustc/issues/232>.

In some cases bisecting if a timeout happens is not enough, there might also be a compilation error (see for example [rustc#139197](https://github.com/rust-lang/rust/issues/139197)). In this case the script should handle all the work, here's a Bash example (given `main.rs` is the Rust code to reproduce the hanging compilation):
```sh
#!/bin/bash
res=$( timeout 3 rustc main.rs )
if [ "$?" -eq 124 ]; then
# Excessive compile time
exit 1
else
# Compilation fails as expected *but* it doesn't hang
exit 0
fi
```

and then run (example):
```sh
cargo-bisect-rustc [...params...] --script test.sh
```
Loading