Skip to content

Commit

Permalink
Working on precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Nov 29, 2022
1 parent af051cd commit d1546e1
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions templates/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,24 @@ let
export JULIA_SSL_CA_ROOTS_PATH="${cacert}/etc/ssl/certs/ca-bundle.crt"
# Turn off auto precompile so it can be controlled by us below
export JULIA_PKG_PRECOMPILE_AUTO=0
export JULIA_DEPOT_PATH=$out
julia -e ' \
using Pkg
Pkg.Registry.add(RegistrySpec(path="${registry}"))
import Pkg
Pkg.Registry.add(Pkg.RegistrySpec(path="${registry}"))
Pkg.activate(".")
Pkg.instantiate()
if "precompile" in keys(ENV) && ENV["precompile"] != "0"
Pkg.precompile()
end
# Remove the registry to save space
Pkg.Registry.rm("General")
'
if [[ -n "$precompile" ]]; then
julia -e ' \
using Pkg
Pkg.activate(".")
Pkg.precompile()
'
fi
'';

startupJl = writeText "startup.jl" ''
Expand Down

0 comments on commit d1546e1

Please sign in to comment.