Skip to content

Factorize quoting for ls, stat and make printenv honor QUOTING_STYLE - #14849

Closed
RenjiSann wants to merge 7 commits into
uutils:mainfrom
RenjiSann:printenv-quoting-style
Closed

RenjiSann wants to merge 7 commits into
uutils:mainfrom
RenjiSann:printenv-quoting-style

Conversation

@RenjiSann

@RenjiSann RenjiSann commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

The first part of this PR refactors quoting, especially the QUOTING_STYLE env var parsing to move it under uucore::quoting_style.

Second part implement support of QUOTING_STYLE for printenv.

@codspeed

codspeed Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 5.68%

⚡ 3 improved benchmarks
❌ 2 regressed benchmarks
✅ 384 untouched benchmarks
⏩ 54 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation three_39_bit_primes 436.5 ms 635.9 ms -31.35%
❌ Simulation hostname_ip_lookup[100000] 164.7 µs 176.3 µs -6.57%
⚡ Simulation five_38_bit_primes 2.1 s 1.9 s +8.84%
⚡ Simulation ls_recursive_deep_tree[(200, 2)] 3.4 ms 3.3 ms +3.44%
⚡ Simulation thirteen_39_bit_primes 9.3 s 9 s +3.36%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing RenjiSann:printenv-quoting-style (511dd79) with main (3242ee4)2

Open in CodSpeed

Footnotes

  1. 54 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. ↩

  2. No successful run was found on main (4f7dfed) during the generation of this report, so 3242ee4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@RenjiSann
RenjiSann force-pushed the printenv-quoting-style branch from 60af770 to 8cf0640 Compare September 24, 2026 16:30
@RenjiSann
RenjiSann marked this pull request as ready for review September 24, 2026 16:30
@RenjiSann
RenjiSann force-pushed the printenv-quoting-style branch from 8cf0640 to d232dc1 Compare September 24, 2026 16:31
Comment thread src/uu/ls/src/config.rs
Comment thread src/uu/ls/src/config.rs Outdated
Comment thread src/uu/stat/src/stat.rs Outdated
}
f.write_str(&style)
}
Self::C { .. } => f.write_str("c"),

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.

this breaks test_quoting_style_display, it still expects "C" (probably the red CI)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I'm not sure why it was a capital C though. My understanding is that the Display trait here corresponds to the reverse operation from the "parsing", so it should be a lowercase c.

I will change the test, let's see if it breaks something on the GNU side

Comment thread src/uucore/src/lib/features/quoting_style/mod.rs Outdated
Comment thread tests/by-util/test_printenv.rs Outdated
@RenjiSann
RenjiSann force-pushed the printenv-quoting-style branch from d232dc1 to 3deb074 Compare September 24, 2026 21:24
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)

@RenjiSann
RenjiSann force-pushed the printenv-quoting-style branch 2 times, most recently from 3290827 to 9a5c997 Compare September 25, 2026 00:45
@sylvestre

Copy link
Copy Markdown
Contributor

the ci is still sad :)

@RenjiSann
RenjiSann force-pushed the printenv-quoting-style branch from 9a5c997 to fd6b1fb Compare September 25, 2026 08:45
@RenjiSann

Copy link
Copy Markdown
Collaborator Author

I'm having a problem with the GNU test misc/printenv.sh. Looks like it requires no quotes where I'd expect some. Also, on my machine, looks like 9.12 GNU printenv doesn't pass its own test

@RenjiSann
RenjiSann force-pushed the printenv-quoting-style branch from fd6b1fb to 511dd79 Compare September 25, 2026 09:01
@RenjiSann

Copy link
Copy Markdown
Collaborator Author

This PR is getting big with the QuotingStyle refactor and the printenv support.

I'll split this work in separate PRs

@RenjiSann RenjiSann closed this Sep 25, 2026
@RenjiSann

Copy link
Copy Markdown
Collaborator Author

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.

2 participants