Skip to content

Commit

Permalink
[AutoBuild] Disallow prerelease numbers in versions of JLLs (#1223)
Browse files Browse the repository at this point in the history
* [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.

* Update AutoBuild.jl

Co-authored-by: Elliot Saba <[email protected]>
  • Loading branch information
giordano and staticfloat authored Sep 13, 2022
1 parent 1f824af commit c3ab910
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/AutoBuild.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
12 changes: 11 additions & 1 deletion test/building.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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[])
Expand Down

0 comments on commit c3ab910

Please sign in to comment.