Skip to content

Commit

Permalink
Merge pull request #3868 from JuliaLang/backports-release-1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Apr 11, 2024
2 parents 7052553 + e4a6078 commit f487626
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
26 changes: 12 additions & 14 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2130,30 +2130,28 @@ function why(ctx::Context, pkgs::Vector{PackageSpec}; io::IO, kwargs...)

function find_paths!(final_paths, current, path = UUID[])
push!(path, current)
if !(current in values(ctx.env.project.deps))
for p in incoming[current]
if p in path
# detected dependency cycle and none of the dependencies in the cycle
# are in the project could happen when manually modifying
# the project and running this function function before a
# resolve
continue
end
find_paths!(final_paths, p, copy(path))
current in values(ctx.env.project.deps) && push!(final_paths, path) # record once we've traversed to a project dep
haskey(incoming, current) || return # but only return if we've reached a leaf that nothing depends on
for p in incoming[current]
if p in path
# detected dependency cycle and none of the dependencies in the cycle
# are in the project could happen when manually modifying
# the project and running this function function before a
# resolve
continue
end
else
push!(final_paths, path)
find_paths!(final_paths, p, copy(path))
end
end

first = true
for pkg in pkgs
!first && println(io)
first = false
final_paths = []
final_paths = Set{Vector{UUID}}()
find_paths!(final_paths, pkg.uuid)
foreach(reverse!, final_paths)
final_paths_names = map(x -> [ctx.env.manifest[uuid].name for uuid in x], final_paths)
final_paths_names = map(x -> [ctx.env.manifest[uuid].name for uuid in x], collect(final_paths))
sort!(final_paths_names, by = x -> (x, length(x)))
delimiter = sprint((io, args) -> printstyled(io, args...; color=:light_green), "", context=io)
for path in final_paths_names
Expand Down
11 changes: 9 additions & 2 deletions src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,20 @@ function with_show_download_info(f, io, name, quiet_download)
fancyprint && print_progress_bottom(io)
printpkgstyle(io, :Downloading, "artifact: $name")
end
success = false
try
return f()
result = f()
success = result === true
return result
finally
if !quiet_download
fancyprint && print(io, "\033[1A") # move cursor up one line
fancyprint && print(io, "\033[2K") # clear line
fancyprint && printpkgstyle(io, :Downloaded, "artifact: $name")
if success
fancyprint && printpkgstyle(io, :Downloaded, "artifact: $name")
else
printpkgstyle(io, :Failure, "artifact: $name", color = :red)
end
end
end
end
Expand Down
1 change: 1 addition & 0 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ function fixup_ext!(env, pkgs)
end
end
end
prune_manifest(env)
end

####################
Expand Down

0 comments on commit f487626

Please sign in to comment.