@@ -769,15 +769,19 @@ function gc(ctx::Context=Context(); collect_delay::Period=Day(7), verbose=false,
769769
770770 function recursive_dir_size (path)
771771 size = 0
772- for (root, dirs, files) in walkdir (path)
773- for file in files
774- path = joinpath (root, file)
775- try
776- size += lstat (path). size
777- catch
778- @warn " Failed to calculate size of $path "
772+ try
773+ for (root, dirs, files) in walkdir (path)
774+ for file in files
775+ path = joinpath (root, file)
776+ try
777+ size += lstat (path). size
778+ catch ex
779+ @error (" Failed to calculate size of $path " , exception= ex)
780+ end
779781 end
780782 end
783+ catch ex
784+ @error (" Failed to calculate size of $path " , exception= ex)
781785 end
782786 return size
783787 end
@@ -1292,9 +1296,7 @@ function instantiate(ctx::Context; manifest::Union{Bool, Nothing}=nothing,
12921296 " Otherwise, remove `$name ` with `Pkg.rm(\" $name \" )`." ,
12931297 " Finally, run `Pkg.instantiate()` again." )
12941298 end
1295- # TODO : seems to be a bug in is_instantiated on the line below so we have to download
1296- # artifacts here even though we do the same at the end of this function
1297- Operations. download_artifacts (ctx, [dirname (ctx. env. manifest_file)]; platform= platform, verbose= verbose)
1299+
12981300 # check if all source code and artifacts are downloaded to exit early
12991301 if Operations. is_instantiated (ctx)
13001302 allow_autoprecomp && Pkg. _auto_precompile (ctx)
@@ -1347,10 +1349,14 @@ function instantiate(ctx::Context; manifest::Union{Bool, Nothing}=nothing,
13471349
13481350 # Install all packages
13491351 new_apply = Operations. download_source (ctx, pkgs)
1350- # Install all artifacts
1351- Operations. download_artifacts (ctx, pkgs; platform= platform, verbose= verbose)
1352+ # Install artifacts for deps and artifacts for current package, if applicable
1353+ art_pkgs = copy (pkgs)
1354+ if ctx. env. pkg != = nothing
1355+ push! (art_pkgs, ctx. env. pkg)
1356+ end
1357+ Operations. download_artifacts (ctx, art_pkgs; platform, verbose)
13521358 # Run build scripts
1353- Operations. build_versions (ctx, union (UUID[pkg. uuid for pkg in new_apply], new_git); verbose= verbose )
1359+ Operations. build_versions (ctx, union (UUID[pkg. uuid for pkg in new_apply], new_git); verbose)
13541360
13551361 allow_autoprecomp && Pkg. _auto_precompile (ctx; kwargs... )
13561362end
0 commit comments