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

If TimeZone is installed and built on a newer version of Julia that TimeZone version is unusable on older Julia versions #288

Closed
KristofferC opened this issue Sep 9, 2020 · 5 comments · Fixed by #315 · May be fixed by #295

Comments

@KristofferC
Copy link
Contributor

julia> using TimeZones # 1.5.1

julia> tz"UTC"
ERROR: LoadError: Cannot read stream serialized with a newer version of Julia.
Got data version 12 > current version 10
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] readheader(::Serialization.Serializer{IOStream}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Serialization/src/Serialization.jl:715
 [3] handle_deserialize(::Serialization.Serializer{IOStream}, ::Int32) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Serialization/src/Serialization.jl:878
 [4] deserialize(::Serialization.Serializer{IOStream}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Serialization/src/Serialization.jl:773
 [5] deserialize at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Serialization/src/Serialization.jl:760 [inlined]
 [6] open(::typeof(Serialization.deserialize), ::String, ::Vararg{String,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at ./io.jl:325
 [7] open at ./io.jl:323 [inlined]
 [8] (::TimeZones.var"#3#4"{String})() at /Users/kristoffercarlsson/.julia/packages/TimeZones/v0mfN/src/types/timezone.jl:50
 [9] get!(::TimeZones.var"#3#4"{String}, ::Dict{String,Tuple{TimeZone,TimeZones.Class}}, ::String) at ./dict.jl:450
 [10] TimeZone(::String, ::TimeZones.Class) at /Users/kristoffercarlsson/.julia/packages/TimeZones/v0mfN/src/types/timezone.jl:46 (repeats 2 times)
 [11] @tz_str(::LineNumberNode, ::Module, ::Any) at /Users/kristoffercarlsson/.julia/packages/TimeZones/v0mfN/src/types/timezone.jl:86
in expression starting at REPL[2]:1

Because I happened to install TimeZones on julia master first.

@omus
Copy link
Member

omus commented Sep 10, 2020

Currently TimeZones.jl uses serialization to store time zones with pre-computed transitions. As Julia and TimeZones have improved performance over time I'm hoping to switch over to calculating these transitions on the fly which would remove any reliance on serialization and thus avoid this problem.

If it turns out that this approach is too slow we should be able to store this information on disk using alternative storage methods like a custom format or another serialization format.

@oxinabox
Copy link
Contributor

If we have to keep storing it with serialization can we at least do something like including the julia version in the file path.

@oxinabox
Copy link
Contributor

This is super-annoying

@oxinabox
Copy link
Contributor

oxinabox commented Dec 4, 2020

If we have to keep storing it with serialization can we at least do something like including the julia version in the file path.

I will do this today.

Interestingly this no longer reproduced for tz"UTC" I guess because we now special case that in the parser to be faster.
But does fail as expected for tz"America/Winnipeg"

@omus
Copy link
Member

omus commented Dec 12, 2020

Fixed in TimeZones 1.5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants