Skip to content

Conversation

emar-kar
Copy link
Contributor

Chrono just released a new version of their crate, introducing more flexible way to parse unknown format specifiers.

Closes #7802

Copy link

GNU testsuite comparison:

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

// TODO (#7802): Replace with new_lenient
StrftimeItems::new(custom_tz_fmt::custom_time_format(fmt).as_str()).parse_to_owned()
// Box the fmt value to make it static.
StrftimeItems::new_lenient(Box::leak(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the Box::leak change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, my bad. Was too concentrated on parse(), missed that it can be done much simpler

@drinkcat
Copy link
Collaborator

I think this looks ok. @Qelxiros FYI.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker merged commit b14388c into uutils:main Apr 29, 2025
69 of 70 checks passed
@cakebaker
Copy link
Contributor

Thanks!

nickorlow pushed a commit to nickorlow/coreutils that referenced this pull request Jul 17, 2025
…ls#7858)

* update chrono crate version and switch to new_lenient use

* bring back custom_tz_fmt and update test

* update chrono version in fuzz lock file

* replace boxing with parse_to_owned
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.

ls: Do not crash on unknown format specifier (e.g. +%Y %0)
3 participants