JuliaTime / TimeZones.jl

IANA time zone database access for the Julia programming language
Other
86 stars 52 forks source link

Package artifacts and distribute using our standard architecture #343

Closed ViralBShah closed 1 year ago

ViralBShah commented 3 years ago

I wonder if it would be more robust to have the artifacts packaged up as a JLL and distributed like other binary artifacts.

omus commented 3 years 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.

KristofferC commented 3 years ago

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.

StefanKarpinski commented 3 years ago

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?

ViralBShah commented 3 years ago

I meant "bundle it in a standard way and distribute using our infrastructure, and make it more packagecompiler friendly".

StefanKarpinski commented 3 years ago

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?

staticfloat commented 2 years ago

Is the problem that the serialization format is Julia-version-specific?

ViralBShah commented 2 years ago

Yes: https://github.com/JuliaTime/TimeZones.jl/issues/343#issuecomment-848793417

DilumAluthge commented 2 years ago

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?

KristofferC commented 2 years ago

Use Scratch space as a cache and serialize it during runtime to a folder based on the julia version?

ViralBShah commented 2 years ago

Seems like we should do @kristofferC's suggestion right away. I do wonder if different artifacts can be made for every Julia version.

KristofferC commented 2 years ago

You can just prefix the scratch folder with the julia version for example.

omus commented 1 year ago

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.