Hello,
I am using a bash script to create a new system image when the source code, in particular the set of used packages of my project has changed (after git pull).
The core are the following three lines:
rm -f Manifest.toml
julia --project -e "include(\"./test/update_packages.jl\");"
julia --project -e "using Pkg; Pkg.precompile()"
julia --project -e "include(\"./test/create_sys_image.jl\");"
This is the content of the file update_packages.jl:
@info "Updating packages ..."
using Pkg
Pkg.instantiate()
Pkg.update()
Pkg.precompile()
Explanation:
- I need to delete Manifest.toml, because in the git repository the content
of Project.toml sometimes changes, and I get an error message if new packages
are added if I do not delete Manifest.toml - The update_packages.jl script sometimes fails with the message:
“Not all packages could be precompiled. Please restart Julia and try again…”
The third line of the bash script is doing that. - This is the main script to create a new system image. Before executing it I
want to be sure that all packages are up-to-date.
While this works fine, I wonder if there is a way to achieve the same goal without
using bash, because bash might not be available on Windows or Mac.
Any ideas how to do that in pure Julia?
I think this kind of functionality should become part of base.
Uwe