JuliaTime / TimeZones.jl

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

Julia 1.6 - ArgumentError: Unable to find time zone "America/New_York". Try running `TimeZones.build()`. #331

Closed bencottier closed 1 year ago

bencottier commented 3 years ago

It seems that Julia 1.6 does not build the package automatically. Is this a bug?

Julia 1.6:

julia> using TimeZones

julia> tz"America/New_York"
ERROR: LoadError: ArgumentError: Unable to find time zone "America/New_York". Try running `TimeZones.build()`.
Stacktrace:
 [1] (::TimeZones.var"#3#4"{String})()
   @ TimeZones ~/.julia/packages/TimeZones/K98G0/src/types/timezone.jl:56
 [2] get!(default::TimeZones.var"#3#4"{String}, h::Dict{String, Tuple{TimeZone, TimeZones.Class}}, key::String)
   @ Base ./dict.jl:465
 [3] TimeZone(str::String, mask::TimeZones.Class) (repeats 2 times)
   @ TimeZones ~/.julia/packages/TimeZones/K98G0/src/types/timezone.jl:46
 [4] var"@tz_str"(__source__::LineNumberNode, __module__::Module, str::Any)
   @ TimeZones ~/.julia/packages/TimeZones/K98G0/src/types/timezone.jl:86
in expression starting at REPL[4]:1

julia> TimeZones.build()
[ Info: Installing 2020d tzdata region data
[ Info: Converting tz source files into TimeZone data
[ Info: Successfully built TimeZones

julia> tz"America/New_York"
America/New_York (UTC-5/UTC-4)

Julia 1.5:

julia> using TimeZones

julia> tz"America/New_York"
America/New_York (UTC-5/UTC-4)
omus commented 3 years ago

The Julia 1.6 build behavior shouldn't have changed. If you remove the TimeZones package and re-add it can you reproduce the problem? Also, can you post your versioninfo()?

bencottier commented 3 years ago

The Julia 1.6 build behavior shouldn't have changed. If you remove the TimeZones package and re-add it can you reproduce the problem? Also, can you post your versioninfo()?

Note the problem was originally found in an internal Invenia CI job. I reproduced it locally with fresh activate --temp environments.

But it's true that I can't reproduce the problem after removing and re-adding the package. So I guess this is a problem with Invenia's CI for 1.6.

1.6:

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code

1.5:

julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
omus commented 3 years ago

It's possible that a network issue resulted in the build step failing.

Thanks for mentioning activate --temp as I can also reproduce the problem. This does seem to be a Pkg.jl issue but I'll need to investigate further.

iamed2 commented 3 years ago

Could the files being created by the build process be being removed by Pkg? I know they're moving towards using stuff like https://github.com/JuliaPackaging/Scratch.jl, maybe that's because there's some problem with package-local, package-managed files in 1.6?

kafisatz commented 3 years ago

Updating to 1.6, I ran into this "issue" (the fix is straightforward as the error message is very informative) as well on two different computers. I do not think this is related to a network issue.

rikhuijzer commented 3 years ago

I also ran into this issue in two different contexts.

omus commented 3 years ago

I'll try to get this fixed tomorrow

rikhuijzer commented 3 years ago

Suddenly, it now works when building Heroku on Julia 1.6.1.

Logs for the failing build ``` julia version 1.6.1 done ┌ Warning: The Pkg REPL interface is intended for interactive use, use with caution from scripts. └ @ Pkg.REPLMode /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/REPLMode/REPLMode.jl:378 Installing known registries into `~/.julia` Added registry `General` to `~/.julia/registries/General` Installed IniFile ───────────────────── v0.5.0 Installed JSON2 ─────────────────────── v0.3.2 Installed SentinelArrays ────────────── v1.2.16 Installed PooledArrays ──────────────── v0.5.3 Installed Formatting ────────────────── v0.4.2 Installed Libiconv_jll ──────────────── v1.16.0+7 Installed RecipesBase ───────────────── v1.1.1 Installed HTTP ──────────────────────── v0.8.19 Installed Parsers ───────────────────── v1.0.14 Installed XML2_jll ──────────────────── v2.9.10+3 Installed EzXML ─────────────────────── v1.1.0 Installed TableShowUtils ────────────── v0.2.5 Installed Compat ────────────────────── v3.24.0 Installed DataValues ────────────────── v0.4.13 Installed Reexport ──────────────────── v0.2.0 Installed DataFrames ────────────────── v0.22.1 Installed IteratorInterfaceExtensions ─ v1.0.0 Installed TableTraitsUtils ──────────── v1.0.1 Installed Requires ──────────────────── v1.1.1 Installed DataAPI ───────────────────── v1.4.0 Installed MacroTools ────────────────── v0.5.6 Installed JSON ──────────────────────── v0.21.1 Installed DataValueInterfaces ───────── v1.0.0 Installed Crayons ───────────────────── v4.0.4 Installed DocStringExtensions ───────── v0.8.3 Installed SortingAlgorithms ─────────── v0.3.1 Installed IOCapture ─────────────────── v0.1.1 Installed TableTraits ───────────────── v1.0.0 Installed PrettyTables ──────────────── v0.10.1 Installed Tables ────────────────────── v1.2.2 Installed Missings ──────────────────── v0.4.4 Installed DataStructures ────────────── v0.17.20 Installed IterableTables ────────────── v1.0.0 Installed QueryOperators ────────────── v0.9.2 Installed InvertedIndices ───────────── v1.0.0 Installed ExprTools ─────────────────── v0.1.3 Installed CategoricalArrays ─────────── v0.9.0 Installed MbedTLS ───────────────────── v1.0.3 Installed JLLWrappers ───────────────── v1.1.3 Installed OAuth ─────────────────────── v1.0.0 Installed Redis ─────────────────────── v1.0.0 Installed StructTypes ───────────────── v1.1.0 Installed Mocking ───────────────────── v0.7.1 Installed Memoize ───────────────────── v0.4.3 Installed Documenter ────────────────── v0.26.0 Installed OrderedCollections ────────── v1.3.2 Installed TimeZones ─────────────────── v1.5.3 Installed Query ─────────────────────── v1.0.0 Installed CSV ───────────────────────── v0.8.2 Building TimeZones → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/4ba8a9579a243400db412b50300cd61d7447e583/build.log` ┌ Warning: Could not use exact versions of packages in manifest, re-resolving └ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1526 [...] 48 dependencies successfully precompiled in 75 seconds (3 already precompiled) 1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package Precompiling project... ✗ Garmin 0 dependencies successfully precompiled in 3 seconds (51 already precompiled) ERROR: The following 1 direct dependency failed to precompile: Garmin [35c094c0-a0b1-4c3d-ae05-e3c7df0ab1e1] ERROR: LoadError: LoadError: LoadError: ArgumentError: Unable to find time zone "Europe/Amsterdam". Try running `TimeZones.build()`. Stacktrace: [1] (::TimeZones.var"#3#4"{String})() @ TimeZones ~/.julia/packages/TimeZones/K98G0/src/types/timezone.jl:56 [2] get!(default::TimeZones.var"#3#4"{String}, h::Dict{String, Tuple{Dates.TimeZone, TimeZones.Class}}, key::String) @ Base ./dict.jl:465 [...] ```
Logs for the passing build ``` julia version 1.6.1 done ┌ Warning: The Pkg REPL interface is intended for interactive use, use with caution from scripts. └ @ Pkg.REPLMode /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/REPLMode/REPLMode.jl:378 Installing known registries into `~/.julia` Added registry `General` to `~/.julia/registries/General` Updating registry at `~/.julia/registries/General` Installed Memoize ───────────────────── v0.4.4 Installed JSON2 ─────────────────────── v0.3.2 Installed OAuth ─────────────────────── v1.0.0 Installed Query ─────────────────────── v1.0.0 Installed HTTP ──────────────────────── v0.8.19 Installed MbedTLS ───────────────────── v1.0.3 Installed Redis ─────────────────────── v1.0.0 Installed Formatting ────────────────── v0.4.2 Installed TimeZones ─────────────────── v1.5.4 Installed RecipesBase ───────────────── v1.1.1 Installed SentinelArrays ────────────── v1.2.16 Installed PooledArrays ──────────────── v1.2.1 Installed IniFile ───────────────────── v0.5.0 Installed Libiconv_jll ──────────────── v1.16.0+7 Installed DataFrames ────────────────── v1.0.2 Installed Parsers ───────────────────── v1.1.0 Installed XML2_jll ──────────────────── v2.9.11+0 Installed Compat ────────────────────── v3.27.0 Installed Reexport ──────────────────── v1.0.0 Installed Preferences ───────────────── v1.2.1 Installed DataValues ────────────────── v0.4.13 Installed TableShowUtils ────────────── v0.2.5 Installed Documenter ────────────────── v0.26.3 Installed EzXML ─────────────────────── v1.1.0 Installed IteratorInterfaceExtensions ─ v1.0.0 Installed Requires ──────────────────── v1.1.3 Installed TableTraitsUtils ──────────── v1.0.1 Installed DataAPI ───────────────────── v1.6.0 Installed JSON ──────────────────────── v0.21.1 Installed MacroTools ────────────────── v0.5.6 Installed DataValueInterfaces ───────── v1.0.0 Installed DocStringExtensions ───────── v0.8.4 Installed Crayons ───────────────────── v4.0.4 Installed IOCapture ─────────────────── v0.1.1 Installed SortingAlgorithms ─────────── v1.0.0 Installed TableTraits ───────────────── v1.0.1 Installed CSV ───────────────────────── v0.8.4 Installed Tables ────────────────────── v1.4.2 Installed Missings ──────────────────── v0.4.5 Installed DataStructures ────────────── v0.18.9 Installed PrettyTables ──────────────── v1.0.1 Installed IterableTables ────────────── v1.0.0 Installed QueryOperators ────────────── v0.9.3 Installed ExprTools ─────────────────── v0.1.3 Installed InvertedIndices ───────────── v1.0.0 Installed Mocking ───────────────────── v0.7.1 Installed JLLWrappers ───────────────── v1.3.0 Installed OrderedCollections ────────── v1.4.0 ```

I notice that the TimeZones versions differ. So, maybe this has already been fixed?

omus commented 3 years ago

I'm not having any luck reproducing the problem today. The failures previously seemed limited to Julia 1.6.0 and TimeZones 1.5.3.

I notice that the TimeZones versions differ. So, maybe this has already been fixed?

The new 1.5.4 release mainly adds tz2021a as the default release. The only way I could see this fixing the issue is if people are using JULIA_TZ_VERSION=latest with 1.5.3.

I'll take another run at this but I may need more information.

iamed2 commented 2 years ago

We're still observing this with Julia 1.6.5 and TimeZones 1.7.0. It's hard to predict when it will happen but it seems to happen periodically on users' machines (the issue is mitigated in CI where we call Pkg.build() explicitly).

omus commented 1 year ago

In PR https://github.com/JuliaTime/TimeZones.jl/pull/441 the deps/build.jl was removed so this is no longer an issue. Included in TimeZones release 1.12.