Skip to content
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

Failure to load tzdata on Android under Termux #6

Open
gnomon- opened this issue Sep 6, 2023 · 0 comments
Open

Failure to load tzdata on Android under Termux #6

gnomon- opened this issue Sep 6, 2023 · 0 comments

Comments

@gnomon-
Copy link

gnomon- commented Sep 6, 2023

The tzc-main-dir customizable var attempts some good guesses for finding tzdata files but there is a gap when it is invoked under Termux on Android. Executing the following script demonstrates the issue with querying system-type alone:

#!/usr/bin/env -S emacs --script

(mapcar
 (lambda (sym)
   (princ (concat
	   (symbol-name sym)
	   ":\t"
	   (let ((symv (symbol-value sym)))
	     (if (stringp symv)
	      symv
	      (symbol-name symv)))
	   "\n")))
 '(system-configuration system-type))

...which, under Termux, prints:

system-configuration:   aarch64-unknown-linux-android
system-type:    gnu/linux

The challenge is that Android does not follow Linux or macOS convention about splitting up timezone info into multiple files; rather, it offers a single concatenated file:

$ declare -p ANDROID_TZDATA_ROOT
declare -x ANDROID_TZDATA_ROOT="/apex/com.android.tzdata"
$ find "$ANDROID_TZDATA_ROOT" -type f -exec ls -sal --full-time '{}' '+'
find: ‘/apex/com.android.tzdata/lost+found’: Permission denied
  4 -rw-r--r-- 1 system system     26 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/apex_manifest.pb
236 -rw-r--r-- 1 system system 237600 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
  4 -rw-r--r-- 1 system system    248 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/tz/telephonylookup.xml
  4 -rw-r--r-- 1 system system     17 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/tz/tz_version
440 -rw-r--r-- 1 system system 449437 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/tz/tzdata
 36 -rw-r--r-- 1 system system  36717 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/tz/tzlookup.xml

I'm figuring out what to do with this file organization and format in order to offer an actual fix, but for now I'm just opening this issue to log the discovery.

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

No branches or pull requests

1 participant