Skip to content

Conversation

Muscraft
Copy link
Member

In rust-lang/rust#147207, I am changing rustc to anstyle for terminal styling. As part of this change, rustc will now be emitting 4-bit ANSI colors instead of 8-bit (256-color). That change is blocked on the message_format::cargo_renders_ansi test, which looks for a specific color sequence that rustc is no longer emitting and subsequently causes it to fail. To fix this, I made it so the test now looks for the start of an ANSI sequence instead of a specific sequence, as seeing the start of an ANSI escape sequence allows us to verify that ANSI colors are being emitted without the problems of looking for a specific sequence.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2025

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

@epage epage enabled auto-merge October 15, 2025 14:32
@weihanglo
Copy link
Member

The build log btw: rust-lang/rust#147207 (comment)

2025-10-15T05:43:41.6679468Z ---- message_format::cargo_renders_ansi stdout ----
2025-10-15T05:43:41.6680580Z running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check --message-format json-diagnostic-rendered-ansi`
2025-10-15T05:43:41.6681526Z 
2025-10-15T05:43:41.6682062Z thread 'message_format::cargo_renders_ansi' (111799) panicked at src/tools/cargo/tests/testsuite/message_format.rs:124:10:
2025-10-15T05:43:41.6682742Z 
2025-10-15T05:43:41.6683644Z test failed running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check --message-format json-diagnostic-rendered-ansi`
2025-10-15T05:43:41.6693191Z error: expected to find:
2025-10-15T05:43:41.6693636Z [..]/u001b[38;5;9merror[..]
2025-10-15T05:43:41.6693884Z 
2025-10-15T05:43:41.6694034Z did not find in output:
2025-10-15T05:43:41.6700713Z {"reason":"compiler-message","package_id":"path+[ROOTURL]/foo#0.1.0","manifest_path":"[ROOT]/foo/Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"foo","src_path":"[ROOT]/foo/src/main.rs","edition":"2015","doc":true,"doctest":false,"test":true},"message":{"$message_type":"diagnostic","message":"`main` function not found in crate `foo`","code":{"code":"E0601","explanation":"No `main` function was found in a binary crate./n/nTo fix this error, add a `main` function:/n/n```/nfn main() {/n    // Your program will start here./n    println!(/"Hello world!/");/n}/n```/n/nIf you don't know the basics of Rust, you can look at the/n[Rust Book][rust-book] to get started./n/n[rust-book]: https://doc.rust-lang.org/book//n"},"level":"error","spans":[{"file_name":"src/main.rs","byte_start":0,"byte_end":0,"line_start":0,"line_end":0,"column_start":1,"column_end":1,"is_primary":true,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a `main` function to `src/main.rs`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"/u001b[1m/u001b[91merror[E0601]/u001b[0m/u001b[1m: `main` function not found in crate `foo`/u001b[0m/n  /u001b[1m/u001b[94m|/u001b[0m/n  /u001b[1m/u001b[94m= /u001b[0m/u001b[1mnote/u001b[0m: consider adding a `main` function to `src/main.rs`/n/n"}}
2025-10-15T05:43:41.6709831Z {"reason":"compiler-message","package_id":"path+[ROOTURL]/foo#0.1.0","manifest_path":"[ROOT]/foo/Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"foo","src_path":"[ROOT]/foo/src/main.rs","edition":"2015","doc":true,"doctest":false,"test":true},"message":{"$message_type":"diagnostic","message":"For more information about this error, try `rustc --explain E0601`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"/u001b[1mFor more information about this error, try `rustc --explain E0601`./u001b[0m/n"}}
2025-10-15T05:43:41.6712336Z {"reason":"build-finished","success":false}

@epage epage added this pull request to the merge queue Oct 15, 2025
Merged via the queue into rust-lang:master with commit 367fd9f Oct 15, 2025
25 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 15, 2025
@Muscraft Muscraft deleted the fix-ansi-check-test branch October 15, 2025 15:35
bors added a commit to rust-lang/rust that referenced this pull request Oct 15, 2025
Update cargo

17 commits in 81c3f77a467359c8be6bc747dc93ec66a6e4ce11..367fd9f213750cd40317803dd0a5a3ce3f0c676d
2025-10-10 18:41:02 +0000 to 2025-10-15 15:01:32 +0000
- test: Don't look for a specfic ANSI color (rust-lang/cargo#16118)
- docs(guide): Clarify where to set config (rust-lang/cargo#16107)
- test(rustfix): re-enable disabled test due to unused variables (rust-lang/cargo#16114)
- Convert the "manifest has no things" warning to annotate_snippets. (rust-lang/cargo#16113)
- doc: make it clearer that `target.<cfg>.linker` is supported (rust-lang/cargo#16112)
- docs(guide): Cover feature-unification (rust-lang/cargo#16108)
- fix(gctx): types are unsupported not unknown (rust-lang/cargo#16109)
- fix(script): Tweak cargo script build-dir / target-dir (rust-lang/cargo#16086)
- docs(gctx): explain Value deserialization step-by-step (rust-lang/cargo#16105)
- docs(guide): Talk about removing unused features (rust-lang/cargo#16085)
- test(config): exercise unsupported TOML types (rust-lang/cargo#16100)
- docs(gctx): a bit more of how config deserialization works (rust-lang/cargo#16094)
- Refactor `Layout` into `BuildDirLayout` and `ArtifactDirLayout` (rust-lang/cargo#16092)
- Add alternative linker to the build performance guide (rust-lang/cargo#15991)
- refactor(gctx): extract error to a module (rust-lang/cargo#16091)
- fix: Fixed nightly tests failing due to unused_variables lint (rust-lang/cargo#16098)
- fix(script): Store cargo script lockfiles in build-dir (rust-lang/cargo#16087)

r? ghost
@rustbot rustbot added this to the 1.92.0 milestone Oct 15, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Oct 16, 2025
Update cargo

17 commits in 81c3f77a467359c8be6bc747dc93ec66a6e4ce11..367fd9f213750cd40317803dd0a5a3ce3f0c676d
2025-10-10 18:41:02 +0000 to 2025-10-15 15:01:32 +0000
- test: Don't look for a specfic ANSI color (rust-lang/cargo#16118)
- docs(guide): Clarify where to set config (rust-lang/cargo#16107)
- test(rustfix): re-enable disabled test due to unused variables (rust-lang/cargo#16114)
- Convert the "manifest has no things" warning to annotate_snippets. (rust-lang/cargo#16113)
- doc: make it clearer that `target.<cfg>.linker` is supported (rust-lang/cargo#16112)
- docs(guide): Cover feature-unification (rust-lang/cargo#16108)
- fix(gctx): types are unsupported not unknown (rust-lang/cargo#16109)
- fix(script): Tweak cargo script build-dir / target-dir (rust-lang/cargo#16086)
- docs(gctx): explain Value deserialization step-by-step (rust-lang/cargo#16105)
- docs(guide): Talk about removing unused features (rust-lang/cargo#16085)
- test(config): exercise unsupported TOML types (rust-lang/cargo#16100)
- docs(gctx): a bit more of how config deserialization works (rust-lang/cargo#16094)
- Refactor `Layout` into `BuildDirLayout` and `ArtifactDirLayout` (rust-lang/cargo#16092)
- Add alternative linker to the build performance guide (rust-lang/cargo#15991)
- refactor(gctx): extract error to a module (rust-lang/cargo#16091)
- fix: Fixed nightly tests failing due to unused_variables lint (rust-lang/cargo#16098)
- fix(script): Store cargo script lockfiles in build-dir (rust-lang/cargo#16087)

r? ghost
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Oct 18, 2025
Update cargo

17 commits in 81c3f77a467359c8be6bc747dc93ec66a6e4ce11..367fd9f213750cd40317803dd0a5a3ce3f0c676d
2025-10-10 18:41:02 +0000 to 2025-10-15 15:01:32 +0000
- test: Don't look for a specfic ANSI color (rust-lang/cargo#16118)
- docs(guide): Clarify where to set config (rust-lang/cargo#16107)
- test(rustfix): re-enable disabled test due to unused variables (rust-lang/cargo#16114)
- Convert the "manifest has no things" warning to annotate_snippets. (rust-lang/cargo#16113)
- doc: make it clearer that `target.<cfg>.linker` is supported (rust-lang/cargo#16112)
- docs(guide): Cover feature-unification (rust-lang/cargo#16108)
- fix(gctx): types are unsupported not unknown (rust-lang/cargo#16109)
- fix(script): Tweak cargo script build-dir / target-dir (rust-lang/cargo#16086)
- docs(gctx): explain Value deserialization step-by-step (rust-lang/cargo#16105)
- docs(guide): Talk about removing unused features (rust-lang/cargo#16085)
- test(config): exercise unsupported TOML types (rust-lang/cargo#16100)
- docs(gctx): a bit more of how config deserialization works (rust-lang/cargo#16094)
- Refactor `Layout` into `BuildDirLayout` and `ArtifactDirLayout` (rust-lang/cargo#16092)
- Add alternative linker to the build performance guide (rust-lang/cargo#15991)
- refactor(gctx): extract error to a module (rust-lang/cargo#16091)
- fix: Fixed nightly tests failing due to unused_variables lint (rust-lang/cargo#16098)
- fix(script): Store cargo script lockfiles in build-dir (rust-lang/cargo#16087)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants