Closed ViralBShah closed 1 year ago
The artifacts used by this package are just the tzdata archives provided by IANA. Currently TimeZones.jl extracts the tzsource files, compiles this information into the internal TimeZones.jl representation, and the serializes that information to disk during package build time. If we introduce a JLL I think it makes the most sense to store the serialized internal representation as the JLL artifact. Mainly the only thing holding up this work is picking a serialization method that works across Julia versions.
One thing that could be done is to do the compilation in __init__
instead and use https://github.com/JuliaPackaging/Scratch.jl to store the resulting files (instead of storing them inside the package folder). That would make the package work with e.g. PackageCompiler.
There's not really any reason for this to be a JLL, is there? It's not platform specific and doesn't require a fancy cross-compilation toolchain, it's just an artifact with a build step, right?
I meant "bundle it in a standard way and distribute using our infrastructure, and make it more packagecompiler friendly".
Might it be good enough to include a script that can be run when making a release that downloads the timezone files, processes them, bundles them up the way the package wants them, pushes that to GitHub along with the release and generates the corresponding Artifacts.toml
file? That way the user can just download ready-to-use artifacts that are already in the right format?
Is the problem that the serialization format is Julia-version-specific?
Can it be serialized to e.g. a JSON file?
And then we can use JSON3.jl and StructTypes.jl to deserialize it directly back to Julia types?
Use Scratch space as a cache and serialize it during runtime to a folder based on the julia version?
Seems like we should do @kristofferC's suggestion right away. I do wonder if different artifacts can be made for every Julia version.
You can just prefix the scratch folder with the julia version for example.
As of PR #441 this package uses typically precomputed time zones artifacts via the TZJData.jl package. For users with advanced needs scratch spaces are also used for manual time zone compilation if required. Included in TimeZones release 1.12.
I wonder if it would be more robust to have the artifacts packaged up as a JLL and distributed like other binary artifacts.