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

compiletest: Deny usage of special FileCheck suffixes as revision names #134925

Merged

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Dec 30, 2024

Adds a check that ensures special FileCheck suffixes are not used as revision names.

Fix #130982

@rustbot
Copy link
Collaborator

rustbot commented Dec 30, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 30, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 30, 2024

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@DavisRayM DavisRayM force-pushed the 130982-deny-special-filecheck-prefixes branch from 45542b6 to 0117c97 Compare December 30, 2024 16:35
@DavisRayM DavisRayM force-pushed the 130982-deny-special-filecheck-prefixes branch from 0117c97 to 891041f Compare December 30, 2024 16:49
@DavisRayM DavisRayM changed the title deny usage of FileCheck prefixes as revision names deny usage of special FileCheck prefixes as revision names Dec 30, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I left some initial feedback.

@@ -553,6 +553,21 @@ fn test_duplicate_revisions() {
parse_rs(&config, "//@ revisions: rpass1 rpass1");
}

#[test]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: just #[should_panic] here instead of trying to catch the panic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in the latest commit. I had to select a specific revision name for this CHECK, I'm not currently aware of a way to test all of them without manually catching the panic... Any tips on this will be greatly appreciated

Copy link
Member

@jieyouxu jieyouxu Jan 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the long run compiletest shouldn't be using randomly placed panics as an error handling strategy (really, the lack thereof), but in the short run this is reasonable.

I think it's a reasonable compromise for the time being.

@jieyouxu jieyouxu added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 30, 2024
@jieyouxu
Copy link
Member

r? jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned oli-obk Dec 30, 2024
@jieyouxu
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 30, 2024
@DavisRayM DavisRayM force-pushed the 130982-deny-special-filecheck-prefixes branch from 2103a5a to 4a5e76a Compare January 3, 2025 02:41
@DavisRayM
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 3, 2025
@DavisRayM DavisRayM requested a review from jieyouxu January 4, 2025 04:35
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jieyouxu
Copy link
Member

jieyouxu commented Jan 4, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 4, 2025

📌 Commit 4a5e76a has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 4, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 5, 2025
…kingjubilee

Rollup of 4 pull requests

Successful merges:

 - rust-lang#134925 (deny usage of special FileCheck prefixes as revision names)
 - rust-lang#134996 (Add UWP (msvc) target support page)
 - rust-lang#135104 (do not in-place-iterate over flatmap/flatten)
 - rust-lang#135110 (library: fix adler{ -> 2}.debug)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 78e681a into rust-lang:master Jan 5, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 5, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 5, 2025
Rollup merge of rust-lang#134925 - DavisRayM:130982-deny-special-filecheck-prefixes, r=jieyouxu

deny usage of special FileCheck prefixes as revision names

Adds a check that ensures special FileCheck prefixes are not used as revision names.

Fix rust-lang#130982
@bors
Copy link
Collaborator

bors commented Jan 5, 2025

⌛ Testing commit 4a5e76a with merge 8417f83...

@jieyouxu
Copy link
Member

jieyouxu commented Jan 9, 2025

@bors retry r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 9, 2025
@jieyouxu jieyouxu added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 9, 2025
@jieyouxu jieyouxu changed the title deny usage of special FileCheck prefixes as revision names compiletest: Deny usage of special FileCheck suffixes as revision names Jan 10, 2025
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 merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deny special FileCheck suffixes being used as revision names.
5 participants