Skip to content

Drop WebCacheUtilities (and Lazy, TimeZones) - #106

Open
KristofferC wants to merge 3 commits into
mainfrom
drop-webcacheutilities
Open

Drop WebCacheUtilities (and Lazy, TimeZones)#106
KristofferC wants to merge 3 commits into
mainfrom
drop-webcacheutilities

Conversation

@KristofferC

Copy link
Copy Markdown
Member

Closes #105.

VersionsJSONUtil used exactly two functions from WebCacheUtilities — download_to_cache and hit_file_cache, a ~30-line mtime-TTL file cache — but that dependency pulls in Plots, StatsPlots, DataFrames, CSV, Gumbo and friends. With it gone (along with Lazy, used only for three @forward macros, and TimeZones, which was not referenced in the source at all), the Manifest shrinks from 253 packages to 51.

The TTL cache was also an active bug in CI, not just bloat: it stores its data inside the installed package directory, which julia-actions/cache snapshots into the depot cache, so a julia_tags.json cached in one run survives into later runs and is trusted for 24h of mtime. Today's workflow_dispatch with only-version=1.10.12 failed with 1.10.12 is not a tag in the JuliaLang/julia repository (run) because the restored tag list predated the tag push; it only succeeded after manually deleting the Actions caches.

Changes:

  • get_tags() now always fetches the tag list fresh (one API call per run).
  • Binary/asc downloads go to a plain mktempdir(); the sha256/tree-hash results are computed directly instead of being cached to files. Caching bought nothing in CI anyway — every run starts on a fresh runner, and the depot cache preserving it across runs is exactly the failure mode above.
  • Lazy.@forward replaced by a small @eval loop.

Tests pass locally (51/51 on Julia 1.10), plus a manual smoke test of get_tags() (sees v1.10.12), download_file (success + non-200 throws), and the wrapper triplet/arch forwarding.

🤖 Generated with Claude Code

VersionsJSONUtil used exactly two functions from WebCacheUtilities:
download_to_cache and hit_file_cache, a ~30-line mtime-TTL file cache.
That dependency pulled in Plots, StatsPlots, DataFrames, CSV, Gumbo and
friends -- the Manifest shrinks from 253 packages to 51 (fixes #105).

The TTL cache was also an active bug in CI: it stores its data inside
the installed package directory, which julia-actions/cache snapshots
into the depot cache, so a julia_tags.json cached in an earlier run
survives into later runs. A workflow_dispatch with only-version=1.10.12
today failed with "1.10.12 is not a tag" because the restored tag list
predated the tag push. get_tags() now always fetches fresh, and file
downloads go to a plain mktempdir() -- caching bought nothing in CI
anyway, since every run starts on a fresh runner.

Also replaced Lazy's @forward with a small @eval loop (its only use)
and removed TimeZones, which was not referenced in the source at all.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread src/VersionsJSONUtil.jl Outdated
"https://api.github.com/repos/JuliaLang/julia/git/refs/tags",
)
JSON.parse(String(read(tags_json_path)))
response = HTTP.get("https://api.github.com/repos/JuliaLang/julia/git/refs/tags")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It would be nice to have the ability to authenticate this GitHub API call with a read-only token. We could use GitHub.jl, or do it manually.
  2. How does pagination work here? What if the list of tags is too long to fit into one page?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Added (but using HTTP.jl)

  2. This endpoint is not paginated.

Comment thread src/VersionsJSONUtil.jl
Co-authored-by: Dilum Aluthge <5619885+DilumAluthge@users.noreply.github.com>
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.

Drop WebCacheUtilities

2 participants