From 56580d9a65804071e2d3626b82283f5978ac8d14 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 3 Aug 2024 23:22:38 +0200 Subject: [PATCH] improve error message for unsafe flags (#385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * Update runners.jl --------- Co-authored-by: Mosè Giordano --- src/Runner.jl | 2 +- test/runners.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Runner.jl b/src/Runner.jl index b6632dbc..026ab5c6 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -308,7 +308,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr if length(unsafe_flags) >= 1 write(io, """ if [[ "\${ARGS[@]}" =~ \"$(join(unsafe_flags, "\"|\""))\" ]]; then - echo -e \"BinaryBuilder: You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nPlease repent.\" >&2 + 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 exit 1 fi """) diff --git a/test/runners.jl b/test/runners.jl index c67e7227..50ad46fd 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -418,8 +418,8 @@ end @test !run(ur, cmd, iobuff; tee_stream=devnull) seekstart(iobuff) lines = readlines(iobuff) - @test lines[2] == "BinaryBuilder: You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations" - @test lines[3] == "Please repent." + @test lines[2] == "BinaryBuilder error: You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations" + @test lines[3] == "This is not allowed, please remove all unsafe flags from your build script to continue." ur = preferred_runner()(dir; platform=platform, allow_unsafe_flags=true) iobuff = IOBuffer()