rickysarraf opened a new issue, #2225:
URL: https://github.com/apache/orc/issues/2225
On Arch Linux, the documentation clearly states that /etc/localtime is not
required, and in CI it's not present. Patch the timezone handling to
assume UTC when /etc/localtime is not there.
This is hopefully a sane fallback for systems where `/etc/localtime` may not
be available.
```patch
--- a/c++/src/Timezone.cc 2025-03-12 12:09:01.267309399 +0000
+++ b/c++/src/Timezone.cc 2025-03-12 12:12:12.303295722 +0000
@@ -28,6 +28,12 @@
#include <map>
#include <sstream>
+#ifndef _MSC_VER
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
namespace orc {
// default location of the timezone files
@@ -694,6 +700,14 @@
#ifdef _MSC_VER
return getTimezoneByName("UTC");
#else
+ // The absence of LOCAL_TIMEZONE means UTC conventionally
+ {
+ struct stat _ignored;
+ if (stat(LOCAL_TIMEZONE, &_ignored) == -1) {
+ return getTimezoneByName("UTC");
+ }
+ }
+
return getTimezoneByFilename(LOCAL_TIMEZONE);
#endif
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]