# Do you need to recompile a package when you modify non-src files

**URL:** <https://discourse.julialang.org/t/do-you-need-to-recompile-a-package-when-you-modify-non-src-files/132019>\
**Category:** New to Julia\
**Tags:** precompilation\
**Created:** [September 1, 2025, 3:22pm UTC](https://discourse.julialang.org/t/do-you-need-to-recompile-a-package-when-you-modify-non-src-files/132019 "2025-09-01T15:22:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [September 1, 2025, 3:22pm UTC](https://discourse.julialang.org/t/do-you-need-to-recompile-a-package-when-you-modify-non-src-files/132019/1 "2025-09-01T15:22:49Z")

</div>

I have problems with packages getting recompiled all the time, and I am trying to debug some of the cases (this has also happened just be restarting Julia, so there are difinitely cases where it does re-precompile when it shouldn’t)

I have a package MyPackage. It’s main folder contain a folder “src” with all the actual code files. It also contains a folder “other\_files” with e.g. .sh scripts related to coordinating the running of pacakge files on e.g. compute clusters and hpc.

- Assume I start Julia, and do `using MyPackage`, now it precompiles MyPackage.
- Next I restart Julia and do `using MyPackage`, in which case it shouldn’t recompile MyPackage.
- If I then stop Julia, modify some file under “src”, start Julia, run `using MyPackage`, now it should recompile MyPackage.
- Finally, and this is the question, I stop Julia, modify some non-Julia file in “other\_files”, start Julia, run `using MyPackage`. Should it it should it not to re-precompile MyPackage?

---

<div class="post-metadata">

**Author:** ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Post date:** [September 1, 2025, 3:46pm UTC](https://discourse.julialang.org/t/do-you-need-to-recompile-a-package-when-you-modify-non-src-files/132019/2 "2025-09-01T15:46:10Z")

</div>

No it should not re-precompile, unless you `include` or `include_dependency` any of these files in your package code.

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [September 2, 2025, 7:29am UTC](https://discourse.julialang.org/t/do-you-need-to-recompile-a-package-when-you-modify-non-src-files/132019/3 "2025-09-02T07:29:22Z")

</div>

You can also try to set the `JULIA_DEBUG=loading` environment variable: it should print messages explaining what gets loaded and precompiled and why

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [September 2, 2025, 7:43am UTC](https://discourse.julialang.org/t/do-you-need-to-recompile-a-package-when-you-modify-non-src-files/132019/4 "2025-09-02T07:43:59Z")

</div>

Unstable environments can also trigger recompiling upon simple restarts. For example, if you’re editing an environment but had already loaded some now-obsolete dependencies, your packages would get stuck recompiling for the obsolete dependencies; there should be a warning to restart Julia, though.

The precompile cache also holds up to 10 instances of a package (its state given the versions of it and everything else in the environment) by default, so if you go through more environments regularly, the cache may be unable to keep up.

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [September 9, 2025, 8:53am UTC](https://discourse.julialang.org/t/do-you-need-to-recompile-a-package-when-you-modify-non-src-files/132019/5 "2025-09-09T08:53:34Z")

</div>

Thanks a lot everyone, those are all very helpful replies!
