Skip to content

Commit

Permalink
Fix environment variable passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Jul 29, 2022
1 parent c084a63 commit 5b74dc9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/evaluate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,20 @@ failure reason if any (both represented by a symbol), and the full log.
Refer to `sandboxed_julia`[@ref] for more possible `keyword arguments.
"""
function sandboxed_script(config::Configuration, script::String, args=``; kwargs...)
function sandboxed_script(config::Configuration, script::String, args=``;
env::Dict{String,String}=Dict{String,String}(), kwargs...)
@assert config.log_limit > 0

cmd = `--eval 'eval(Meta.parse(read(stdin,String)))' $args`

env = Dict(
env = merge(env, Dict(
# we're likely running many instances, so avoid overusing the CPU
"JULIA_PKG_PRECOMPILE_AUTO" => "0",

# package hacks
"PYTHON" => "",
"R_HOME" => "*"
)
))
if haskey(ENV, "JULIA_PKG_SERVER")
env["JULIA_PKG_SERVER"] = ENV["JULIA_PKG_SERVER"]
end
Expand Down

0 comments on commit 5b74dc9

Please sign in to comment.