Skip to content

Commit

Permalink
Fix with_libgfortran() with multiple libpath directories
Browse files Browse the repository at this point in the history
The creation of `libpath_list` assumed that there would only be one directory in
`LD_LIBRARY_PATH` (or the equivalents on other platforms), if there were more
then creating the list would fail because Julia would try to `hcat()` all the
elements together and throw an error about them having different
lengths.

Somewhat scarily, this would've silently done the wrong thing if `libpath_list`
was a column vector instead of a row vector O_o (i.e. if it originally had a
comma between the elements)
  • Loading branch information
JamesWrigley committed Jan 2, 2024
1 parent 3bdbf48 commit 7d1fdbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ else
("LD_LIBRARY_PATH", ":")
end
function with_libgfortran(f::Function)
libpath_list = [csl_path split(get(ENV, LIBPATH_var, ""), envsep)]
libpath_list = [csl_path, split(get(ENV, LIBPATH_var, ""), envsep)...]
libpath = join(filter(x -> !isempty(x), libpath_list), envsep)
withenv(f, LIBPATH_var => libpath)
end
Expand Down

0 comments on commit 7d1fdbb

Please sign in to comment.