-
Notifications
You must be signed in to change notification settings - Fork 35
make check failure due to timezone issue #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks! So this is an Alpine bug in the end? I installed As I understand, if we set TZ to something, e.g. |
Btw. it seems that if we use This seems like a good solution to me. What do you think? |
I don't know where in the system the bug sits (maybe in musl). From reading help(timezones), I have the impression that time zone management is relatively chaotic. The configuration option --with-internal-tzcode is used by default on Windows & macOS, and recommended for Solaris. This builds R with the tweaked tzcode implementation from R's src/extra/tzone, which includes localtime.c and strftime.c. Otherwise the native services are used (that means from musl in Alpine).
To clarify, even if we setup a time zone in Alpine Linux by setting TZ, installing tzdata, and linking /etc/localtime to /usr/share/zoneinfo/${TZ}, R's make check will fail. Currently apk add --no-cache tzdata
R --quiet -e 'as.POSIXct("2020-01-01 12:00:00", tz="EST5EDT"); as.POSIXct("2020-01-01 12:00:00", tz="America/New_York")' gives
The first one is wrong and should be identical to the second. Note that the second result would have time zone UTC (without warning) if tzdata was not installed.
Maybe. It seems that at least the America/New_York and UTC files need to be kept. Warnings will then appear if any other timezone is used (as in many of R's tests). I'm not sure if this wouldn't also break some of the tests... apk add --no-cache tzdata
export TZDIR=/usr/share/zoneinfo |
The former to fix the bug, right?
TBH I am not super concerned about the tests. I found them quite fragile.
Yeah, this sounds great I think. We can remove most time zones, and keep UTC and the problematic ones. And document how to install the rest, should you need it. |
Without "America/New_York" warnings will always appear, even for Sys.timezone()
## [1] "UTC"
as.POSIXct("2020-01-01 12:00:00")
## [1] "2020-01-01 12:00:00 UTC"
## Warning messages:
## 1: In strptime(xx, f, tz = tz) : unknown timezone 'America/New_York'
## 2: In format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...) :
## unknown timezone 'America/New_York' probably because of
BTW, reporting the time zone error for Alpine's own R package built from https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/R/APKBUILD (also not using |
I've tried a
make check
between make && make install. This fails becausereturns a wrong result (should be [1] 5 17).
This problem has been reported long ago at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16843 and I've just verified that the issue persists even with latest Alpine 3.12.0. help(timezones) is pretty comprehensive and talks about the possibility of using R's internal zoneinfo database.
If the Dockerfile would
--with-internal-tzcode
ENV TZ=UTC
(which is used in plain Alpine Linux anyway) to suppress R's warning "system timezone name is unknown: set environment variable TZ".time zone computations would be correct but the R installation would grow in size:
share/zoneinfo
has 2.4 MB.Other ideas?
The text was updated successfully, but these errors were encountered: