# JULIA\_PKG\_PRECOMPILE\_AUTO=0 does not seem to work

**URL:** <https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 24, 2024, 11:29am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434 "2024-04-24T11:29:45Z")\
**Posts on this page:** 12\
**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:** [April 24, 2024, 11:29am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/1 "2024-04-24T11:29:45Z")

</div>

Hi there, for development purposes I would like to turn off precompilation, I found `JULIA_PKG_PRECOMPILE_AUTO`, but it apparently does not work

```julia
JULIA_PKG_PRECOMPILE_AUTO=0 julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.10.2 (2024-03-01)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using MyPackage
Precompiling MyPackage
^C Interrupted: Exiting precompilation... ] 0/3
  ◒ SubPackage
  1 dependency had output during precompilation:

```

`MyPackage` and `SubPackage` are added via `Pkg.dev`. How to turn off precompilation for my julia session?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 24, 2024, 11:49am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/2 "2024-04-24T11:49:27Z")

</div>

> [@schlichtanders](#):
>
> but it apparently does not work

As hinted by the name (`JULIA_PKG_...`) and [explained in the documentation](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_PKG_PRECOMPILE_AUTO), `JULIA_PKG_PRECOMPILE_AUTO` applies only to operations made via `Pkg`.

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [April 24, 2024, 11:50am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/3 "2024-04-24T11:50:40Z")

</div>

> [@schlichtanders](#):
>
> Hi there, for development purposes I would like to turn off precompilation, I found `JULIA_PKG_PRECOMPILE_AUTO`, but it apparently does not work
> 
> ```julia
> 
> ```

How about `--pkgimages=no` ?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 24, 2024, 11:53am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/4 "2024-04-24T11:53:08Z")

</div>

I think the right option is `--compiled-modules=no`: [Command-line Interface · The Julia Language](https://docs.julialang.org/en/v1/manual/command-line-interface/#command-line-interface).

---

<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:** [April 24, 2024, 11:53am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/5 "2024-04-24T11:53:19Z")

</div>

`--pkgimages=no` precompiles even more 😃

I would like to skip precompilation in order to speed up my development time

---

<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:** [April 24, 2024, 11:56am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/6 "2024-04-24T11:56:14Z")

</div>

`--compiled-modules=no` seems to take very very long. I am happy to use all precompiled packages which already have been precompiled in order to speed up things. I just want to skip new precompilations.

---

<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:** [April 24, 2024, 11:57am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/7 "2024-04-24T11:57:05Z")

</div>

The fallback I know about is to add ` __precompile__ (false)` in all packages - but I would to activate it only on my dev setup, hence I would prefer a commandline argument to the julia command

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 24, 2024, 11:57am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/8 "2024-04-24T11:57:10Z")

</div>

Then `--compiled-modules=existing`?

---

<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:** [April 24, 2024, 11:58am UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/9 "2024-04-24T11:58:04Z")

</div>

yes this would be nice, but it does not exist

```bash
> julia --compiled-modules=existing
ERROR: julia: invalid argument to --compiled-modules={yes|no} (existing)

```

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 24, 2024, 12:00pm UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/10 "2024-04-24T12:00:18Z")

</div>

Well, of course I didn’t make it up, I found it with

```julia
% julia --help | grep -A5 'compiled-modules'
 --compiled-modules={yes*|no|existing|strict} Enable or disable incremental precompilation of
                                               modules. The `existing` option allows use of existing
                                               compiled modules that were previously precompiled,
                                               but disallows creation of new precompile files.
                                               The `strict` option is similar, but will error if no
                                               precompile file is found.

```

But this is Julia nightly.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 24, 2024, 12:09pm UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/11 "2024-04-24T12:09:01Z")

</div>

And for the record, that was introduced by [Add `--compiled-modules=existing` command line option by Keno · Pull Request #50586 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/50586), which is also in the upcoming Julia v1.11.

---

<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:** [April 24, 2024, 12:40pm UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434/12 "2024-04-24T12:40:29Z")

</div>

cool, so I just have to wait for julia 1.11 😁  
luckily it is not so far

thank you very much for pointing out this future feature.
