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

Include the tzdata version in our scratch directory structure #389

Merged
merged 10 commits into from
Jul 11, 2022

Conversation

omus
Copy link
Member

@omus omus commented Jul 9, 2022

Follow up to #384. Since we're using a scratch directory multiple TimeZones.jl packages using different versions may concurrently be using the scratch directory. If these packages use different tzdata versions we could accidentally use a different tzdata version that what is typically used by that package. To solve this I've included the tzdata version in the scratch directory structure as well as included the tzjfile version. To make this work properly I ended up using Refs to some of the directories so it's possible to update the tzdata version being used.

Base automatically changed from cv/scratch-followup to master July 10, 2022 05:00
@omus omus force-pushed the cv/scratch-tzdata-version branch from fdf9929 to 668e7e2 Compare July 10, 2022 05:04
test/ci.jl Show resolved Hide resolved
src/TimeZones.jl Outdated Show resolved Hide resolved
@omus
Copy link
Member Author

omus commented Jul 11, 2022

Windows failure:

     Building TimeZones → `D:\a\TimeZones.jl\TimeZones.jl\deps\build.log`
[ Info: Installing 2016j tzdata region data
[ Info: Converting tz source files into TimeZone data
[ Info: Downloading Windows to POSIX timezone ID XML version: release-40
ERROR: LoadError: InitError: IOError: open("C:\\Users\\runneradmin\\.julia\\scratchspaces\\f269a46b-ccf7-5d73-abea-4c690281aa53\\build\\local\\windowsZones.xml", 769, 33206): no such file or directory (ENOENT)
Stacktrace:
  [1] uv_error
    @ .\libuv.jl:100 [inlined]
  [2] open(path::String, flags::UInt16, mode::UInt64)
    @ Base.Filesystem .\filesystem.jl:122
  [3] sendfile(src::String, dst::String)
    @ Base.Filesystem .\file.jl:994
  [4] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
    @ Base.Filesystem .\file.jl:384
  [5] build(xml_file::String; force::Bool)
    @ TimeZones.WindowsTimeZoneIDs D:\a\TimeZones.jl\TimeZones.jl\src\winzone\WindowsTimeZoneIDs.jl:47
  [6] build(version::String; force::Bool)
    @ TimeZones D:\a\TimeZones.jl\TimeZones.jl\src\build.jl:14
  [7] build(version::String)
    @ TimeZones D:\a\TimeZones.jl\TimeZones.jl\src\build.jl:10
  [8] __init__()
    @ TimeZones D:\a\TimeZones.jl\TimeZones.jl\src\TimeZones.jl:56
...

@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2022

Codecov Report

Merging #389 (f7a901c) into master (7b6eb43) will decrease coverage by 1.83%.
The diff coverage is 75.51%.

❗ Current head f7a901c differs from pull request most recent head 015c2de. Consider uploading reports for the commit 015c2de to get more accurate results

@@            Coverage Diff             @@
##           master     #389      +/-   ##
==========================================
- Coverage   95.23%   93.40%   -1.84%     
==========================================
  Files          36       36              
  Lines        1743     1758      +15     
==========================================
- Hits         1660     1642      -18     
- Misses         83      116      +33     
Impacted Files Coverage Δ
src/winzone/WindowsTimeZoneIDs.jl 0.00% <0.00%> (-100.00%) ⬇️
src/tzdata/TZData.jl 75.00% <75.00%> (-25.00%) ⬇️
src/tzdata/build.jl 90.00% <81.25%> (+7.39%) ⬆️
src/TimeZones.jl 100.00% <100.00%> (ø)
src/build.jl 85.71% <100.00%> (-14.29%) ⬇️
src/discovery.jl 86.51% <100.00%> (ø)
src/types/timezone.jl 97.14% <100.00%> (-0.08%) ⬇️
src/tzdata/compile.jl 92.48% <100.00%> (-2.95%) ⬇️
src/tzdata/download.jl 96.96% <100.00%> (+5.79%) ⬆️
src/tzdata/version.jl 74.19% <100.00%> (+5.22%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b6eb43...015c2de. Read the comment docs.

@omus
Copy link
Member Author

omus commented Jul 11, 2022

Not loving the coverage reduction but I don't think that should hold this up.

@omus omus merged commit d4a1d3a into master Jul 11, 2022
@omus omus deleted the cv/scratch-tzdata-version branch July 11, 2022 04:51
@StefanKarpinski
Copy link
Member

Seems better to use separate scratch spaces for different versions of the tzdata, no? That way the pkg gc can clean up no longer uesd tzdata; otherwise old ztdata will accumulate over time, taking up more and more space.

@omus
Copy link
Member Author

omus commented Jul 11, 2022

Seems better to use separate scratch spaces for different versions of the tzdata, no? That way the pkg gc can clean up no longer uesd tzdata; otherwise old ztdata will accumulate over time, taking up more and more space.

Good point I wasn't really considering. I can make a follow up issue for that.

kpamnany pushed a commit to RelationalAI-oss/TimeZones.jl that referenced this pull request May 5, 2023
…ime#389)

* Make tzdata_version return a specific version

* Include tzdata version in scratch directory

* Mark new constants as internal

* Allow build to return additional information

* Restore winzone directory creation

* Refactor test/ci.jl
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.

3 participants