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

handle --json-output properly #133875

Merged
merged 2 commits into from
Dec 7, 2024
Merged

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Dec 4, 2024

Because rustfmt doesn't support JSON output, x test --json-output doesn't respect the --json-output flag during formatting step. This change makes that x test skips the formatting step if --json-output is specified. In addition, resolves #133855 with the 2nd commit.

@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2024

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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 4, 2024
@onur-ozkan
Copy link
Member Author

@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 4, 2024
@onur-ozkan onur-ozkan changed the title skip formatting when --json-output is used handle --json-output properly Dec 5, 2024
@onur-ozkan
Copy link
Member 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 Dec 5, 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! I tried this locally and this seems to work properly. You can r=me after the eprintln nit.

src/bootstrap/src/core/build_steps/test.rs Outdated Show resolved Hide resolved
@jieyouxu
Copy link
Member

jieyouxu commented Dec 6, 2024

@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 6, 2024
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the early-return-rustfmt branch from 10f1238 to 31c4057 Compare December 6, 2024 08:24
@onur-ozkan
Copy link
Member Author

@bors r=jieyouxu

@bors
Copy link
Contributor

bors commented Dec 6, 2024

📌 Commit 31c4057 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 6, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#130209 (Stabilize `std::io::ErrorKind::CrossesDevices`)
 - rust-lang#130254 (Stabilize `std::io::ErrorKind::QuotaExceeded`)
 - rust-lang#132187 (Add Extend impls for tuples of arity 1 through 12)
 - rust-lang#133875 (handle `--json-output` properly)
 - rust-lang#133934 (Do not implement unsafe auto traits for types with unsafe fields)
 - rust-lang#133954 (Hide errors whose suggestions would contain error constants or types)
 - rust-lang#133960 (rustdoc: remove eq for clean::Attributes)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#130209 (Stabilize `std::io::ErrorKind::CrossesDevices`)
 - rust-lang#130254 (Stabilize `std::io::ErrorKind::QuotaExceeded`)
 - rust-lang#132187 (Add Extend impls for tuples of arity 1 through 12)
 - rust-lang#133875 (handle `--json-output` properly)
 - rust-lang#133934 (Do not implement unsafe auto traits for types with unsafe fields)
 - rust-lang#133954 (Hide errors whose suggestions would contain error constants or types)
 - rust-lang#133960 (rustdoc: remove eq for clean::Attributes)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#130209 (Stabilize `std::io::ErrorKind::CrossesDevices`)
 - rust-lang#130254 (Stabilize `std::io::ErrorKind::QuotaExceeded`)
 - rust-lang#132187 (Add Extend impls for tuples of arity 1 through 12)
 - rust-lang#133875 (handle `--json-output` properly)
 - rust-lang#133934 (Do not implement unsafe auto traits for types with unsafe fields)
 - rust-lang#133954 (Hide errors whose suggestions would contain error constants or types)
 - rust-lang#133960 (rustdoc: remove eq for clean::Attributes)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8c78d7a into rust-lang:master Dec 7, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 7, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2024
Rollup merge of rust-lang#133875 - onur-ozkan:early-return-rustfmt, r=jieyouxu

handle `--json-output` properly

Because `rustfmt` doesn't support JSON output, `x test --json-output` doesn't respect the `--json-output` flag during formatting step. This change makes that `x test` skips the formatting step if `--json-output` is specified. In addition, resolves rust-lang#133855 with the 2nd commit.
@onur-ozkan onur-ozkan deleted the early-return-rustfmt branch December 9, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

./x.py test doesn't respect --json-output for rustc error messages
4 participants