Skip to content

Commit 94e0aaa

Browse files
committed
small fix for testing projects
1 parent f409d09 commit 94e0aaa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/Pkg/src/Operations.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,11 @@ function with_dependencies_loadable_at_toplevel(f, mainctx::Context, pkg::Packag
706706
# unless we already have resolved for the current environment, which the calleer indicates
707707
# with `might_need_to_resolve`
708708
need_to_resolve = false
709+
is_project = Types.is_project(localctx.env, pkg)
709710

710-
if Types.is_project(localctx.env, pkg)
711+
if is_project
711712
foreach(k->delete!(localctx.env.project, k), ("name", "uuid", "version"))
713+
localctx.env.pkg = nothing
712714
localctx.env.project["deps"][pkg.name] = string(pkg.uuid)
713715
localctx.env.manifest[pkg.name] = [Dict(
714716
"deps" => mainctx.env.project["deps"],
@@ -745,7 +747,7 @@ function with_dependencies_loadable_at_toplevel(f, mainctx::Context, pkg::Packag
745747
if pkg.uuid in keys(localctx.stdlibs)
746748
path = Types.stdlib_path(pkg.name)
747749
elseif Types.is_project_uuid(localctx.env, pkg.uuid)
748-
path = dirname(localctx.env.project_file)
750+
path = dirname(mainctx.env.project_file)
749751
else
750752
info = manifest_info(localctx.env, pkg.uuid)
751753
path = haskey(info, "path") ? project_rel_path(localctx, info["path"]) : find_installed(pkg.name, pkg.uuid, SHA1(info["git-tree-sha1"]))
@@ -757,6 +759,7 @@ function with_dependencies_loadable_at_toplevel(f, mainctx::Context, pkg::Packag
757759
pkg_name, vspec = r.package, VersionSpec(VersionRange[r.versions.intervals...])
758760
push!(pkgs, PackageSpec(pkg_name, vspec))
759761
end
762+
is_project && push!(pkgs, mainctx.env.pkg)
760763
registry_resolve!(localctx.env, pkgs)
761764
ensure_resolved(localctx.env, pkgs; registry=true)
762765
add_or_develop(localctx, pkgs)

0 commit comments

Comments
 (0)