Skip to content

Commit 56580d9

Browse files
improve error message for unsafe flags (#385)
* improve error message for unsafe flags This makes it clearer, that Binary builder actually doesn't allow unsafe flags and errors. * Update src/Runner.jl Co-authored-by: Mosè Giordano <[email protected]> * Update runners.jl --------- Co-authored-by: Mosè Giordano <[email protected]>
1 parent bfac3a4 commit 56580d9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Runner.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
308308
if length(unsafe_flags) >= 1
309309
write(io, """
310310
if [[ "\${ARGS[@]}" =~ \"$(join(unsafe_flags, "\"|\""))\" ]]; then
311-
echo -e \"BinaryBuilder: You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nPlease repent.\" >&2
311+
echo -e \"BinaryBuilder error: You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nThis is not allowed, please remove all unsafe flags from your build script to continue.\" >&2
312312
exit 1
313313
fi
314314
""")

test/runners.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ end
418418
@test !run(ur, cmd, iobuff; tee_stream=devnull)
419419
seekstart(iobuff)
420420
lines = readlines(iobuff)
421-
@test lines[2] == "BinaryBuilder: You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations"
422-
@test lines[3] == "Please repent."
421+
@test lines[2] == "BinaryBuilder error: You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations"
422+
@test lines[3] == "This is not allowed, please remove all unsafe flags from your build script to continue."
423423

424424
ur = preferred_runner()(dir; platform=platform, allow_unsafe_flags=true)
425425
iobuff = IOBuffer()

0 commit comments

Comments
 (0)