Skip to content

Commit

Permalink
Use the proper destdir for cleanup_dependencies (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
barche authored Apr 18, 2021
1 parent 1204d3e commit 1692d85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Prefix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,13 @@ function setup_dependencies(prefix::Prefix, dependencies::Vector{PkgSpec}, platf
return artifact_paths
end

function cleanup_dependencies(prefix::Prefix, artifact_paths)
function cleanup_dependencies(prefix::Prefix, artifact_paths, platform)
for art_path in artifact_paths
# Unsymlink all destdirs within the prefix
for dir in readdir(prefix.path; join=true)
destdir = joinpath(dir, "destdir")
if isdir(destdir)
unsymlink_tree(art_path, destdir)
ddir = destdir(prefix, platform)
if isdir(ddir)
unsymlink_tree(art_path, ddir)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ end
@test readdir(joinpath(destdir(dir, platform), "logs")) == ["Zlib.log.gz"]

# Make sure the directories are emptied by `cleanup_dependencies`
@test_nowarn cleanup_dependencies(prefix, ap)
@test_nowarn cleanup_dependencies(prefix, ap, platform)
@test readdir(joinpath(destdir(dir, platform), "include")) == []
@test readdir(joinpath(destdir(dir, platform), "logs")) == []
end
Expand All @@ -123,7 +123,7 @@ end
@test "libssh2." * platform_dlext(platform) in readdir(last(libdirs(Prefix(destdir(dir, platform)))))

# Make sure the directories are emptied by `cleanup_dependencies`
@test_nowarn cleanup_dependencies(prefix, ap)
@test_nowarn cleanup_dependencies(prefix, ap, platform)
# This shuld be empty, but the `curl/` directory is left here, empty
@test_broken readdir(joinpath(destdir(dir, platform), "include")) == []
@test readdir(joinpath(destdir(dir, platform), "logs")) == []
Expand Down

0 comments on commit 1692d85

Please sign in to comment.