Skip to content

Commit d1546e1

Browse files
committed
Working on precompile
1 parent af051cd commit d1546e1

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

templates/common.nix

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,25 +127,24 @@ let
127127
128128
export JULIA_SSL_CA_ROOTS_PATH="${cacert}/etc/ssl/certs/ca-bundle.crt"
129129
130+
# Turn off auto precompile so it can be controlled by us below
131+
export JULIA_PKG_PRECOMPILE_AUTO=0
132+
130133
export JULIA_DEPOT_PATH=$out
131134
julia -e ' \
132-
using Pkg
133-
Pkg.Registry.add(RegistrySpec(path="${registry}"))
135+
import Pkg
136+
Pkg.Registry.add(Pkg.RegistrySpec(path="${registry}"))
134137
135138
Pkg.activate(".")
136139
Pkg.instantiate()
137140
141+
if "precompile" in keys(ENV) && ENV["precompile"] != "0"
142+
Pkg.precompile()
143+
end
144+
138145
# Remove the registry to save space
139146
Pkg.Registry.rm("General")
140147
'
141-
142-
if [[ -n "$precompile" ]]; then
143-
julia -e ' \
144-
using Pkg
145-
Pkg.activate(".")
146-
Pkg.precompile()
147-
'
148-
fi
149148
'';
150149

151150
startupJl = writeText "startup.jl" ''

0 commit comments

Comments
 (0)