Skip to content

Commit f487626

Browse files
Merge pull request #3868 from JuliaLang/backports-release-1.10
2 parents 7052553 + e4a6078 commit f487626

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

src/API.jl

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,30 +2130,28 @@ function why(ctx::Context, pkgs::Vector{PackageSpec}; io::IO, kwargs...)
21302130

21312131
function find_paths!(final_paths, current, path = UUID[])
21322132
push!(path, current)
2133-
if !(current in values(ctx.env.project.deps))
2134-
for p in incoming[current]
2135-
if p in path
2136-
# detected dependency cycle and none of the dependencies in the cycle
2137-
# are in the project could happen when manually modifying
2138-
# the project and running this function function before a
2139-
# resolve
2140-
continue
2141-
end
2142-
find_paths!(final_paths, p, copy(path))
2133+
current in values(ctx.env.project.deps) && push!(final_paths, path) # record once we've traversed to a project dep
2134+
haskey(incoming, current) || return # but only return if we've reached a leaf that nothing depends on
2135+
for p in incoming[current]
2136+
if p in path
2137+
# detected dependency cycle and none of the dependencies in the cycle
2138+
# are in the project could happen when manually modifying
2139+
# the project and running this function function before a
2140+
# resolve
2141+
continue
21432142
end
2144-
else
2145-
push!(final_paths, path)
2143+
find_paths!(final_paths, p, copy(path))
21462144
end
21472145
end
21482146

21492147
first = true
21502148
for pkg in pkgs
21512149
!first && println(io)
21522150
first = false
2153-
final_paths = []
2151+
final_paths = Set{Vector{UUID}}()
21542152
find_paths!(final_paths, pkg.uuid)
21552153
foreach(reverse!, final_paths)
2156-
final_paths_names = map(x -> [ctx.env.manifest[uuid].name for uuid in x], final_paths)
2154+
final_paths_names = map(x -> [ctx.env.manifest[uuid].name for uuid in x], collect(final_paths))
21572155
sort!(final_paths_names, by = x -> (x, length(x)))
21582156
delimiter = sprint((io, args) -> printstyled(io, args...; color=:light_green), "", context=io)
21592157
for path in final_paths_names

src/Artifacts.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,20 @@ function with_show_download_info(f, io, name, quiet_download)
476476
fancyprint && print_progress_bottom(io)
477477
printpkgstyle(io, :Downloading, "artifact: $name")
478478
end
479+
success = false
479480
try
480-
return f()
481+
result = f()
482+
success = result === true
483+
return result
481484
finally
482485
if !quiet_download
483486
fancyprint && print(io, "\033[1A") # move cursor up one line
484487
fancyprint && print(io, "\033[2K") # clear line
485-
fancyprint && printpkgstyle(io, :Downloaded, "artifact: $name")
488+
if success
489+
fancyprint && printpkgstyle(io, :Downloaded, "artifact: $name")
490+
else
491+
printpkgstyle(io, :Failure, "artifact: $name", color = :red)
492+
end
486493
end
487494
end
488495
end

src/Operations.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function fixup_ext!(env, pkgs)
182182
end
183183
end
184184
end
185+
prune_manifest(env)
185186
end
186187

187188
####################

0 commit comments

Comments
 (0)