Pkg within compiled app [PackageCompiler]

I am experimenting with PackageCompiler.jl and was surprised that the app I build (using incremental=true) does not include Pkg itself.

Does someone whether this is intended and if so, whether it is possible to port a complete interactive Julia setup, including Pkg and the possibility to install new packages using PackageCompiler.create_app?

I think this might be expected behavior. If your precompiled code doesn’t explicitly call Pkg, it won’t be included in the app. The same issue affects lazy loading package, which have to be added manually.

I opened up a related issue some time ago. Since then, I’ve decided to simply use create_sysimage. In fact, if your intention is to create an interactive Julia session with some custom precompiled packages, this is probably the best way to achieve that. You don’t have to create an executable in the first place if all you need are the Julia binaries and a custom sysimage. I’ve written a tutorial on this particular use case of PackageCompiler.

1 Like

thank you very much, yes indeed I was not explicitly calling Pkg
awesome help!