Hey,
I want to know if it is possible to do some artificial way to give ownership of the precompilation directives generated from SnoopCompile.jl to our package.
My idea:
-
@snoopi_deep
on a code
→ export it toprecompile_all_missing.jl
→ generate all the importable packages necessary for the precompiled directives. - Create a package: PrecompileOwnerEnv with the above generated code. “PrecompileOwnerEnv.jl” would look like this:
module PrecompileOwnerEnv
[importing all the packages those necessary]
function f()
[All missing precompile directives]
end
f()
end
- Then create_sysimage from the package above.
- Using the PrecompileOwnerEnv in the “main.jl” or anything you use as main module.
I guess this would by only possible if calling in an other module the Base.precompile(Tuple{typeof(DemoPkg.f),Core.Int64})
would be appropriate for ownership chaining.
Aren’t there a way to do this somehow? The above mentioned didn’t seem to work for me I don’t know why.