diff --git a/src/Operations.jl b/src/Operations.jl index fb3a0ce472..b9a31b2fd2 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -826,16 +826,29 @@ function download_artifacts(env::EnvCache; pkg_root === nothing || push!(pkg_roots, pkg_root) end push!(pkg_roots, dirname(env.project_file)) + used_artifact_tomls = Set{String}() + download_jobs = Channel{Function}(Inf) for pkg_root in pkg_roots for (artifacts_toml, artifacts) in collect_artifacts(pkg_root; platform) # For each Artifacts.toml, install each artifact we've collected from it for name in keys(artifacts) - ensure_artifact_installed(name, artifacts[name], artifacts_toml; + # @info name + push!(download_jobs, + () -> ensure_artifact_installed(name, artifacts[name], artifacts_toml; verbose, quiet_download=!(usable_io(io)), io=io) + ) end - write_env_usage(artifacts_toml, "artifact_usage.toml") + push!(used_artifact_tomls, artifacts_toml) end end + close(download_jobs) + @sync for f in download_jobs + Threads.@spawn f() + end + + for f in used_artifact_tomls + write_env_usage(f, "artifact_usage.toml") + end end function check_artifacts_downloaded(pkg_root::String; platform::AbstractPlatform=HostPlatform()) diff --git a/src/Pkg.jl b/src/Pkg.jl index 02430efc57..50d59c7761 100644 --- a/src/Pkg.jl +++ b/src/Pkg.jl @@ -17,7 +17,7 @@ export UpgradeLevel, UPLEVEL_MAJOR, UPLEVEL_MINOR, UPLEVEL_PATCH export PreserveLevel, PRESERVE_TIERED_INSTALLED, PRESERVE_TIERED, PRESERVE_ALL_INSTALLED, PRESERVE_ALL, PRESERVE_DIRECT, PRESERVE_SEMVER, PRESERVE_NONE export Registry, RegistrySpec -public activate, add, build, compat, develop, free, gc, generate, instantiate, +public activate, add, build, compat, develop, free, gc, generate, instantiate, pin, precompile, redo, rm, resolve, status, test, undo, update, why depots() = Base.DEPOT_PATH diff --git a/src/PlatformEngines.jl b/src/PlatformEngines.jl index e9c2ea0f87..8b74c5b351 100644 --- a/src/PlatformEngines.jl +++ b/src/PlatformEngines.jl @@ -282,7 +282,7 @@ function download( (total, now) -> nothing end try - Downloads.download(url, dest; headers, progress) + Downloads.download(url, dest; headers, progress, downloader=Downloads.Downloader(; grace=0)) finally do_fancy && end_progress(io, bar) end