Closed sandwwraith closed 8 months ago
You are right, sorry for the libel! Yes, the comment is outdated; the true reason these targets are not provided is that we haven't implemented the timezone database access for them.
On Android the zoneinfo database seems to be available at /system/usr/share/zoneinfo
, at least on the devices in my possession. I don't have any link documenting this, but I doubt one exists.
The rest of the code could be identical to the linux implementation as far as I can see.
The rest of the code could be identical to the linux implementation as far as I can see.
Not really; these are files and not directories, and we would need to research how they are parsed. We can look into this if there's demand, but I don't think I've seen anyone asking for this yet.
It's more of an ecosystem blocker, because you are at the root of the graph. This is blocking square/okio, which is also a common dependency at the root of many square projects and thus everybody's projects.
At the leaves of this dependency tree there likely are many people, users and lib maintainers, asking or wondering about androidNative support. I, for example, stumbled upon this after opening square/okio#1326 which I had openend because it is blocking some other kotlinx library (can't remember which one now).
So I think this should be done even if it's there's not much direct request. I'm happy to help too, even though I don't care about timezone's and maybe nor does okio. If system/usr/shareinfo is there, I would hope there's some AOSP code that parses it that you could look at.
I, for example, stumbled upon this after opening https://github.com/square/okio/issues/1326
Thanks for sharing this: without this link, I didn't know at all that we were blocking anyone at all.
I don't care about timezone's and maybe nor does okio.
Yep, git grep
in their code only shows Clock
and Instant
. Not sure how much utility our library brings to them.
This code parses the database file, looking for a specific ID (you might know what that is, I don't): https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/tzcode/bionic.cpp;l=131?q=libc%2Ftzcode%2Fbionic.cpp .
There are also other libs that parse the file in a simpler way: https://cs.android.com/android/platform/superproject/main/+/main:external/rust/crates/grpcio-sys/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc;l=696-728?q=system%2Fusr%2Fshare%2Fzoneinfo
The latter looks pretty straightforward.
As said in the official recommendations, library authors are encouraged to provide builds for tier 3 targets. Currently, they're commented out:
But kotlinx.serialization actually supports them starting from 1.5.1