Skip to content

Failure to load tzdata on Android under Termux #6

@gnomon-

Description

@gnomon-

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions