Skip to content

Commit 25ff309

Browse files
IanButterworthgiordano
authored andcommitted
use julia_version kwarg rather than ctx
1 parent 99594c5 commit 25ff309

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/Prefix.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ function get_addable_spec(name::AbstractString, version::VersionNumber;
610610
uuid=uuid,
611611
#version=version,
612612
tree_hash=tree_hash_sha1,
613-
repo=Pkg.Types.GitRepo(rev=git_commit_sha, source=valid_url),
613+
rev=git_commit_sha,
614+
url=valid_url,
614615
)
615616
end
616617

@@ -682,18 +683,16 @@ function setup_dependencies(prefix::Prefix,
682683
deps_project = joinpath(prefix, triplet(platform), ".project")
683684
Pkg.activate(deps_project) do
684685
# Update registry first, in case the jll packages we're looking for have just been registered/updated
685-
ctx = Pkg.Types.Context(;julia_version)
686686
outs = verbose ? stdout : devnull
687687
update_registry(outs)
688688

689-
# Add all dependencies. Note: Pkg.add(ctx, deps) modifies in-place `deps` without
690-
# notice. We need to `deepcopy` the argument to prevent it from modying our
691-
# dependencies from under our feet: <https://github.com/JuliaLang/Pkg.jl/issues/3112>.
692-
Pkg_add(ctx, deepcopy(dependencies); platform=platform, io=outs)
689+
# Add all dependencies.
690+
Pkg_add(dependencies; platform=platform, io=outs, julia_version=julia_version)
693691

694692
# Ony Julia v1.6, `Pkg.add()` doesn't mutate `dependencies`, so we can't use the `UUID`
695693
# that was found during resolution there. Instead, we'll make use of `ctx.env` to figure
696694
# out the UUIDs of all our packages.
695+
ctx = Pkg.Types.Context()
697696
dependency_uuids = Set([uuid for (uuid, pkg) in ctx.env.manifest if pkg.name dependencies_names])
698697

699698
# Some JLLs are also standard libraries that may be present in the manifest because
@@ -731,7 +730,8 @@ function setup_dependencies(prefix::Prefix,
731730

732731
# Re-install stdlib dependencies, but this time with `julia_version = nothing`
733732
if !isempty(stdlib_pkgspecs)
734-
Pkg_add(ctx, stdlib_pkgspecs; io=outs, julia_version=nothing)
733+
# TODO: shouldn't this take platform?
734+
Pkg_add(stdlib_pkgspecs; io=outs, julia_version=nothing)
735735
end
736736

737737
# Load their Artifacts.toml files

test/dependencies.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,8 @@ end
165165
uuid="86de99a1-58d6-5da7-8064-bd56ce2e322c",
166166
tree_hash=Base.SHA1("83481d62501cf2ef22bed745dbcedc4e75fa6e95"),
167167
version=PKG_VERSIONS.VersionSpec("*"),
168-
repo=Pkg.Types.GitRepo(
169-
source="https://github.com/JuliaBinaryWrappers/LLVM_jll.jl.git",
170-
rev="2772761b330d51146ace3125b26acdad0df4f30f",
171-
),
168+
url="https://github.com/JuliaBinaryWrappers/LLVM_jll.jl.git",
169+
rev="2772761b330d51146ace3125b26acdad0df4f30f",
172170
)
173171

174172
with_temp_project() do dir

0 commit comments

Comments
 (0)