Skip to content

Commit cb6f229

Browse files
authored
Disallow src_version with build number already specified (#637)
1 parent bc93d11 commit cb6f229

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

src/AutoBuild.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,12 @@ function autobuild(dir::AbstractString,
610610
error("Invalid dependency specifications!")
611611
end
612612

613+
# If the user passed in a src_version with a build number, bail out
614+
if src_version.build != ()
615+
error("Will not build with a `src_version` that has a build number already specified!")
616+
end
617+
@show src_version
618+
613619
# We must prepare our sources. Download them, hash them, etc...
614620
sources = download_sources(sources; verbose=verbose)
615621

test/building.jl

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ shards_to_test = expand_cxxstring_abis(expand_gfortran_versions(shards_to_test))
197197
end
198198
end
199199

200-
@testset "Dependency Specification" begin
200+
@testset "Invalid Arguments" begin
201201
mktempdir() do build_path
202+
# Test that invalid JLL names both @warn and error()
202203
@test_logs (:warn, r"BadDependency_jll") (:warn, r"WorseDependency_jll") match_mode=:any begin
203204
@test_throws ErrorException autobuild(
204205
build_path,
@@ -207,8 +208,8 @@ end
207208
# No sources
208209
[],
209210
"true",
210-
[platform],
211-
[ExecutableProduct("foo", :foo)],
211+
[platform_key_abi()],
212+
Product[],
212213
# Three dependencies; one good, two bad
213214
[
214215
"Zlib_jll",
@@ -218,5 +219,18 @@ end
218219
]
219220
)
220221
end
222+
223+
# Test that manually specifying a build number in our src_version is an error()
224+
@test_throws ErrorException autobuild(
225+
build_path,
226+
"badopenssl",
227+
v"1.1.1+c",
228+
[],
229+
"true",
230+
[platform_key_abi()],
231+
Product[],
232+
[],
233+
)
221234
end
222235
end
236+

0 commit comments

Comments
 (0)