Skip to content

Commit 38e0c38

Browse files
committed
Work around symlink loop bug
Julia has a bug with `walkdir()` and symlink loops: JuliaLang/julia#35006
1 parent a2512fc commit 38e0c38

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/wizard/utils.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,18 @@ function with_logfile(f::Function, logfile::String)
267267
end
268268

269269
function prepare_for_deletion(prefix::String)
270-
for (root, dirs, files) in walkdir(prefix)
271-
for d in dirs
272-
# Ensure that each directory is writable by by the owning user (should be us)
273-
path = joinpath(root, d)
274-
try
275-
chmod(path, stat(path).mode | Base.Filesystem.S_IWUSR)
276-
catch
270+
# Temporarily work around walkdir bug with endless symlinks: https://github.com/JuliaLang/julia/pull/35006
271+
try
272+
for (root, dirs, files) in walkdir(prefix; follow_symlinks=false)
273+
for d in dirs
274+
# Ensure that each directory is writable by by the owning user (should be us)
275+
path = joinpath(root, d)
276+
try
277+
chmod(path, stat(path).mode | Base.Filesystem.S_IWUSR)
278+
catch
279+
end
277280
end
278281
end
282+
catch
279283
end
280284
end

0 commit comments

Comments
 (0)