Skip to content

fix(map): cargo tree's output is read uncolored - #1052

Merged
cryptskii merged 1 commit into
mainfrom
fix/code-map-cargo-tree-color
Sep 29, 2026
Merged

cryptskii merged 1 commit into
mainfrom
fix/code-map-cargo-tree-color

Conversation

@cryptskii

Copy link
Copy Markdown
Collaborator

What

The Code map job fails on main since #1051. CI sets CARGO_TERM_COLOR=always, so cargo tree wraps its (*) repeat marker in ANSI escape codes, and the map's feature reader refuses those lines:

requirement_map: "proc-macro2 v1.0.106 default,proc-macro \u{1b}[33m\u{1b}[2m(*)\u{1b}[39m\u{1b}[22m" is not a `cargo tree -f '{p} {f}'` line

The fix has two parts:

  • Every cargo tree call in make requirement-map now passes --color never, so its input is plain whatever the environment sets.
  • A feature-tree line that still holds escape codes is refused by name, with a message giving the cause and the flag, instead of the generic malformed-line error.

Verification

  • Reproduced locally with CARGO_TERM_COLOR=always: 314 lines came out coloured.
  • With --color never under the same setting, the output is byte-identical to a plain run.
  • CARGO_TERM_COLOR=always make requirement-map builds, with 0 escape codes in the feature files. The readings are unchanged:
    • 63 roots and 7 dead-root candidates;
    • 39 definitions excluded;
    • 8,627 reached, 40 indeterminate and 1,544 dead.
  • cargo test -p requirement_map --release: the cfgs tests pass, 9 of 9, including one for coloured input.
  • Clippy with -D warnings, make lint and the real-code guard all pass.
  • The Gemini push gate is satisfied.

CI sets CARGO_TERM_COLOR=always, so cargo tree wrapped its `(*)` repeat
marker in terminal escape codes and the feature reader refused the line
(Code map job on #1051). Every cargo tree the map runs now asks for
`--color never`, and a line holding escape codes is refused by name,
saying so.

Reproduced locally with CARGO_TERM_COLOR=always (314 colored lines);
with --color never the output is byte-identical to the uncolored run,
and the full map builds with unchanged readings.
@cryptskii
cryptskii merged commit abdb124 into main Sep 29, 2026
26 checks passed
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.

1 participant