From d35943a01ff1eab46d043cc1b1027d8b8fa06f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Thu, 25 Aug 2022 00:18:02 +0100 Subject: [PATCH 1/2] [AutoBuild] Disallow prerelease numbers in versions of JLLs As a matter of fact Pkg doesn't like them, I think it's better to automatically error our instead of having to tell users that they shouldn't use them. --- src/AutoBuild.jl | 4 ++-- test/building.jl | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index 77e736a28..67d896c7b 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -755,8 +755,8 @@ function autobuild(dir::AbstractString, end # If the user passed in a src_version with a build number, bail out - if src_version.build != () - error("Will not build with a `src_version` that has a build number already specified!") + if any(!isempty, (src_version.prerelease, src_version.build)) + error("Will not build with a `src_version` that has not the format `major.minor.patch`! Do not set prerelease or build numbers.") end # We must prepare our sources. Download them, hash them, etc... diff --git a/test/building.jl b/test/building.jl index 904a4916b..497ab342b 100644 --- a/test/building.jl +++ b/test/building.jl @@ -291,7 +291,7 @@ end ) end - # Test that manually specifying a build number in our src_version is an error() + # Test that manually specifying prerelease or build number in our src_version is an error() @test_throws ErrorException autobuild( build_path, "badopenssl", @@ -302,6 +302,16 @@ end Product[], Dependency[], ) + @test_throws ErrorException autobuild( + build_path, + "test", + v"1.2.3-4", + GitSource[], + "true", + [HostPlatform()], + Product[], + Dependency[], + ) end @test_throws ErrorException build_tarballs(String[], "", v"1.0", GitSource[], "", supported_platforms(; experimental=true), LibraryProduct[], Dependency[]) From cd027f44c3194715aaed81349597838ec38792e0 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 13 Sep 2022 13:27:45 -0700 Subject: [PATCH 2/2] Update AutoBuild.jl --- src/AutoBuild.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index 67d896c7b..31e51e0ff 100644 --- a/src/AutoBuild.jl +++ b/src/AutoBuild.jl @@ -756,7 +756,7 @@ function autobuild(dir::AbstractString, # If the user passed in a src_version with a build number, bail out if any(!isempty, (src_version.prerelease, src_version.build)) - error("Will not build with a `src_version` that has not the format `major.minor.patch`! Do not set prerelease or build numbers.") + error("Will not build with a `src_version` that does not have the format `major.minor.patch`! Do not set prerelease or build numbers.") end # We must prepare our sources. Download them, hash them, etc...