Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix paths to stdlibs being put into test manifest again #2259

Merged
merged 2 commits into from
Dec 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1382,8 +1382,9 @@ end

function abspath!(env::EnvCache, manifest::Dict{UUID,PackageEntry})
for (uuid, entry) in manifest
entry.path !== nothing || continue
entry.path = project_rel_path(env, entry.path)
if entry.path !== nothing
entry.path = project_rel_path(env, entry.path)
end
end
return manifest
end
Expand Down Expand Up @@ -1425,22 +1426,33 @@ function sandbox(fn::Function, ctx::Context, target::PackageSpec, target_path::S
end
end
end

Types.write_manifest(working_manifest, tmp_manifest)
# sandbox
with_temp_env(tmp) do
temp_ctx = Context()
temp_ctx.env.project.deps[target.name] = target.uuid
write_env(temp_ctx.env, update_undo = false)

try
Pkg.resolve(; io=devnull)
Pkg.resolve(temp_ctx; io=devnull)
@debug "Using _parent_ dep graph"
catch err# TODO
err isa Resolve.ResolverError || rethrow()
@debug err
@warn "Could not use exact versions of packages in manifest, re-resolving"
temp_ctx.env.manifest = Dict(uuid => entry for (uuid, entry) in temp_ctx.env.manifest if isfixed(entry))
Pkg.resolve(temp_ctx; io=devnull)
@debug "Using _clean_ dep graph"
end

# Absolutify stdlibs paths
for (uuid, entry) in temp_ctx.env.manifest
if is_stdlib(uuid)
entry.path = Types.stdlib_path(entry.name)
end
end
write_env(temp_ctx.env, update_undo = false)

# Run sandboxed code
path_sep = Sys.iswindows() ? ';' : ':'
withenv(fn, "JULIA_LOAD_PATH" => "@$(path_sep)$(tmp)", "JULIA_PROJECT" => nothing)
Expand Down