Skip to content

Commit

Permalink
extensions: fixup entire manifest (#3720)
Browse files Browse the repository at this point in the history
Not just explicitly installed packages.

Do I understand this logic? No.

Do I understand if this fixes anything? No.

Fixes #3719
  • Loading branch information
vtjnash authored and KristofferC committed Jul 5, 2024
1 parent 24ee188 commit 174404a
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,16 @@ end
# This has to be done after the packages have been downloaded
# since we need access to the Project file to read the information
# about extensions
function fixup_ext!(env, pkgs)
for pkg in pkgs
function fixup_ext!(env::EnvCache)
for pkg in values(env.manifest)
v = joinpath(source_path(env.manifest_file, pkg), "Project.toml")
if haskey(env.manifest, pkg.uuid)
entry = env.manifest[pkg.uuid]
if isfile(v)
p = Types.read_project(v)
entry.weakdeps = p.weakdeps
entry.exts = p.exts
for (name, _) in p.weakdeps
if !haskey(p.deps, name)
delete!(entry.deps, name)
end
if isfile(v)
p = Types.read_project(v)
pkg.weakdeps = p.weakdeps
pkg.exts = p.exts
for (name, _) in p.weakdeps
if !haskey(p.deps, name)
delete!(pkg.deps, name)
end
end
end
Expand Down Expand Up @@ -1510,7 +1507,7 @@ function add(ctx::Context, pkgs::Vector{PackageSpec}, new_git=Set{UUID}();
man_pkgs, deps_map = _resolve(ctx.io, ctx.env, ctx.registries, pkgs, preserve, ctx.julia_version)
update_manifest!(ctx.env, man_pkgs, deps_map, ctx.julia_version)
new_apply = download_source(ctx)
fixup_ext!(ctx.env, man_pkgs)
fixup_ext!(ctx.env)

# After downloading resolutionary packages, search for (Julia)Artifacts.toml files
# and ensure they are all downloaded and unpacked as well:
Expand Down Expand Up @@ -1554,7 +1551,7 @@ function develop(ctx::Context, pkgs::Vector{PackageSpec}, new_git::Set{UUID};
pkgs, deps_map = _resolve(ctx.io, ctx.env, ctx.registries, pkgs, preserve, ctx.julia_version)
update_manifest!(ctx.env, pkgs, deps_map, ctx.julia_version)
new_apply = download_source(ctx)
fixup_ext!(ctx.env, pkgs)
fixup_ext!(ctx.env)
download_artifacts(ctx.env; platform=platform, julia_version=ctx.julia_version, io=ctx.io)
write_env(ctx.env) # write env before building
show_update(ctx.env, ctx.registries; io=ctx.io)
Expand Down Expand Up @@ -1695,7 +1692,7 @@ function up(ctx::Context, pkgs::Vector{PackageSpec}, level::UpgradeLevel;
end
update_manifest!(ctx.env, pkgs, deps_map, ctx.julia_version)
new_apply = download_source(ctx)
fixup_ext!(ctx.env, pkgs)
fixup_ext!(ctx.env)
download_artifacts(ctx.env, julia_version=ctx.julia_version, io=ctx.io)
write_env(ctx.env; skip_writing_project) # write env before building
show_update(ctx.env, ctx.registries; io=ctx.io, hidden_upgrades_info = true)
Expand Down Expand Up @@ -1741,7 +1738,7 @@ function pin(ctx::Context, pkgs::Vector{PackageSpec})

update_manifest!(ctx.env, pkgs, deps_map, ctx.julia_version)
new = download_source(ctx)
fixup_ext!(ctx.env, pkgs)
fixup_ext!(ctx.env)
download_artifacts(ctx.env; julia_version=ctx.julia_version, io=ctx.io)
write_env(ctx.env) # write env before building
show_update(ctx.env, ctx.registries; io=ctx.io)
Expand Down Expand Up @@ -1789,7 +1786,7 @@ function free(ctx::Context, pkgs::Vector{PackageSpec}; err_if_free=true)

update_manifest!(ctx.env, pkgs, deps_map, ctx.julia_version)
new = download_source(ctx)
fixup_ext!(ctx.env, pkgs)
fixup_ext!(ctx.env)
download_artifacts(ctx.env, io=ctx.io)
write_env(ctx.env) # write env before building
show_update(ctx.env, ctx.registries; io=ctx.io)
Expand Down

0 comments on commit 174404a

Please sign in to comment.