Hello, we’re creating binaries using PackageCompiler.jl, and it’s working well, but… right now we have a script
create_precompile.jl which we use to create a
build/MyPackage_precompile.jl file full of precompile statements, which is git-tracked. The script is run occasionally, as of course the code evolves and the precompile statements is out of date.
This feels bananas to me, because:
- git-tracking a generated file is generally not recommended
- Keeping it up to date is a PITA
- I thought that
precompile(f, ...)is equivalent to
f(...), except that it does not run the function. Ergo: instead of
MyPackage_precompile.jlbeing full of soon-obsoleted precompilation statement, we could just run the “sample run” code in
create_precompile.jlat package compilation time.
I haven’t looked into all of the PackageCompiler details, so maybe my assumptions are way off, but my mental model is that when it runs, it will save to the sysimage all compiled method instances in the current julia process, so it doesn’t matter whether those were created by a sample script, or by
Am I wrong?