Skip to content

Commit 1723057

Browse files
authored
[AutoBuild] Add compat bounds for stdlibs in generated JLLs (#1299)
1 parent baa1d2b commit 1723057

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

src/AutoBuild.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,8 +1658,13 @@ function build_project_dict(name, version, dependencies::Array{<:AbstractDepende
16581658
"deps" => Dict{String,Any}(),
16591659
# We require at least Julia 1.3+, for Pkg.Artifacts support, but we only claim
16601660
# Julia 1.0+ by default so that empty JLLs can be installed on older versions.
1661-
"compat" => Dict{String,Any}("JLLWrappers" => "$(jllwrappers_compat)",
1662-
"julia" => "$(julia_compat)")
1661+
"compat" => Dict{String,Any}(
1662+
"JLLWrappers" => "$(jllwrappers_compat)",
1663+
"julia" => "$(julia_compat)",
1664+
# Stdlibs always used, we need to have compat bounds also for them.
1665+
"Libdl" => "1",
1666+
"Artifacts" => "1",
1667+
)
16631668
)
16641669

16651670
ctx = Pkg.Types.Context()
@@ -1683,12 +1688,15 @@ function build_project_dict(name, version, dependencies::Array{<:AbstractDepende
16831688
if minimum_compat(julia_compat) < v"1.6"
16841689
# `Pkg` is used in JLLWrappers only when we require Julia v1.5-.
16851690
project["deps"]["Pkg"] = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1691+
project["compat"]["Pkg"] = "1"
16861692
end
16871693
if lazy_artifacts
16881694
project["deps"]["LazyArtifacts"] = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
1695+
project["compat"]["LazyArtifacts"] = "1"
16891696
end
16901697
if !isempty(augment_platform_block)
16911698
project["deps"]["TOML"] = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
1699+
project["compat"]["TOML"] = "1"
16921700
end
16931701

16941702
return project

test/basic.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ end
199199
@test dict["name"] == "$(name)_jll"
200200
@test dict["version"] == "1.0.0"
201201
@test dict["uuid"] == "8fcd9439-76b0-55f4-a525-bad0597c05d8"
202-
@test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.2.0")
202+
@test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.2.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1")
203203
@test all(in.(
204204
(
205205
"Pkg" => "44cfe95a-1eb2-52ea-b672-e2afdf69b78f",
@@ -224,16 +224,16 @@ end
224224

225225
# Ensure passing a Julia dependency bound works
226226
dict = build_project_dict(name, version, dependencies, "1.4")
227-
@test dict["compat"] == Dict{String,Any}("julia" => "1.4", "JLLWrappers" => "1.2.0")
227+
@test dict["compat"] == Dict{String,Any}("julia" => "1.4", "JLLWrappers" => "1.2.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1")
228228

229229
dict = build_project_dict(name, version, dependencies, "~1.4")
230-
@test dict["compat"] == Dict{String,Any}("julia" => "~1.4", "JLLWrappers" => "1.2.0")
230+
@test dict["compat"] == Dict{String,Any}("julia" => "~1.4", "JLLWrappers" => "1.2.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1")
231231

232232
@test_throws ErrorException build_project_dict(name, version, dependencies, "nonsense")
233233

234234
# Ensure passing a JLLWrappers dependency bound works
235235
dict = build_project_dict(name, version, dependencies; jllwrappers_compat="1.4.0")
236-
@test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.4.0")
236+
@test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.4.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1")
237237

238238
# Ensure passing compat bounds works
239239
dependencies = [

test/jll.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ module TestJLL end
2525
"Scratch" => "6c6a2e73-6563-6170-7368-637461726353")
2626
@test project["name"] == "LibFoo_jll"
2727
@test project["uuid"] == "b250f842-3251-58d3-8ee4-9a24ab2bab3f"
28-
@test project["compat"] == Dict("julia" => "1.0", "XZ_jll" => "=2.4.6", "JLLWrappers" => "1.2.0")
28+
@test project["compat"] == Dict(
29+
"julia" => "1.0",
30+
"XZ_jll" => "=2.4.6",
31+
"JLLWrappers" => "1.2.0",
32+
"Libdl" => "1",
33+
"Artifacts" => "1",
34+
"Pkg" => "1",
35+
)
2936
@test project["version"] == "1.3.5"
3037
# Make sure BuildDependency's don't find their way to the project
3138
@test_throws AssertionError build_project_dict("LibFoo", v"1.3.5", [Dependency("Zlib_jll"), BuildDependency("Xorg_util_macros_jll")])

0 commit comments

Comments
 (0)