Skip to content

Commit 4c9007c

Browse files
authored
[AutoBuild] Do not add Pkg as dependency if we require Julia v1.6 (#1261)
1 parent 38b664e commit 4c9007c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/AutoBuild.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,12 +1646,14 @@ function build_project_dict(name, version, dependencies::Array{Dependency},
16461646
project["compat"][depname] = dep.compat
16471647
end
16481648
end
1649-
# Always add Libdl, Pkg and Artifacts as dependencies
1650-
# Once we stop supporting Julia 1.5-, we can drop the `Pkg` requirement.
1649+
# Always add Libdl, Artifacts, and JLLWrappers as dependencies.
16511650
project["deps"]["Libdl"] = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1652-
project["deps"]["Pkg"] = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
16531651
project["deps"]["Artifacts"] = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
16541652
project["deps"]["JLLWrappers"] = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
1653+
if minimum_compat(julia_compat) < v"1.6"
1654+
# `Pkg` is used in JLLWrappers only when we require Julia v1.5-.
1655+
project["deps"]["Pkg"] = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1656+
end
16551657
if lazy_artifacts
16561658
project["deps"]["LazyArtifacts"] = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
16571659
end

test/jll.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module TestJLL end
2929
@test project["version"] == "1.3.5"
3030
# Make sure BuildDependency's don't find their way to the project
3131
@test_throws MethodError build_project_dict("LibFoo", v"1.3.5", [Dependency("Zlib_jll"), BuildDependency("Xorg_util_macros_jll")])
32+
# `Pkg` should not be a dependency if we require Julia v1.6.
33+
@test !haskey(BinaryBuilder.build_project_dict("foo", v"1.2", Dependency[], "1.6")["deps"], "Pkg")
3234

3335
gh_auth = Wizard.github_auth(;allow_anonymous=true)
3436
@test get_github_author_login("JuliaPackaging/Yggdrasil", "invalid_hash"; gh_auth) === nothing

0 commit comments

Comments
 (0)