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

Compile tzdata if compiled dir is empty #474

Merged
merged 2 commits into from
Sep 7, 2024
Merged

Compile tzdata if compiled dir is empty #474

merged 2 commits into from
Sep 7, 2024

Conversation

omus
Copy link
Member

@omus omus commented Sep 6, 2024

Interactive test:

julia> using Revise, TimeZones

julia> TimeZones.build("2024b")
[ Info: Compiling tzdata 2024b region data
ERROR: KeyError: key "April" not found
Stacktrace:
  [1] getindex
    @ ./dict.jl:498 [inlined]
  [2] parse(::Type{TimeZones.TZData.Rule}, str::SubString{String})
    @ TimeZones.TZData ~/.julia/dev/TimeZones/src/tzdata/compile.jl:301
  [3] load!(tz_source::TimeZones.TZData.TZSource, filename::String, io::IOStream)
    @ TimeZones.TZData ~/.julia/dev/TimeZones/src/tzdata/compile.jl:615
  [4] #34
    @ ~/.julia/dev/TimeZones/src/tzdata/compile.jl:636 [inlined]
  [5] open(::TimeZones.TZData.var"#34#35"{TimeZones.TZData.TZSource, String}, ::String, ::Vararg{String}; kwargs::@Kwargs{})
    @ Base ./io.jl:396
  [6] open
    @ ./io.jl:393 [inlined]
  [7] load!
    @ ~/.julia/dev/TimeZones/src/tzdata/compile.jl:635 [inlined]
  [8] TimeZones.TZData.TZSource(files::Vector{String})
    @ TimeZones.TZData ~/.julia/dev/TimeZones/src/tzdata/compile.jl:71
  [9] build(version::String, working_dir::String)
    @ TimeZones.TZData ~/.julia/dev/TimeZones/src/tzdata/build.jl:59
 [10] build(version::String; force::Bool)
    @ TimeZones ~/.julia/dev/TimeZones/src/build.jl:12
 [11] build(version::String)
    @ TimeZones ~/.julia/dev/TimeZones/src/build.jl:11
 [12] top-level scope
    @ REPL[2]:1

julia> TimeZones.build("2024b") # Introduced KeyError fix
ERROR: Cache remains empty after loading
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] reload!
   @ ~/.julia/dev/TimeZones/src/types/timezonecache.jl:40 [inlined]
 [3] _reload_tz_cache
   @ ~/.julia/dev/TimeZones/src/types/timezonecache.jl:73 [inlined]
 [4] build(version::String; force::Bool)
   @ TimeZones ~/.julia/dev/TimeZones/src/build.jl:16
 [5] build(version::String)
   @ TimeZones ~/.julia/dev/TimeZones/src/build.jl:11
 [6] top-level scope
   @ REPL[3]:1

julia> TimeZones.build("2024b") # Introduced compiled dir fix
[ Info: Compiling tzdata 2024b region data
[ Info: Successfully built TimeZones

@omus omus merged commit 9ff3214 into master Sep 7, 2024
15 checks passed
@omus omus deleted the cv/build-fix branch September 7, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant