Skip to content

Commit

Permalink
Backport #3276 to 1.10 (#3982)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle authored Aug 8, 2024
1 parent ff18647 commit 9cb6d35
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,6 @@ function sandbox(fn::Function, ctx::Context, target::PackageSpec, target_path::S
force_latest_compatible_version::Bool=false,
allow_earlier_backwards_compatible_versions::Bool=true,
allow_reresolve::Bool=true)
active_manifest = manifestfile_path(dirname(ctx.env.manifest_file))
sandbox_project = projectfile_path(sandbox_path)

mktempdir() do tmp
Expand All @@ -1768,15 +1767,15 @@ function sandbox(fn::Function, ctx::Context, target::PackageSpec, target_path::S
# - copy over fixed subgraphs from test subgraph
# really only need to copy over "special" nodes
sandbox_env = Types.EnvCache(projectfile_path(sandbox_path))
sandbox_manifest = abspath!(sandbox_env, sandbox_env.manifest)
for (name, uuid) in sandbox_env.project.deps
entry = get(sandbox_manifest, uuid, nothing)
if entry !== nothing && isfixed(entry)
subgraph = prune_manifest(sandbox_manifest, [uuid])
for (uuid, entry) in subgraph
if haskey(working_manifest, uuid)
pkgerror("can not merge projects")
end
abspath!(sandbox_env, sandbox_env.manifest)
for (uuid, entry) in sandbox_env.manifest.deps
entry_working = get(working_manifest, uuid, nothing)
if entry_working === nothing
working_manifest[uuid] = entry
else # Check for collision between the sandbox manifest and the "parent" manifest
if entry_working != entry && (ctx.env.pkg !== nothing && ctx.env.pkg.uuid != uuid)
@warn "Entry in manifest at \"$sandbox_path\" for package \"$(entry_working.name)\" differs from that in \"$(ctx.env.manifest_file)\""
else
working_manifest[uuid] = entry
end
end
Expand Down

0 comments on commit 9cb6d35

Please sign in to comment.