Repository navigation
Add support for annotate-snippets's no-graphics output format - #165708
Conversation
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
bd12853 to
791e562
Compare
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
I'm leaning towards r+, but am slightly concerned by this new flag option being insta-stable. Could we add a check for -Zunstable-options being present before allowing the output? It could even still allow changing the rendering (even on stable), as long as an error is always emitted complaining that the feature is unstable. That way people can already start using it, while giving no stability guarantees because having the flag always enabled would cause it to never permit a compile to succeed.
| @@ -33,6 +33,7 @@ use crate::{ | |||
| /// Describes the way the content of the `rendered` field of the json output is generated | |||
| #[derive(Clone, Copy, Debug, PartialEq, Eq)] | |||
| pub struct HumanReadableErrorType { | |||
There was a problem hiding this comment.
Non-blocker. We should be moving towards an enum, I think.
There was a problem hiding this comment.
I agree that we should move to an enum, and I tried to do so, but I ran into issues discerning what should be variants vs. options e.g., is short its own rendering format (variant), or is it an option on graphics/no-graphics?
There was a problem hiding this comment.
I think that (at least eventually) we likely want to fully enumerate all of the cases (so short would be its own thing). The only one that is orthogonal is color, IMO. To be clear, I don't mind not doing that in this PR!
| //! Check that compile errors are formatted in the "no-graphics" style | ||
| //! when `--error-format=human-no-graphics` is used. | ||
| //@ compile-flags: --error-format=human-no-graphics |
There was a problem hiding this comment.
Is there no gate for -Znightly-features for --error-format=human-no-graphics, or for that matter the previously existing --error-format=human-unicode? I thought we hadn't stabilized that last one yet (but I can see on stable rustc that it works).
The only reason I am concerned about it is that I might want to have a round of discussion on what the flag name should be long term. I am personally biased towards this new mode being called --error-format=text-only or --error-format=no-graphics.
There was a problem hiding this comment.
Is there no gate for
-Znightly-featuresfor--error-format=human-no-graphics, or for that matter the previously existing--error-format=human-unicode?
-Zunstable-options isn't required in UI tests since RUSTC_BOOTSTRAP=1 is set for all UI tests. The docs I linked to say that act-as-stable can be used in UI tests to verify stable-only behavior; I can add a test that uses it if you want.
I thought we hadn't stabilized that last one yet (but I can see on stable rustc that it works).
Maybe I did something wrong, but using --error-format=human-unicode on +stable gives me an error, but not on nightly:
❯ echo 'fn main(){let x;}' | rustc +stable - --error-format=human-unicode
error: `--error-format=human-unicode` is unstable❯ echo 'fn main(){let x;}' | rustc +nightly - --error-format=human-unicode
error[E0282]: type annotations needed
╭▸ <anon>:1:15
│
1 │ fn main(){let x;}
│ ━
╰╴
help: consider giving `x` an explicit type
╭╴
1 │ fn main(){let x: /* Type */;}
╰╴ ++++++++++++
error: aborting due to 1 previous errorThe only reason I am concerned about it is that I might want to have a round of discussion on what the flag name should be long term. I am personally biased towards this new mode being called
--error-format=text-onlyor--error-format=no-graphics.
I personally prefer --error-format=no-graphics and would be happy to switch to it if it seems like the right thing to do. I only went with --error-format=human-no-graphics to match the existing naming convention(s).
There was a problem hiding this comment.
Can we add two more svg tests showing the interaction of color and no-color with the new diagnostic render?
There was a problem hiding this comment.
I can add an SVG test for color, but no-color always uses .stderr, as far as I can tell. The only way I could find to get no-color to use an SVG was to also enable -Zterminal-urls=yes.
There was a problem hiding this comment.
I added a test that shows color (svg), no-color (stderr), and terminal-urls (SVG, with color). Let me know if they are what you were looking for
791e562 to
c34bdf9
Compare
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
…tebank Add support for `annotate-snippets`'s `no-graphics` output format Tracking Issue: rust-lang#165164 MCP: rust-lang/compiler-team#1045 This PR adds the initial support for `annotate-snippets`'s [`no-graphics` output format](https://docs.rs/annotate-snippets/latest/annotate_snippets/struct.Renderer.html#method.no_graphics). The `no-graphics` output format doesn't show source snippets or use any graphical decorations and is primarily designed for Text-To-Speech and Braille displays. The goal at this time is to get `no-graphics` in front of users so we can iterate on and improve the output. --- 🤖 LLM involvement: I used an LLM to review the commits before submitting r? @estebank
…tebank Add support for `annotate-snippets`'s `no-graphics` output format Tracking Issue: rust-lang#165164 MCP: rust-lang/compiler-team#1045 This PR adds the initial support for `annotate-snippets`'s [`no-graphics` output format](https://docs.rs/annotate-snippets/latest/annotate_snippets/struct.Renderer.html#method.no_graphics). The `no-graphics` output format doesn't show source snippets or use any graphical decorations and is primarily designed for Text-To-Speech and Braille displays. The goal at this time is to get `no-graphics` in front of users so we can iterate on and improve the output. --- 🤖 LLM involvement: I used an LLM to review the commits before submitting r? @estebank
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #165742 (comment) Probably this PR? |
|
This pull request was unapproved. This PR was contained in a rollup (#165742), which was unapproved. |
Add support for `annotate-snippets`'s `no-graphics` output format try-job: test-x86_64-gnu-aux
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 5220576 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
796f4d7 to
36e5310
Compare
|
Some changes occurred in src/tools/compiletest cc @jieyouxu |
|
The failures were caused by two things:
Note: @rustbot ready |
36e5310 to
6a4426f
Compare
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 6b05f82 (parent) -> b4fe65c (this PR) Test differencesShow 16 test diffsStage 1
Stage 2
Additionally, 4 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard b4fe65c19d1bb6e720c843086b785493c453028d --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (b4fe65c): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -1.4%, secondary 9.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 484.187s -> 482.212s (-0.41%) |
View all comments
Tracking Issue: #165164
MCP: rust-lang/compiler-team#1045
This PR adds the initial support for
annotate-snippets'sno-graphicsoutput format. Theno-graphicsoutput format doesn't show source snippets or use any graphical decorations and is primarily designed for Text-To-Speech and Braille displays. The goal at this time is to getno-graphicsin front of users so we can iterate on and improve the output.🤖 LLM involvement: I used an LLM to review the commits before submitting
r? @estebank