Skip to content

Commit 1776821

Browse files
authored
Merge pull request #6 from rdeits/test-binaries
test binaries and suggest source build if they fail
2 parents c53fda7 + 4947cda commit 1776821

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

deps/build.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,19 @@ function install_binaries(file_base, file_ext, binary_dir)
3434
end
3535
end
3636

37-
37+
function test_step()
38+
try
39+
run(`$(joinpath(prefix, "bin", binary_name)) --version`)
40+
catch e
41+
error("""
42+
Running the precompiled cmake binary failed with the error
43+
$(e)
44+
To build from source instead, run:
45+
julia> ENV["CMAKEWRAPPER_JL_BUILD_FROM_SOURCE"] = 1
46+
julia> Pkg.build("CMakeWrapper")
47+
""")
48+
end
49+
end
3850
(@build_steps begin
3951
FileRule(joinpath(prefix, "bin", binary_name),
4052
(@build_steps begin
@@ -44,6 +56,7 @@ function install_binaries(file_base, file_ext, binary_dir)
4456
"")
4557
CreateDirectory(joinpath(prefix, "bin"))
4658
install_step
59+
test_step
4760
end))
4861
end)
4962
end

0 commit comments

Comments
 (0)