Skip to content

date: expand GNU-compatible parsing and formatting - #15111

Merged
cakebaker merged 1 commit into
uutils:mainfrom
anastygnome:test-util
Oct 12, 2026
Merged

cakebaker merged 1 commit into
uutils:mainfrom
anastygnome:test-util

Conversation

@anastygnome

@anastygnome anastygnome commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Handle extended years, epoch seconds, normalization, DST gaps, and strftime modifier precedence

Refs #14705

Closed or superseeds :
Closes #14648
Closes #14649
Closes #9253
Closes #12954
Closes #12944
Closes #12034
Closes #12897
Closes #11657
Closes #11658
Closes #9275
Closes #11752
Closes #14179
Closes #11778
Closes #12064

Unit test ignore removed (may need a backport):
Refs uutils/parse_datetime#279
Refs uutils/parse_datetime#280

@anastygnome
anastygnome marked this pull request as ready for review October 6, 2026 05:02
@codspeed

codspeed Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 12.56%

⚠️ 2 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

❌ 5 regressed benchmarks
✅ 7 untouched benchmarks
⏩ 444 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation file_custom_format 30 ms 36.5 ms -17.9%
❌ Simulation file_iso_dates 31.5 ms 38.2 ms -17.52%
❌ Simulation file_localized_names 41.9 ms 48.6 ms -13.73%
❌ Simulation file_tz_abbreviations 35.4 ms 38.1 ms -7.07%
❌ ⚠️ Simulation complex_relative_date 292.6 µs 310.8 µs -5.84%

Tip

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


Comparing anastygnome:test-util (a197690) with main (e6eb5ad)2

Open in CodSpeed

Footnotes

  1. 444 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 (09a1ec1) during the generation of this report, so e6eb5ad was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@anastygnome
anastygnome force-pushed the test-util branch 2 times, most recently from ce6b516 to 2e6eecf Compare October 6, 2026 05:15
@anastygnome

Copy link
Copy Markdown
Contributor Author

extra work => additional cost.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/date/date is no longer failing!
Congrats! The gnu test tests/date/date-tz is no longer failing!

@anastygnome

Copy link
Copy Markdown
Contributor Author

CICD and Android are related to tail/cp, nothing related to this PR

@sylvestre

Copy link
Copy Markdown
Contributor

sorry, but we can't take this: emit_gnu_debug hardcodes the expected output for specific GNU test inputs, which doesn't fix anything and looks taken from the GNU tests. If you want to keep going, please split it into small PRs that fix real behavior, one at a time.

@anastygnome

Copy link
Copy Markdown
Contributor Author

@sylvestre would making the non debug tests into one PR be ok?

@sylvestre

Copy link
Copy Markdown
Contributor

just the tests or tests+fixes?

@anastygnome

Copy link
Copy Markdown
Contributor Author

I mean the code & test that fix tests/date/date & date/date-tz are very similar (I blieve matching debug output isn"t really wise but I had matched it to see if we could and discuss it here

@sylvestre

Copy link
Copy Markdown
Contributor

Sure but this pr is huge. I would prefer smaller changes

@anastygnome
anastygnome force-pushed the test-util branch 4 times, most recently from ef60759 to d6ed595 Compare October 6, 2026 07:57
@anastygnome

anastygnome commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

I reduced the scope @sylvestre

@anastygnome

Copy link
Copy Markdown
Contributor Author

@cakebaker @xtqqczze if one od you may review this it'd be appreciated

Comment thread src/uu/date/src/format_modifiers.rs Outdated
Comment thread src/uu/date/src/format_modifiers.rs
Comment thread src/uu/date/src/format_modifiers.rs Outdated

@cakebaker cakebaker left a comment

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'll likely wrap up the review tomorrow. The tests look fine.

@anastygnome

anastygnome commented Oct 7, 2026 via email •

Copy link
Copy Markdown
Contributor Author

Comment thread src/uu/date/src/format_modifiers.rs Outdated
Comment thread src/uu/date/src/format_modifiers.rs Outdated
Comment thread src/uu/date/src/format_modifiers.rs Outdated
Comment thread src/uu/date/src/format_modifiers.rs Outdated
Comment thread src/uu/date/src/format_modifiers.rs Outdated
Copilot AI balanced review requested due to automatic review settings October 11, 2026 18:09

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@anastygnome

Copy link
Copy Markdown
Contributor Author

How does this PR relate to #11778 and #12064?

If this PR is intended to supersede those PRs, please mention them in the PR description using GitHub's closing keywords.

done

Copilot AI balanced review requested due to automatic review settings October 11, 2026 18:22

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 19:33

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@anastygnome

Copy link
Copy Markdown
Contributor Author

@sylvestre can we merge this as is?

Copilot AI balanced review requested due to automatic review settings October 11, 2026 22:14

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cakebaker
cakebaker merged commit a84f05d into uutils:main Oct 12, 2026
99 of 100 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Congrats! The gnu test tests/date/date is no longer failing!
Congrats! The gnu test tests/date/date-tz is no longer failing!

Kudos and thanks!

@anastygnome

Copy link
Copy Markdown
Contributor Author

@cakebaker I have fixed 3 other issues as a spin-off PR, incoming tonight

@xtqqczze

Copy link
Copy Markdown
Collaborator

Congrats! The gnu test tests/date/date is no longer failing!
Congrats! The gnu test tests/date/date-tz is no longer failing!

@cakebaker #14705 needs updating

@cakebaker

Copy link
Copy Markdown
Contributor

@xtqqczze done, thanks for the hint!

@xtqqczze

Copy link
Copy Markdown
Collaborator

Closes #13818?

@anastygnome

Copy link
Copy Markdown
Contributor Author

So many things I can't keep up with

@xtqqczze

Copy link
Copy Markdown
Collaborator

Well done, I think that may be a record for number of issues closed with one PR!

@SichenLiang

Copy link
Copy Markdown
Contributor

I think this also changed %F with a flag or width for years below 1000. GNU still applies the flag to the year inside %F; the gnulib change only stopped that for %D, as discussed in #11657. Main matched GNU before this PR:

$ TZ=UTC LC_ALL=C date -d 0001-01-01 +%-F
1-01-01

After the merge, main prints 0001-01-01. The same happened with %_F and widths such as %6F. %0F and %+F were already different from GNU before this PR.

@anastygnome

Copy link
Copy Markdown
Contributor Author

@SichenLiang will address this in my current PR. Regression introduced by a lacking coverage

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

Labels

None yet

Projects

None yet

6 participants