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

TimeZones fails to precompile on 1.7.3 #45483

Closed
wheeheee opened this issue May 27, 2022 · 4 comments
Closed

TimeZones fails to precompile on 1.7.3 #45483

wheeheee opened this issue May 27, 2022 · 4 comments

Comments

@wheeheee
Copy link

When updating JDF and precompiling, the following error occurs.

julia> Pkg.precompile()
Precompiling project...
  ✗ JDF
  0 dependencies successfully precompiled in 9 seconds (474 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

JDF [babc3d20-cd49-4f60-a736-a8f9c08892d3]

Failed to precompile JDF [babc3d20-cd49-4f60-a736-a8f9c08892d3] to C:\Users\wheehee\.julia\compiled\v1.7\JDF\jl_BCC0.tmp.
ERROR: LoadError: ArgumentError: Unable to find time zone "Asia/Shanghai". Try running `TimeZones.build()`.
Stacktrace:
  [1] (::TimeZones.var"#3#4"{String})()
    @ TimeZones C:\Users\wheehee\.julia\packages\TimeZones\hS2RZ\src\types\timezone.jl:80
  [2] get!(default::TimeZones.var"#3#4"{String}, h::Dict{String, Tuple{Dates.TimeZone, TimeZones.Class}}, key::String)
    @ Base .\dict.jl:464
  [3] Dates.TimeZone(str::String, mask::TimeZones.Class) (repeats 2 times)
    @ TimeZones C:\Users\wheehee\.julia\packages\TimeZones\hS2RZ\src\types\timezone.jl:70
  [4] var"@tz_str"(__source__::LineNumberNode, __module__::Module, str::Any)
    @ TimeZones C:\Users\wheehee\.julia\packages\TimeZones\hS2RZ\src\types\timezone.jl:110
  [5] include(mod::Module, _path::String)
    @ Base .\Base.jl:418
  [6] include(x::String)
    @ JDF C:\Users\wheehee\.julia\packages\JDF\SL7sz\src\JDF.jl:1
    @ C:\Users\wheehee\.julia\packages\JDF\SL7sz\src\JDF.jl:43
  [8] include
    @ .\Base.jl:418 [inlined]
  [9] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base .\loading.jl:1318
 [10] top-level scope
    @ none:1
 [11] eval
    @ .\boot.jl:373 [inlined]
 [12] eval(x::Expr)
    @ Base.MainInclude .\client.jl:453
 [13] top-level scope
    @ none:1
in expression starting at C:\Users\wheehee\.julia\packages\JDF\SL7sz\src\type-writer-loader\ZonedDateTime.jl:43
in expression starting at C:\Users\wheehee\.julia\packages\JDF\SL7sz\src\type-writer-loader\ZonedDateTime.jl:43
in expression starting at C:\Users\wheehee\.julia\packages\JDF\SL7sz\src\JDF.jl:1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types C:\Program Files\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API C:\Program Files\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:1362
 [3] precompile
   @ C:\Program Files\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:1013 [inlined]
 [4] #precompile#220
   @ C:\Program Files\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:1011 [inlined]
 [5] precompile()
   @ Pkg.API C:\Program Files\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:1011
 [6] top-level scope
   @ REPL[10]:1

Apparently TimeZones can't be built automatically, but manually building it is ok.

julia> Pkg.build("JDF")
    Building TimeZones → `C:\Users\wheehee\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\0a359b0ee27e4fbc90d9b3da1f48ddc6f98a0c9e\build.log`
(@v1.7) pkg> precompile
Precompiling project...
  1 dependency successfully precompiled in 8 seconds (474 already precompiled)

This happens on Fedora too, not just Windows.

@giordano
Copy link
Contributor

Did you try to follow the suggestion

Unable to find time zone "Asia/Shanghai". Try running TimeZones.build().

?

@IanButterworth
Copy link
Sponsor Member

If TimeZones can't be precompiled, TimeZones.build() isn't possible.

Perhaps the error meant to say pkg> build TimeZones.

As an aside..

The way TimeZones is built is pretty odd anyway. It loads itself during its build.jl which ruins the benefit of parallel precompilation JuliaTime/TimeZones.jl#357

In general, there's a push to improve the installation of TimeZones by moving the data to Artifacts etc JuliaTime/TimeZones.jl#343

@DilumAluthge
Copy link
Member

See also JuliaTime/TimeZones.jl#359

@DilumAluthge
Copy link
Member

Anyway, I think this issue should be moved to the TimeZones.jl repo, right? It doesn't seem like there's a Julia bug here?

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

No branches or pull requests

4 participants