Since I migrated to Julia 1.9 I get a pre-compilation of the module I am developing each time I start a test script. This was not the case with 1.8, for which I had sometimes to force a recompilation by modifying some of the files. Does anybody know how I can debug this to know what triggers the recompilation.
The module uses CxxWrap to interface to a C++ package. It is defined like this:
You do have to compile once for normal usage and once when running Pkg.test because it sets coverage=true, and we compile different code for those two cases. (Turning on coverage slows down runtime performance.) But if you’ve just run Pkg.test, and you re-run it without changing your source code, it shouldn’t need to Precompiling... any packages.
The only things I can thing of are
are you sure it’s precompiling? Pkg will “reinstall” the test dependencies of your project, but if they’re already installed and precompiled from the previous Pkg.test run, that will basically be a no-op (lots of printing, but very little time, and specifically no Precompiling...).
might there be anything wrong with the clock on your system?
are you changing the DEPOT each time? That will result in fresh compilation
for which I had sometimes to force a recompilation by modifying some of the files
Sounds like you might benefit from include_dependency, if some files are required for your project but don’t fit within the definition of ordinary Julia code.
Geant4.jl mato$ JULIA_DEBUG=loading julia --project=. examples/basic/B2/B2a.jl
┌ Debug: Rejecting stale cache file /Users/mato/.julia/compiled/v1.9/Geant4/GogkO_hxYin.ji because file /Users/mato/Development/Julia/Geant4.jl/gen/build/lib/libGeant4Wrap does not exist
└ @ Base loading.jl:2798
┌ Debug: Rejecting stale cache file /Users/mato/.julia/compiled/v1.9/Geant4/GogkO_d0CIK.ji (mtime 1.684766294152994e9) because file /Users/mato/Development/Julia/Geant4.jl/src/Geant4.jl (mtime 1.6856198847355766e9) has changed
The file that exists is /Users/mato/Development/Julia/Geant4.jl/gen/build/lib/libGeant4Wrap.dylib with the suffix.
What I am doing in the module is:
# Check whether the wrappers have been build locally otherwise use the binary package Geant4_julia_jll
gendir = normpath(joinpath(@__DIR__, "../gen"))
if isdir(joinpath(gendir, "build/lib"))
@wrapmodule(joinpath(gendir, "build/lib", "libGeant4Wrap"))
I do to fully specify the suffix for portability. Probably I should specify it depending on the platform I am.