Skip to content

Commit 591bcb5

Browse files
committed
Now working
1 parent bd446c7 commit 591bcb5

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

bin/install

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,20 @@ $_julia_cmd --project=. -e 'using Pkg; Pkg.precompile(); Pkg.activate("examples"
245245
Pkg.activate("examples_cp"); Pkg.precompile(); Pkg.activate("test"); Pkg.precompile();
246246
@info "Precompilation complete."'
247247
$_julia_cmd --project=examples -e 'using GLMakie, VortexStepMethod; @info "GLMakie extension ready."'
248-
$_julia_cmd -t1 --project=examples_cp -e 'using ControlPlots, VortexStepMethod; @info "ControlPlots extension ready."'
248+
# Julia's @load_preference bakes the CondaPkg backend into the precompiled image
249+
# at compile time. If the image was compiled before LocalPreferences.toml was
250+
# written (e.g. by a previous install_controlplots run), the baked-in value may
251+
# be stale. JULIA_CONDAPKG_BACKEND is always read at runtime and reliably
252+
# overrides the cached value, so we read the preference from the file and
253+
# forward it as an env var.
254+
_cp_lp="examples_cp/LocalPreferences.toml"
255+
if grep -q 'backend = "Null"' "$_cp_lp" 2>/dev/null; then
256+
JULIA_CONDAPKG_BACKEND=Null $_julia_cmd -t1 --project=examples_cp \
257+
-e 'using ControlPlots, VortexStepMethod; @info "ControlPlots extension ready."'
258+
else
259+
$_julia_cmd -t1 --project=examples_cp \
260+
-e 'using ControlPlots, VortexStepMethod; @info "ControlPlots extension ready."'
261+
fi
249262
$_julia_cmd --project=. -e 'using Pkg; Pkg.test(test_args=["settings/test_settings.jl"]);
250263
@info "Minimal test smoke check complete."'
251264

0 commit comments

Comments
 (0)