JULIA_PKG_PRECOMPILE_AUTO=0 does not seem to work

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_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?

As hinted by the name (JULIA_PKG_...) and explained in the documentation, JULIA_PKG_PRECOMPILE_AUTO applies only to operations made via Pkg.

1 Like

How about --pkgimages=no ?

I think the right option is --compiled-modules=no: Command-line Interface · The Julia Language.

--pkgimages=no precompiles even more :smiley:

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

--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.

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

Then --compiled-modules=existing?

yes this would be nice, but it does not exist

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

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

% 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.

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

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

thank you very much for pointing out this future feature.