diff --git a/src/AutoBuild.jl b/src/AutoBuild.jl index 77e736a28..31e51e0ff 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 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... 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[])