Introduce ariadne to provide better error messages + chmod support - #13785
Introduce ariadne to provide better error messages + chmod support#13785sylvestre wants to merge 4 commits into
Conversation
|
Binary size comparison: |
Merging this PR will degrade performance by 0.24%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | numfmt_large_numbers_si[10000] |
93.2 ms | 102.4 ms | -9.06% |
| ❌ | Simulation | numfmt_padding[(10000, 50)] |
93.5 ms | 97.4 ms | -4.02% |
| ⚡ | Simulation | ls_recursive_deep_tree[(200, 2)] |
3.6 ms | 3.4 ms | +5.33% |
| ⚡ | Simulation | cksum_default |
41.4 ms | 39.8 ms | +4.02% |
| ⚡ | Simulation | mv_multiple_to_dir |
25.3 ms | 24.5 ms | +3.3% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing sylvestre:ariadne-support (9502c25) with main (c33da23)
Footnotes
-
46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
e86738c to
120499c
Compare
|
@codspeedbot fix this regression |
I looked into the 6 reported regressions, and there is nothing to fix here — none of them are caused by this PR. WhyEvery single flagged benchmark was compared across different CPU models. From the run comparison metadata:
Simulation mode derives its cache model from the physical CPU, so a runner swap shifts the estimate on identical source. The fact that The PR cannot reach that code anywayThe benchmark workflow builds one package per matrix job ( Verified locallyI built and ran the worst offender on both revisions on the same machine:
Byte-for-byte identical measurements — the reported -17.38% does not reproduce. RecommendationNo changes were made and nothing was pushed. These can be safely acknowledged on CodSpeed. Worth noting separately: The one real, measurable cost of this PR is the binary size already reported by the size bot: chmod grows +76 KB (+6.5%) from pulling in Summary
Learnings updated. See what CodSpeed remembers about this repository. Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
|
GNU testsuite comparison: |
There was a problem hiding this comment.
Pull request overview
This PR introduces an optional diagnostics rendering facility (powered by ariadne) to produce richer, caret-pointing error reports on terminals, and wires it into chmod by upgrading mode parsing to return structured errors with precise spans.
Changes:
- Add
uucore::diagnostics(feature-gated) to render terminal-only error reports against argv snapshots. - Replace stringly-typed mode parse errors with
ModeError { message, span, kind }and propagate spans across comma-separated mode clauses. - Integrate diagnostics into
chmodand add tests (including a test-harness helper to simulatestderras a terminal while disabling color).
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/uutests/src/lib/util.rs | Adds terminal_sim_stderr() helper for unix tests to simulate terminal stderr and disable color via NO_COLOR. |
| tests/by-util/test_chmod.rs | Adds diagnostic-focused integration tests validating caret placement and terminal-vs-pipe behavior. |
| src/uucore/src/lib/lib.rs | Re-exports uucore::diagnostics behind the diagnostics feature. |
| src/uucore/src/lib/features/mode.rs | Introduces ModeError/ModeErrorKind with spans; updates chmod-mode parsing APIs to return structured errors. |
| src/uucore/src/lib/features/diagnostics.rs | New diagnostics renderer built on ariadne, including snapshotting/locating operands inside argv text. |
| src/uucore/src/lib/features.rs | Adds the diagnostics module behind a feature flag. |
| src/uucore/Cargo.toml | Adds optional ariadne dependency and diagnostics feature. |
| src/uu/mknod/src/mknod.rs | Adjusts error mapping for new mode parse error type. |
| src/uu/mkfifo/src/mkfifo.rs | Converts ModeError to String for existing function signature. |
| src/uu/mkdir/src/mkdir.rs | Converts ModeError to String for existing function signature. |
| src/uu/install/src/install.rs | Adjusts translation formatting for new mode parse error type. |
| src/uu/chmod/src/diagnostics.rs | New mapping layer from ModeErrorKind to localized labels/help and span alignment within the mode operand. |
| src/uu/chmod/src/chmod.rs | Captures argv for rendering diagnostics and renders rich reports on parse failures (when stderr is a terminal). |
| src/uu/chmod/locales/fr-FR.ftl | Adds localized diagnostic labels/help strings (French). |
| src/uu/chmod/locales/en-US.ftl | Adds localized diagnostic labels/help strings (English). |
| src/uu/chmod/Cargo.toml | Enables uucore’s diagnostics feature for chmod. |
| deny.toml | Updates cargo-deny duplicate-version skip list for hashbrown. |
| Cargo.toml | Adds workspace dependency entry for ariadne. |
| Cargo.lock | Locks new dependency (ariadne) and associated transitive updates. |
| .vscode/cspell.dictionaries/workspace.wordlist.txt | Adds spelling dictionary entries for new identifiers/deps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
120499c to
111bb4f
Compare
111bb4f to
9502c25
Compare
example:
screenshot with color:

more programs will follow