Skip to content

Add support for annotate-snippets's no-graphics output format - #17735

Merged
epage merged 2 commits into
rust-lang:masterfrom
Muscraft:support-no-graphics
Nov 14, 2026
Merged

epage merged 2 commits into
rust-lang:masterfrom
Muscraft:support-no-graphics

Conversation

@Muscraft

@Muscraft Muscraft commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

View all comments

What does this PR try to resolve?

This PR adds the initial support for annotate-snippets's no-graphics output format. 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. Rust added support for it in rust#165708 and made it in yesterday's nightly.

Notes to reviewers

What might the reviewers need to know about the change and how to review it?
Example: the larger context this fits within
Example: manual testing performed and why it wasn't automated


🤖 LLM involvement: An LLM helped review these changes

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-configuration Area: cargo config files and env vars A-console-output Area: Terminal output, colors, progress bar, etc. A-documenting-cargo-itself Area: Cargo's documentation A-unstable Area: nightly unstable support S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 14, 2026
@rustbot

rustbot commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Muscraft, @epage, @weihanglo
  • @Muscraft, @epage, @weihanglo expanded to Muscraft, epage, weihanglo
  • Random selection from epage, weihanglo

@Muscraft
Muscraft force-pushed the support-no-graphics branch from a167713 to a03e40b Compare November 14, 2026 01:37
@rustbot

This comment has been minimized.

@Muscraft
Muscraft force-pushed the support-no-graphics branch from a03e40b to 873801c Compare November 14, 2026 01:41
let auto_clr = ColorChoice::CargoAuto;
let stdout_choice = auto_clr.to_anstream_color_choice();
let stderr_choice = auto_clr.to_anstream_color_choice();
let no_graphics = std::env::var_os("NO_GRAPHICS").is_some_and(|v| !v.is_empty());

@Muscraft Muscraft Nov 14, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This matches how anstyle-query handles NO_GRAPHICS

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't see NO_GRAPHICS in there

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I meant to say NO_COLOR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I saw that, but I figured it would be better to match anstyle-query since that is where we get our color config from. I also thought it would be a good idea to mirror the "official" advice on NO_COLOR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's leave this as something to resolve pre-stabilization in a tracking issue.

Comment thread crates/cargo-util-config/Cargo.toml Resolved
Comment thread crates/cargo-util-config/src/schema.rs Resolved
let auto_clr = ColorChoice::CargoAuto;
let stdout_choice = auto_clr.to_anstream_color_choice();
let stderr_choice = auto_clr.to_anstream_color_choice();
let no_graphics = std::env::var_os("NO_GRAPHICS").is_some_and(|v| !v.is_empty());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't see NO_GRAPHICS in there

Comment thread crates/cargo-util-terminal/src/shell.rs Resolved
Comment thread doc/book/src/reference/unstable.md Resolved

@weihanglo weihanglo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Other than documenting review comment, this looks fine. Feel free to merge once reviews from others are addressed.

View changes since this review

@Muscraft
Muscraft force-pushed the support-no-graphics branch 3 times, most recently from 8fad62d to b18b76c Compare November 14, 2026 12:34
@rustbot

This comment has been minimized.

@Muscraft
Muscraft force-pushed the support-no-graphics branch from b18b76c to 50db1a5 Compare November 14, 2026 19:21
@rustbot

rustbot commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Comment thread doc/book/src/reference/unstable.md Outdated
### Added to Configuration

- Type: boolean
- Default: true

@epage epage Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we read NO_GRAPHICS, this would be auto-detect

View changes since the review

@Muscraft
Muscraft force-pushed the support-no-graphics branch from 50db1a5 to 2d501ac Compare November 14, 2026 19:30
@epage
epage added this pull request to the merge queue Nov 14, 2026
Merged via the queue into rust-lang:master with commit 930d19d Nov 14, 2026
30 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 14, 2026
@Muscraft
Muscraft deleted the support-no-graphics branch November 15, 2026 00:54
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Nov 16, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Nov 17, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
@rustbot rustbot added this to the 1.102.0 milestone Nov 17, 2026
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Nov 19, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
ubiratansoares pushed a commit to ubiratansoares/rust-analyzer that referenced this pull request Nov 19, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Nov 23, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-build-execution Area: anything dealing with executing the compiler A-configuration Area: cargo config files and env vars A-console-output Area: Terminal output, colors, progress bar, etc. A-documenting-cargo-itself Area: Cargo's documentation A-unstable Area: nightly unstable support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants