From 7d1fdbba10e25fd3c50830c66a9e5e56f3f4c5c6 Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Sun, 24 Dec 2023 17:39:39 +0100 Subject: [PATCH] Fix `with_libgfortran()` with multiple libpath directories 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) --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index e29bb5708..b1d2d03e6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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