Skip to content

Commit

Permalink
InteractiveUtils.versioninfo(): print the value of the `LD_LIBRARY_…
Browse files Browse the repository at this point in the history
…PATH` or `DYLD_LIBRARY_PATH` environment variables if they are set (JuliaLang#43609)
  • Loading branch information
DilumAluthge committed Jan 10, 2022
1 parent 31dfef6 commit a7e4f6d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions stdlib/InteractiveUtils/src/InteractiveUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,18 @@ function versioninfo(io::IO=stdout; verbose::Bool=false)
println(io, " LIBM: ",Base.libm_name)
println(io, " LLVM: libLLVM-",Base.libllvm_version," (", Sys.JIT, ", ", Sys.CPU_NAME, ")")

env_strs = [String[ " $(k) = $(v)" for (k,v) in ENV if occursin(r"JULIA", k)];
(verbose ?
String[ " $(k) = $(v)" for (k,v) in ENV if occursin(r"PATH|FLAG|^TERM$|HOME", k)] :
[])]
function is_nonverbose_env(k::String)
return occursin(r"^JULIA_|^DYLD_|^LD_", k)
end
function is_verbose_env(k::String)
return occursin(r"PATH|FLAG|^TERM$|HOME", k)
end
env_strs = String[
String[" $(k) = $(v)" for (k,v) in ENV if is_nonverbose_env(uppercase(k))];
(verbose ?
String[" $(k) = $(v)" for (k,v) in ENV if is_verbose_env(uppercase(k))] :
String[]);
]
if !isempty(env_strs)
println(io, "Environment:")
for str in env_strs
Expand Down

0 comments on commit a7e4f6d

Please sign in to comment.