From 5352fc01165108135f018c36497d2ec8f2ac2c21 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 28 Apr 2024 14:52:31 -0400 Subject: [PATCH 1/5] Prevent stdlib compat entries from breaking old Julia versions --- src/AutoBuild.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index e00ef0c5b..a71f5550d 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -1660,8 +1660,10 @@ function build_project_dict(name, version, dependencies::Array{<:AbstractDepende "JLLWrappers" => "$(jllwrappers_compat)", "julia" => "$(julia_compat)", # Stdlibs always used, we need to have compat bounds also for them. - "Libdl" => "1", - "Artifacts" => "1", + # The "< 0.0.1" trick is needed to prevent `Pkg.test` from breaking + # on older Julia versions. + "Libdl" => "< 0.0.1, 1", + "Artifacts" => "< 0.0.1, 1", ) ) From 8dc6b41e8f5f38cbdfc3ac1902ea8794078d69a9 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 28 Apr 2024 15:02:21 -0400 Subject: [PATCH 2/5] Update AutoBuild.jl --- src/AutoBuild.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index a71f5550d..2905534ee 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -1688,15 +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" + project["compat"]["Pkg"] = "< 0.0.1, 1" end if lazy_artifacts project["deps"]["LazyArtifacts"] = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - project["compat"]["LazyArtifacts"] = "1" + project["compat"]["LazyArtifacts"] = "< 0.0.1, 1" end if !isempty(augment_platform_block) project["deps"]["TOML"] = "fa267f1f-6049-4f14-aa54-33bafae1ed76" - project["compat"]["TOML"] = "1" + project["compat"]["TOML"] = "< 0.0.1, 1" end return project From 6b775abe963ea7808c3686985dca882a1b9eead3 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 28 Apr 2024 17:34:20 -0400 Subject: [PATCH 3/5] Fix tests --- test/basic.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/basic.jl b/test/basic.jl index 716415099..b1ba1024b 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", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1") + @test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.2.0", "Pkg" => "< 0.0.1, 1", "Libdl" => "< 0.0.1, 1", "Artifacts" => "< 0.0.1, 1") @test all(in.( ( "Pkg" => "44cfe95a-1eb2-52ea-b672-e2afdf69b78f", From aa90b0053b698bf937b1e4b29a513b0fd6c9eb69 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 28 Apr 2024 18:38:34 -0400 Subject: [PATCH 4/5] Fix tests --- test/basic.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/basic.jl b/test/basic.jl index b1ba1024b..d289fdafe 100644 --- a/test/basic.jl +++ b/test/basic.jl @@ -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", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1") + @test dict["compat"] == Dict{String,Any}("julia" => "1.4", "JLLWrappers" => "1.2.0", "Pkg" => "< 0.0.1, 1", "Libdl" => "< 0.0.1, 1", "Artifacts" => "< 0.0.1, 1") dict = build_project_dict(name, version, dependencies, "~1.4") - @test dict["compat"] == Dict{String,Any}("julia" => "~1.4", "JLLWrappers" => "1.2.0", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1") + @test dict["compat"] == Dict{String,Any}("julia" => "~1.4", "JLLWrappers" => "1.2.0", "Pkg" => "< 0.0.1, 1", "Libdl" => "< 0.0.1, 1", "Artifacts" => "< 0.0.1, 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", "Pkg" => "1", "Libdl" => "1", "Artifacts" => "1") + @test dict["compat"] == Dict{String,Any}("julia" => "1.0", "JLLWrappers" => "1.4.0", "Pkg" => "< 0.0.1, 1", "Libdl" => "< 0.0.1, 1", "Artifacts" => "< 0.0.1, 1") # Ensure passing compat bounds works dependencies = [ From 2ba72fa689985ba50a25fe843fb62bd7a7cb6972 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 28 Apr 2024 19:27:52 -0400 Subject: [PATCH 5/5] Fix tests --- test/jll.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/jll.jl b/test/jll.jl index c09674187..035f77973 100644 --- a/test/jll.jl +++ b/test/jll.jl @@ -29,9 +29,9 @@ module TestJLL end "julia" => "1.0", "XZ_jll" => "=2.4.6", "JLLWrappers" => "1.2.0", - "Libdl" => "1", - "Artifacts" => "1", - "Pkg" => "1", + "Libdl" => "< 0.0.1, 1", + "Artifacts" => "< 0.0.1, 1", + "Pkg" => "< 0.0.1, 1", ) @test project["version"] == "1.3.5" # Make sure BuildDependency's don't find their way to the project