Skip to content

Commit

Permalink
Julia 1.7 compat: use a more compatible cd version (#754)
Browse files Browse the repository at this point in the history
Julia 1.7.3 would crash in a customized ubuntu 18.04 version, this
patch rewrites the crashing part with a more compatible version.

The root issue isn't identified yet, but it's verified that Julia
1.9.2 works on the same machine, so it's highly-likely fixed already.
  • Loading branch information
johnnychen94 authored Aug 4, 2023
1 parent 9339375 commit 89288a1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pkgs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,19 @@ function has_writable_paths(pkgdata::PkgData)
dir = basedir(pkgdata)
isdir(dir) || return true
haswritable = false
cd(dir) do
# Compatibility note:
# The following can be written in cd(dir) do ... end block
# but that would trigger Julia to crash for some corner cases.
# This is identified on Julia 1.7.3 + modified ubuntu 18.04, and it is
# verified that doesn't happen for Julia 1.9.2 on the same machine.
current_dir = pwd()
try
cd(dir)
for file in srcfiles(pkgdata)
haswritable |= iswritable(file)
end
finally
cd(current_dir)
end
return haswritable
end
Expand Down

0 comments on commit 89288a1

Please sign in to comment.