Skip to content

Too many artifacts bundled when using workspaces or separate manifest #1051

@visr

Description

@visr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions