rust-coreutils date is unable to parse UTC date
Background
During the installation of tzdata
the package run the following commands
# Show the new setting to the user
UTdate=$(LC_ALL=C TZ=UTC0 date)
TZdate=$(unset TZ ; LANG=C date -d "$UTdate")
echo "Local time is now: $TZdate."
echo "Universal Time is now: $UTdate."
if [ -z "$DEBCONF_RECONFIGURE" ] ; then
echo "Run 'dpkg-reconfigure tzdata' if you wish to change it."
fi
echo
as result, an error is triggered
2025/04/28 12:08:59 debootstrap.log | Setting up tzdata (2025b-2+apertis0bv2026dev2b1) ...
2025/04/28 12:08:59 debootstrap.log |
2025/04/28 12:08:59 debootstrap.log | Current default time zone: 'Etc/UTC'
2025/04/28 12:08:59 debootstrap.log | date: invalid date 'Mon Apr 28 12:08:57 UTC 2025'
2025/04/28 12:08:59 debootstrap.log | dpkg: error processing package tzdata (--configure):
2025/04/28 12:08:59 debootstrap.log | installed tzdata package post-installation script subprocess returned error exit status 1
https://gitlab.apertis.org/infrastructure/apertis-docker-images/-/jobs/4160587/raw
After investigating, the "UTC" mention in the argument triggers the error. The related code can be found at https://gitlab.apertis.org/pkg/rust-coreutils/-/blob/apertis/v2026dev2/src/uu/date/src/date.rs?ref_type=heads#L301
This has become an issue since now rust-coreutils date sets the exit code properly, causing the configure step in tzdata to fail.
Reproducibility
How often the issue is hit when repeating the steps to reproduce and changing nothing?
Put the in the most appropriate entry:
-
✅ always - often, but not always
- rarely
Impact of bug
Due to this issue it is not possible to bootstrap v2026dev2.
Outcomes
- pkg/tzdata!75 (merged) (workaround)
Management data
This section is for management only, it should be the last one in the description.
/cc @em @balasubramanian @sudarshan @wlozano
Phabricator link: https://phabricator.apertis.org/T11017