Skip to content

Commit

Permalink
Update for v1.12 (#19)
Browse files Browse the repository at this point in the history
* Properly delete the nightly build, and do actual multithreading

* Update for v1.12
  • Loading branch information
staticfloat authored Jun 2, 2024
1 parent aae6fec commit d96bbec
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 23 deletions.
11 changes: 6 additions & 5 deletions ext/HistoricalStdlibGenerator/generate_historical_stdlibs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ push!(version_urls, (generate_nightly_url(nothing), ""))
scratch_dir = @get_scratch!("julia_installers")

# Ensure we always download the nightly
rm(joinpath(scratch_dir, basename(last(version_urls)[1])); force=true)
nightly_url = last(version_urls)[1]
nightly_url_tag = bytes2hex(sha256(nightly_url))
rm(joinpath(scratch_dir, string(nightly_url_tag, "-", basename(nightly_url))); force=true)

# Helper function to print out stdlibs from a Julia installation
function get_stdlibs(scratch_dir, julia_installer_name)
Expand All @@ -89,7 +91,6 @@ function get_stdlibs(scratch_dir, julia_installer_name)
sleep(0.1)
tries += 1
end
#@show readdir(mount_dir; join=true)
app_dir = first(filter(d -> startswith(basename(d), "Julia-"), readdir(mount_dir; join=true)))
symlink(joinpath(app_dir, "Contents", "Resources", "julia", "bin"), joinpath(dir, "bin"))
elseif endswith(installer_path, ".exe")
Expand Down Expand Up @@ -154,16 +155,16 @@ versions_dict = Dict()

@sync begin
# Feeder task
@async begin
Threads.@spawn begin
for (url, hash) in version_urls
put!(jobs, (url, hash))
end
close(jobs)
end

# Consumer tasks
for _ in 1:num_concurrent_downloads
@async begin
for _ in 1:Threads.nthreads()
Threads.@spawn begin
for (url, hash) in jobs
try
# We might try to download two files that have the same basename
Expand Down
Loading

0 comments on commit d96bbec

Please sign in to comment.