Skip to content

Commit

Permalink
Merge pull request #14 from JuliaPackaging/mg/path-var
Browse files Browse the repository at this point in the history
Revert `Ref` around the path variable
  • Loading branch information
staticfloat committed Sep 21, 2020
2 parents 32c80b6 + 8208fcc commit bc3b6af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/products/executable_generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ function declare_old_executable_product(product_name)
return Base.invokelatest(
JLLWrappers.withenv_executable_wrapper,
f,
$(Symbol("$(product_name)_path"))[],
$(Symbol("$(product_name)_path")),
PATH[],
LIBPATH[],
adjust_PATH,
adjust_LIBPATH,
)
end

$(path_name) = Ref{String}()
# This will eventually be replaced with a `Ref{String}`
$(path_name) = ""
function $(Symbol(string("get_", product_name, "_path")))()
return $(path_name)[]
return $(path_name)::String
end
end
end
Expand All @@ -38,7 +39,7 @@ function declare_new_executable_product(product_name)
adjust_PATH,
adjust_LIBPATH,
)
return Cmd(Cmd([$(path_name)[]]); env)
return Cmd(Cmd([$(path_name)]); env)
end

# Signal to concerned parties that they should use the new version, eventually.
Expand All @@ -60,7 +61,7 @@ macro init_executable_product(product_name, product_path)
path_name = Symbol(string(product_name, "_path"))
return esc(quote
# Locate the executable on-disk, store into $(path_name)
$(path_name)[] = joinpath(artifact_dir, $(product_path))
global $(path_name) = joinpath(artifact_dir, $(product_path))

# Add this executable's directory onto the list of PATH's that we'll need to expose to dependents
push!(PATH_list, joinpath(artifact_dir, $(dirname(product_path))))
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module TestJLL end
else
@test @eval TestJLL HelloWorldC_jll.is_available()
@test "Hello, World!" == @eval TestJLL hello_world(h->readchomp(`$h`))
@test isfile(@eval TestJLL HelloWorldC_jll.hello_world_path[])
@test isfile(@eval TestJLL HelloWorldC_jll.hello_world_path)
@test isfile(@eval TestJLL HelloWorldC_jll.get_hello_world_path())
@test isdir(@eval TestJLL HelloWorldC_jll.artifact_dir)
@test !isempty(@eval TestJLL HelloWorldC_jll.PATH[])
Expand Down

0 comments on commit bc3b6af

Please sign in to comment.