-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix handling of --output-format json
flag
#82497
Conversation
This comment has been minimized.
This comment has been minimized.
This can probably be simplified now too: |
28881b3
to
a4a9a84
Compare
This is the sort of thing that makes me wish we had a way to test channel differences :/ |
This comment has been minimized.
This comment has been minimized.
I think I'll wait to fix the test errors until I hear from @Mark-Simulacrum about whether it's ok to remove |
I'm guessing things will need manual application of unstable-options, but that seems good. I'm not sure I understand the -Zmiri claim - -Z flags shouldn't also need unstable options passed I think? But change seems fine to me, presuming you do the legwork to get CI to like it. |
Hmm, that sounds reasonable, but I can't imagine any other reason the flag would have been added. I don't think it's super important to know, though. |
src/bootstrap/test.rs
Outdated
@@ -1131,7 +1131,6 @@ note: if you're sure you want to do this, please open an issue as to why. In the | |||
} | |||
} | |||
flags.push(format!("-Cdebuginfo={}", builder.config.rust_debuginfo_level_tests)); | |||
flags.push("-Zunstable-options".to_string()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this changed? It seems like the most likely candidate for the CI failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the PR description:
To get the test working I had to remove -Z unstable-options, which x.py passed to compiletest unconditionally. It was first added in 8c2ec68 so -Z miri would be allowed. -Z miri is no longer passed unconditionally, so hopefully removing it won't break anything.
That caused a lot more breakage than I expected so I might remove the test for now :/ or wait to merge this until I can make a separate PR removing unstable-options
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That caused a lot more breakage than I expected so I might remove the test for now :/ or wait to merge this until I can make a separate PR removing unstable-options.
I removed the test for now.
Other than CI failing and linking to the tracking issue, this looks good to me. However I dont have r+ rights, so you'll need someone else to review and approve it. |
This comment has been minimized.
This comment has been minimized.
6121f2d
to
477aaeb
Compare
@aDotInTheVoid are you comfortable with landing this without a test for missing |
Oh err I think they said they're busy with school since a few days ago. r? @CraftSpider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a question on one thing. I would feel a little more comfortable with a test, but don't think it's completely necessary.
@@ -0,0 +1,2 @@ | |||
error: the -Z unstable-options flag must be passed to enable --output-format for documentation generation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be an expected output without the associated test, I'm guessing the one you removed due to issues. should the expected output also get removed, as I don't think this actually does anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, good catch. I removed it and added a run-make test :)
- Don't treat it as deprecated on stable and beta channels. Before, it would give confusing and incorrect output: ``` warning: the 'output-format' flag is considered deprecated | = warning: see issue rust-lang#44136 <rust-lang#44136> for more information error: json output format isn't supported for doc generation ``` Both of those are wrong: output-format isn't deprecated, and json output is supported. - Require -Z unstable-options for `--output-format json` Previously, it was allowed by default on nightly, which made it hard to realize the flag wouldn't be accepted on beta or stable. Note that this still allows `--output-format html`, which has been stable since 1.0. - Remove unnecessary double-checking of the feature gate when parsing the output format - Add custom run-make test since compiletest passes -Zunstable-options by default
@bors r+ |
📌 Commit ffd7094 has been approved by |
Fix handling of `--output-format json` flag - Don't treat it as deprecated on stable and beta channels. Before, it would give confusing and incorrect output: ``` warning: the 'output-format' flag is considered deprecated | = warning: see issue rust-lang#44136 <rust-lang#44136> for more information error: json output format isn't supported for doc generation ``` Both of those are wrong: output-format isn't deprecated, and json output is supported. - Require -Z unstable-options for `--output-format json` Previously, it was allowed by default on nightly, which made it hard to realize the flag wouldn't be accepted on beta or stable. To get the test working I had to remove `-Z unstable-options`, which x.py passed to compiletest unconditionally. It was first added in rust-lang@8c2ec68 so `-Z miri` would be allowed. -Z miri is no longer passed unconditionally, so hopefully removing it won't break anything. r? `@aDotInTheVoid` cc `@HeroicKatora` `@CraftSpider` Thanks to `@memoryruins` for pointing it out on Discord! cc `@Mark-Simulacrum` for the change to compiletest.
Fix handling of `--output-format json` flag - Don't treat it as deprecated on stable and beta channels. Before, it would give confusing and incorrect output: ``` warning: the 'output-format' flag is considered deprecated | = warning: see issue rust-lang#44136 <rust-lang#44136> for more information error: json output format isn't supported for doc generation ``` Both of those are wrong: output-format isn't deprecated, and json output is supported. - Require -Z unstable-options for `--output-format json` Previously, it was allowed by default on nightly, which made it hard to realize the flag wouldn't be accepted on beta or stable. To get the test working I had to remove `-Z unstable-options`, which x.py passed to compiletest unconditionally. It was first added in rust-lang@8c2ec68 so `-Z miri` would be allowed. -Z miri is no longer passed unconditionally, so hopefully removing it won't break anything. r? ``@aDotInTheVoid`` cc ``@HeroicKatora`` ``@CraftSpider`` Thanks to ``@memoryruins`` for pointing it out on Discord! cc ``@Mark-Simulacrum`` for the change to compiletest.
Rollup of 5 pull requests Successful merges: - rust-lang#82497 (Fix handling of `--output-format json` flag) - rust-lang#83689 (Add more info for common trait resolution and async/await errors) - rust-lang#83952 (Account for `ExprKind::Block` when suggesting .into() and deref) - rust-lang#83965 (Add Debug implementation for hir::intravisit::FnKind) - rust-lang#83974 (Fix outdated crate names in `rustc_interface::callbacks`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Don't treat it as deprecated on stable and beta channels. Before, it
would give confusing and incorrect output:
Both of those are wrong: output-format isn't deprecated, and json
output is supported.
Require -Z unstable-options for
--output-format json
Previously, it was allowed by default on nightly, which made it hard
to realize the flag wouldn't be accepted on beta or stable.
To get the test working I had to remove
-Z unstable-options
, which x.py passed to compiletest unconditionally. It was first added in 8c2ec68 so-Z miri
would be allowed. -Z miri is no longer passed unconditionally, so hopefully removing it won't break anything.r? @aDotInTheVoid cc @HeroicKatora @CraftSpider
Thanks to @memoryruins for pointing it out on Discord!
cc @Mark-Simulacrum for the change to compiletest.