# Pkg within compiled app \[PackageCompiler\]

**URL:** <https://discourse.julialang.org/t/pkg-within-compiled-app-packagecompiler/94963>\
**Category:** Performance\
**Tags:** question\
**Created:** [February 21, 2023, 12:50pm UTC](https://discourse.julialang.org/t/pkg-within-compiled-app-packagecompiler/94963 "2023-02-21T12:50:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [February 21, 2023, 12:50pm UTC](https://discourse.julialang.org/t/pkg-within-compiled-app-packagecompiler/94963/1 "2023-02-21T12:50:25Z")

</div>

Hi,  
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`?

---

<div class="post-metadata">

**Author:** ![Ashlin\_Harris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ashlin_harris/32/210166_2.png) [@Ashlin\_Harris](https://discourse.julialang.org/u/Ashlin_Harris)\
**Post date:** [February 21, 2023, 5:49pm UTC](https://discourse.julialang.org/t/pkg-within-compiled-app-packagecompiler/94963/2 "2023-02-21T17:49:57Z")

</div>

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](https://github.com/JuliaLang/PackageCompiler.jl/issues/719) 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](https://discourse.julialang.org/t/secure-systems-an-alternate-use-case-for-packagecompiler-jl/90955).

---

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [February 21, 2023, 8:07pm UTC](https://discourse.julialang.org/t/pkg-within-compiled-app-packagecompiler/94963/3 "2023-02-21T20:07:30Z")

</div>

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