JuliaLang / JuliaLang/PackageCompiler.jl
Standard `precompile_execution_file.jl` location
- Dominant language
- Julia
- Stars
- 1.6k
- Forks
- 205
- Avg merge
- 18h 37m
- Merged PRs (30d)
- 7
Description
It would be nice to have support for automatically picking up `precompile_execution_file`'s. There are two sides to this as I see it.
* Package dependencies: It would be nice if there was a standard location for a `precompile_execution_file` such that packages could include such a file in their code and when you compile a sysimage with one of those packages PackageCompiler automatically uses that file. E.g. Plots could have such a file which just generates some plots to help alleviate TTFP, and say DifferentialEquations could have its own such file which solves some simple ODEs. So for example, `PackageCompiler.create_sysimage([:Debugger, :OhMyREPL])` would use `precompile_execution_file`s included in the code of Debugger.jl or OhMyREPL.jl if they put such a file in some standard location.
* Projects: a folder with a Manifest and Project.toml and some code which is not necessarily structured as a Julia package could also have a standard location for a `precompile_execution_file`. For example, a project that involves plotting differential equations could have such a file which plots a solution. That would cover code which neither Plots `precompile_execution_file` nor DifferentialEquations `precompile_execution_file` could cover (assuming they exist as in the first point), since neither depends on the other.
This could also come together very smoothly for the end user if you could also do e.g. `PackageCompiler.create_sysimage(sysimage_path=sysimage_path, project=env_to_precompile)` which could use the Manifest and Project at `env_to_precompile` to get all the dependencies to include, use all their `precompile_execution_file`s (assuming they exist), and then also use the any `precompile_execution_file` located at that environment.
This has come from discussion with @davidanthoff at https://github.com/julia-vscode/julia-vscode/issues/1160.
I think such a standard location could also be useful for automatically generating precompiles with SnoopCompile bot (https://github.com/timholy/SnoopCompile.jl).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the create_sysimage entry point and how a project's Manifest and Project.toml are used. Define the standard locations and discovery rules for dependency and project precompile_execution_file files, then confirm that the resulting sysimage includes the discovered workloads without requiring manual paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100