From 99e37b8b1a3fdd307b0ed312310ee7786055cb5b Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 13 Oct 2020 14:05:05 -0700 Subject: [PATCH 1/5] Fix Windows double-adjustment of `PATH` On windows, `LIBPATH_env` == `"PATH"`, and we don't want to double-adjust `PATH`. We need to be careful around the `adjust_XXX` flags here, to ensure that if we don't want to adjust `LIBPATH` but do want to adjust `PATH` (as much as that makes sense on Windows) we only use the `PATH_list` and not the `LIBPATH_list` --- src/runtime.jl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/runtime.jl b/src/runtime.jl index bc120f8..e609ba0 100644 --- a/src/runtime.jl +++ b/src/runtime.jl @@ -14,13 +14,6 @@ else end function adjust_ENV!(env::Dict, PATH::String, LIBPATH::String, adjust_PATH::Bool, adjust_LIBPATH::Bool) - if adjust_PATH - if !isempty(get(env, "PATH", "")) - env["PATH"] = string(PATH, pathsep, env["PATH"]) - else - env["PATH"] = PATH - end - end if adjust_LIBPATH LIBPATH_base = get(env, LIBPATH_env, expanduser(LIBPATH_default)) if !isempty(LIBPATH_base) @@ -29,6 +22,15 @@ function adjust_ENV!(env::Dict, PATH::String, LIBPATH::String, adjust_PATH::Bool env[LIBPATH_env] = LIBPATH end end + if adjust_PATH && (LIBPATH_env != "PATH" || !adjust_LIBPATH) + if adjust_PATH + if !isempty(get(env, "PATH", "")) + env["PATH"] = string(PATH, pathsep, env["PATH"]) + else + env["PATH"] = PATH + end + end + end return env end From 0f0bc2058cf2e2ea42173362885aa8f9c2f65494 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 13 Oct 2020 14:06:05 -0700 Subject: [PATCH 2/5] Add `Sys.BINDIR` to `JULIA_LIBDIRS` on Windows --- src/runtime.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime.jl b/src/runtime.jl index e609ba0..ae1c9d3 100644 --- a/src/runtime.jl +++ b/src/runtime.jl @@ -85,6 +85,10 @@ Return the library paths that e.g. libjulia and such are stored in. function get_julia_libpaths() if isempty(JULIA_LIBDIRS) append!(JULIA_LIBDIRS, [joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)]) + # Windows needs to see the BINDIR as well + @static if Sys.iswindows() + push!(JULIA_LIBDIRS, Sys.BINDIR) + end end return JULIA_LIBDIRS end From a0237c92c8c9ac941379026f98e35ba1d00ff547 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 13 Oct 2020 15:22:14 -0700 Subject: [PATCH 3/5] Add test for `BINDIR` on windows --- test/runtests.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index ad9f197..7421016 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -41,5 +41,10 @@ module TestJLL end @test isdir(@eval TestJLL OpenLibm_jll.artifact_dir) @test isempty(@eval TestJLL OpenLibm_jll.PATH[]) @test occursin(Sys.BINDIR, @eval TestJLL OpenLibm_jll.LIBPATH[]) + + # Issue #20 + if Sys.iswindows() + @test occursin(Sys.BINDIR, JLLWrappers.get_julia_libpaths()) + end end end From 649e8bb6f20c070c783190b104d4daede83c48d2 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 13 Oct 2020 15:21:57 -0700 Subject: [PATCH 4/5] Bump version number for release --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index aecb390..516e891 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "JLLWrappers" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" authors = ["Mosè Giordano", "Elliot Saba"] -version = "1.1.1" +version = "1.1.2" [compat] julia = "1.0.0" From 79da5226e650d2e8bee968c69ab1d77d78065f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 13 Oct 2020 23:33:13 +0100 Subject: [PATCH 5/5] Fix test --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 7421016..a068706 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -44,7 +44,7 @@ module TestJLL end # Issue #20 if Sys.iswindows() - @test occursin(Sys.BINDIR, JLLWrappers.get_julia_libpaths()) + @test Sys.BINDIR ∈ JLLWrappers.get_julia_libpaths() end end end