Skip to content
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

make compiletest aware whether compiler was built with debug assertions #123987

Closed
matthiaskrgr opened this issue Apr 15, 2024 · 3 comments · Fixed by #131913
Closed

make compiletest aware whether compiler was built with debug assertions #123987

matthiaskrgr opened this issue Apr 15, 2024 · 3 comments · Fixed by #131913
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@matthiaskrgr
Copy link
Member

I would like to be able to add tests of the form:
"rustc must crash on this file, but only if the compiler was built with debug assertions, otherwise the test shall be ignored (since it wont crash)"

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 15, 2024
@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 15, 2024
@jieyouxu jieyouxu added the A-compiletest Area: The compiletest test runner label May 29, 2024
@jieyouxu jieyouxu moved this from Needs Triage / Backlog to Ready in compiletest maintenance and improvements Jun 9, 2024
@jieyouxu
Copy link
Member

@jieyouxu jieyouxu added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 17, 2024
@matthiaskrgr
Copy link
Member Author

error: detected unknown compiletest test directive `only-debug` in /home/matthias/vcs/github/rust/tests/crashes/1234.rs:2
errors encountered during EarlyProps parsing: /home/matthias/vcs/github/rust/tests/crashes/1234.rs
thread 'main' panicked at src/tools/compiletest/src/header.rs:68:13:
errors encountered during EarlyProps parsing

¯\_(ツ)_/¯

@jieyouxu
Copy link
Member

Okay I see, historically there was a // only-debug, but it was never actually used in the test suite, it it's absent from the command-list allowlist. It also doesn't do what you want because that's conditional on std debug assertions.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Nov 7, 2024
…onur-ozkan

Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support

Add `{ignore,needs}-{rustc,std}-debug-assertions` compiletest directives and retire the old `{ignore,only}-debug` directives. The old `{ignore,only}-debug` directives were ambiguous because you could have std built with debug assertions but rustc not built with debug assertions or vice versa. If we want to support the use case of controlling test run based on if rustc was built with debug assertions, then having `{ignore,only}-debug` will be very confusing.

cc `@matthiaskrgr`

Closes rust-lang#123987.

r? bootstrap (or compiler tbh)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Nov 7, 2024
…onur-ozkan

Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support

Add `{ignore,needs}-{rustc,std}-debug-assertions` compiletest directives and retire the old `{ignore,only}-debug` directives. The old `{ignore,only}-debug` directives were ambiguous because you could have std built with debug assertions but rustc not built with debug assertions or vice versa. If we want to support the use case of controlling test run based on if rustc was built with debug assertions, then having `{ignore,only}-debug` will be very confusing.

cc ``@matthiaskrgr``

Closes rust-lang#123987.

r? bootstrap (or compiler tbh)
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Nov 8, 2024
…onur-ozkan

Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support

Add `{ignore,needs}-{rustc,std}-debug-assertions` compiletest directives and retire the old `{ignore,only}-debug` directives. The old `{ignore,only}-debug` directives were ambiguous because you could have std built with debug assertions but rustc not built with debug assertions or vice versa. If we want to support the use case of controlling test run based on if rustc was built with debug assertions, then having `{ignore,only}-debug` will be very confusing.

cc ```@matthiaskrgr```

Closes rust-lang#123987.

r? bootstrap (or compiler tbh)
@bors bors closed this as completed in 93e9ec0 Nov 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 8, 2024
Rollup merge of rust-lang#131913 - jieyouxu:only_debug_assertions, r=onur-ozkan

Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support

Add `{ignore,needs}-{rustc,std}-debug-assertions` compiletest directives and retire the old `{ignore,only}-debug` directives. The old `{ignore,only}-debug` directives were ambiguous because you could have std built with debug assertions but rustc not built with debug assertions or vice versa. If we want to support the use case of controlling test run based on if rustc was built with debug assertions, then having `{ignore,only}-debug` will be very confusing.

cc ````@matthiaskrgr````

Closes rust-lang#123987.

r? bootstrap (or compiler tbh)
mati865 pushed a commit to mati865/rust that referenced this issue Nov 12, 2024
…onur-ozkan

Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support

Add `{ignore,needs}-{rustc,std}-debug-assertions` compiletest directives and retire the old `{ignore,only}-debug` directives. The old `{ignore,only}-debug` directives were ambiguous because you could have std built with debug assertions but rustc not built with debug assertions or vice versa. If we want to support the use case of controlling test run based on if rustc was built with debug assertions, then having `{ignore,only}-debug` will be very confusing.

cc ````@matthiaskrgr````

Closes rust-lang#123987.

r? bootstrap (or compiler tbh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Development

Successfully merging a pull request may close this issue.

3 participants