I am currently using a manifest entry in the Project.toml that I'm building to point to a larger shared dev environment with e.g. PackageCompiler and plotting packages. In 1.12 we'll switch to using workspaces. In both cases I see that e.g. plotting artifacts end up bundled, even though they are not a project dependency.
Specifically this will include the whole workspace/manifest:
|
function bundle_artifacts(ctx, dest_dir; include_lazy_artifacts::Bool) |
|
pkgs = load_all_deps(ctx) |
Looking at JuliaLang/Pkg.jl#3841 I see that added load_all_deps_loadable, which upon some local testing results in the right artifacts being bundled. It is only available in 1.12 though, so we can just wait until 1.12 is supported and then use (always?) use that function if it is defined, updating
|
function load_all_deps(ctx) |
|
env = ctx.env |
|
if isdefined(Pkg.Operations, :load_all_deps!) |
|
pkgs = Pkg.Types.PackageSpec[] |
|
Pkg.Operations.load_all_deps!(env, pkgs) |
|
else |
|
pkgs = Pkg.Operations.load_all_deps(env) |
|
end |
|
return pkgs |
|
end |
It seems
load_all_deps! is not defined in any supported Julia versions so we can replace that branch.
We could probably also get it in sooner by copying more Pkg code over, but that may not be worth it.
I am currently using a
manifestentry in the Project.toml that I'm building to point to a larger shared dev environment with e.g. PackageCompiler and plotting packages. In 1.12 we'll switch to using workspaces. In both cases I see that e.g. plotting artifacts end up bundled, even though they are not a project dependency.Specifically this will include the whole workspace/manifest:
PackageCompiler.jl/src/PackageCompiler.jl
Lines 1492 to 1493 in 57505ca
Looking at JuliaLang/Pkg.jl#3841 I see that added
load_all_deps_loadable, which upon some local testing results in the right artifacts being bundled. It is only available in 1.12 though, so we can just wait until 1.12 is supported and then use (always?) use that function if it is defined, updatingPackageCompiler.jl/src/PackageCompiler.jl
Lines 80 to 89 in 57505ca
It seems
load_all_deps!is not defined in any supported Julia versions so we can replace that branch.We could probably also get it in sooner by copying more Pkg code over, but that may not be worth it.