diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index e50676a49..eca4c9619 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -1658,8 +1658,13 @@ function build_project_dict(name, version, dependencies::Array{<:AbstractDepende "deps" => Dict{String,Any}(), # We require at least Julia 1.3+, for Pkg.Artifacts support, but we only claim # Julia 1.0+ by default so that empty JLLs can be installed on older versions. - "compat" => Dict{String,Any}("JLLWrappers" => "$(jllwrappers_compat)", - "julia" => "$(julia_compat)") + "compat" => Dict{String,Any}( + "JLLWrappers" => "$(jllwrappers_compat)", + "julia" => "$(julia_compat)", + # Stdlibs always used, we need to have compat bounds also for them. + "Libdl" => "1", + "Artifacts" => "1", + ) ) ctx = Pkg.Types.Context() @@ -1683,12 +1688,15 @@ function build_project_dict(name, version, dependencies::Array{<:AbstractDepende if minimum_compat(julia_compat) < v"1.6" # `Pkg` is used in JLLWrappers only when we require Julia v1.5-. project["deps"]["Pkg"] = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" + project["compat"]["Pkg"] = "1" end if lazy_artifacts project["deps"]["LazyArtifacts"] = "4af54fe1-eca0-43a8-85a7-787d91b784e3" + project["compat"]["LazyArtifacts"] = "1" end if !isempty(augment_platform_block) project["deps"]["TOML"] = "fa267f1f-6049-4f14-aa54-33bafae1ed76" + project["compat"]["TOML"] = "1" end return project diff --git a/test/basic.jl b/test/basic.jl index c8ac4c169..716415099 100644 --- a/test/basic.jl +++ b/test/basic.jl @@ -199,7 +199,7 @@ end @test dict["name"] == "$(name)_jll" @test dict["version"] == "1.0.0" @test dict["uuid"] == "8fcd9439-76b0-55f4-a525-bad0597c05d8" - @test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.2.0") + @test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.2.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1") @test all(in.( ( "Pkg" => "44cfe95a-1eb2-52ea-b672-e2afdf69b78f", @@ -224,16 +224,16 @@ end # Ensure passing a Julia dependency bound works dict = build_project_dict(name, version, dependencies, "1.4") - @test dict["compat"] == Dict{String,Any}("julia" => "1.4", "JLLWrappers" => "1.2.0") + @test dict["compat"] == Dict{String,Any}("julia" => "1.4", "JLLWrappers" => "1.2.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1") dict = build_project_dict(name, version, dependencies, "~1.4") - @test dict["compat"] == Dict{String,Any}("julia" => "~1.4", "JLLWrappers" => "1.2.0") + @test dict["compat"] == Dict{String,Any}("julia" => "~1.4", "JLLWrappers" => "1.2.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1") @test_throws ErrorException build_project_dict(name, version, dependencies, "nonsense") # Ensure passing a JLLWrappers dependency bound works dict = build_project_dict(name, version, dependencies; jllwrappers_compat="1.4.0") - @test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.4.0") + @test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.4.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1") # Ensure passing compat bounds works dependencies = [ diff --git a/test/jll.jl b/test/jll.jl index b45854a46..c09674187 100644 --- a/test/jll.jl +++ b/test/jll.jl @@ -25,7 +25,14 @@ module TestJLL end "Scratch" => "6c6a2e73-6563-6170-7368-637461726353") @test project["name"] == "LibFoo_jll" @test project["uuid"] == "b250f842-3251-58d3-8ee4-9a24ab2bab3f" - @test project["compat"] == Dict("julia" => "1.0", "XZ_jll" => "=2.4.6", "JLLWrappers" => "1.2.0") + @test project["compat"] == Dict( + "julia" => "1.0", + "XZ_jll" => "=2.4.6", + "JLLWrappers" => "1.2.0", + "Libdl" => "1", + "Artifacts" => "1", + "Pkg" => "1", + ) @test project["version"] == "1.3.5" # Make sure BuildDependency's don't find their way to the project @test_throws AssertionError build_project_dict("LibFoo", v"1.3.5", [Dependency("Zlib_jll"), BuildDependency("Xorg_util_macros_jll")])