You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, propagate Base.active_project(), Base.LOAD_PATH, and Base.DEPOT_PATH to the workers (but allow the user to override that behavior by specifying JULIA_{PROJECT,LOAD_PATH,DEPOT_PATH} in params[:env]
# In Julia 1.6 through 1.8, the no-argument method `Distributed.default_addprocs_params()`
@@ -72,6 +72,73 @@ elseif Base.VERSION < v"1.6.0"
72
72
# so we will just choose to not support `params[:env]` on Julia 1.5 and earlier.
73
73
end
74
74
75
+
function _new_environment_additions(params_env::Dict{String, String})
76
+
env2 = Dict{String, String}()
77
+
user_did_specify = Dict{String, Bool}
78
+
user_did_specify_JULIA_PROJECT =false
79
+
user_did_specify_JULIA_LOAD_PATH =false
80
+
user_did_specify_JULIA_DEPOT_PATH =false
81
+
82
+
for (name, value) in pairs(params_env)
83
+
# For each key-value mapping in `params[:env]`, we respect that mapping and we pass it
84
+
# to the workers.
85
+
env2[name] = value
86
+
87
+
# If the user did specify `JULIA_{PROJECT,LOAD_PATH,DEPOT_PATH}` in `params[:env]`, then
88
+
# we respect that value, and we pass it to the workers.
89
+
if name =="JULIA_PROJECT"
90
+
user_did_specify_JULIA_PROJECT =true
91
+
@debug "The user did specify a value for JULIA_PROJECT in the `env` kwarg to `addprocs()`; that value will be passed to the workers" env2[JULIA_PROJECT]
92
+
end
93
+
if name =="JULIA_LOAD_PATH"
94
+
user_did_specify_JULIA_LOAD_PATH =true
95
+
@debug "The user did specify a value for JULIA_LOAD_PATH in the `env` kwarg to `addprocs()`; that value will be passed to the workers" env2[JULIA_LOAD_PATH]
96
+
end
97
+
if name =="JULIA_DEPOT_PATH"
98
+
user_did_specify_JULIA_DEPOT_PATH =true
99
+
@debug "The user did specify a value for JULIA_DEPOT_PATH in the `env` kwarg to `addprocs()`; that value will be passed to the workers" env2[JULIA_DEPOT_PATH]
100
+
end
101
+
end
102
+
103
+
directory_separator = Sys.iswindows ?';':':'
104
+
105
+
# If the user did not specify `JULIA_PROJECT` in `params[:env]`, then we pass
106
+
# JULIA_PROJECT=Base.active_project() to the workers.
107
+
#
108
+
# This use case is commonly hit when the user does NOT set the `JULIA_PROJECT` environment
109
+
# variable but DOES start Julia with either `julia --project` or `julia --project=something`.
0 commit comments