JuliaTime / TimeZones.jl

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

On Julia nightly: ERROR: LoadError: Artifact "tzdata2020d" is a lazy artifact; package developers must call `using LazyArtifacts` in TimeZones.TZData before using lazy artifacts. #310

Closed DilumAluthge closed 3 years ago

DilumAluthge commented 3 years ago

This only happens on Julia nightly.

@staticfloat Does this need to be fixed in the TimeZones.jl package? Or is it something that needs to be fixed in Julia itself?

    Building TimeZones → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/69f312cdb1b3145761d4e5866034efde4608735d/build.log`
ERROR: Error building `TimeZones`: 
ERROR: LoadError: Artifact "tzdata2020d" is a lazy artifact; package developers must call `using LazyArtifacts` in TimeZones.TZData before using lazy artifacts.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] _artifact_str(__module__::Module, artifacts_toml::String, name::SubString{String}, path_tail::String, artifact_dict::Dict{String, Any}, hash::Base.SHA1, platform::Base.BinaryPlatforms.Platform, lazyartifacts::Any)
    @ Artifacts /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Artifacts/src/Artifacts.jl:548
  [3] #invokelatest#2
    @ ./essentials.jl:707 [inlined]
  [4] invokelatest
    @ ./essentials.jl:706 [inlined]
  [5] macro expansion
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Artifacts/src/Artifacts.jl:684 [inlined]
  [6] build(version::String, regions::Vector{String}, archive_dir::String, tz_source_dir::String, compiled_dir::String; verbose::Bool)
    @ TimeZones.TZData ~/.julia/packages/TimeZones/CNOFt/src/tzdata/build.jl:52
  [7] build(version::String)
    @ TimeZones.TZData ~/.julia/packages/TimeZones/CNOFt/src/tzdata/build.jl:115
  [8] build(version::String; force::Bool)
    @ TimeZones ~/.julia/packages/TimeZones/CNOFt/src/build.jl:11
  [9] build
    @ ~/.julia/packages/TimeZones/CNOFt/src/build.jl:11 [inlined]
 [10] top-level scope
    @ ~/.julia/packages/TimeZones/CNOFt/deps/build.jl:3
 [11] include(fname::String)
    @ Base.MainInclude ./client.jl:444
 [12] top-level scope
    @ none:5
in expression starting at /home/runner/.julia/packages/TimeZones/CNOFt/deps/build.jl:3
staticfloat commented 3 years ago

@vtjnash it looks like your recent PR did not make this a deprecation warning, but instead an error.

X-ref: https://github.com/JuliaLang/julia/pull/37844

DilumAluthge commented 3 years ago

Should I close #311 in favor of fixing this in Julia?

staticfloat commented 3 years ago

Okay, looking more closely, it appears that the source here is redefining the @artifact_str macro themselves:

https://github.com/JuliaTime/TimeZones.jl/blob/48fe98816b4c20df993cd3f98a06e1674f9b866d/src/compat.jl#L20-L43

This is not Jameson's PRs' fault. :P If this package is complex enough to redefine that, they can either import Pkg completely or import LazyArtifacts on 1.6+.

DilumAluthge commented 3 years ago

they can either import Pkg completely

They already do this. Should importing Pkg be sufficient to fix this error?

DilumAluthge commented 3 years ago

Ah. So I need to also import Pkg into the submodule.

DilumAluthge commented 3 years ago

Okay, this issue will be fixed by #312