From 4a71bba31b0a1bf6ce5042d39d48e22b9b4012e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sat, 16 Oct 2021 20:42:48 +0100 Subject: [PATCH] [Runner] Prefix error messages in wrappers with `BinaryBuilder` (#172) This makes it clearer where the messages come from. --- Project.toml | 2 +- src/Runner.jl | 6 +++--- test/runners.jl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index b9d18274..070295bc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BinaryBuilderBase" uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e" authors = ["Elliot Saba "] -version = "1.0.0" +version = "1.0.1" [deps] CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" diff --git a/src/Runner.jl b/src/Runner.jl index e49d410f..d8412aec 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -219,7 +219,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr if lock_microarchitecture write(io, raw""" if [[ " ${ARGS[@]} " == *"-march="* ]]; then - echo "Cannot force an architecture" >&2 + echo "BinaryBuilder: Cannot force an architecture" >&2 exit 1 fi """) @@ -229,7 +229,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr if no_soft_float write(io, raw""" if [[ " ${ARGS[@]} " == *"-mfloat-abi=soft"* ]]; then - echo "${target} platform does not support soft-float ABI" >&2 + echo "BinaryBuilder: ${target} platform does not support soft-float ABI" >&2 exit 1 fi """) @@ -239,7 +239,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 \"You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nPlease repent.\" >&2 + echo -e \"BinaryBuilder: You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nPlease repent.\" >&2 exit 1 fi """) diff --git a/test/runners.jl b/test/runners.jl index d6da9749..d26010a2 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -270,7 +270,7 @@ end iobuff = IOBuffer() @test !run(ur, cmd, iobuff; tee_stream=devnull) seekstart(iobuff) - @test readlines(iobuff)[2] == "Cannot force an architecture" + @test readlines(iobuff)[2] == "BinaryBuilder: Cannot force an architecture" ur = preferred_runner()(dir; platform=platform, lock_microarchitecture=false) iobuff = IOBuffer() @@ -289,7 +289,7 @@ end @test !run(ur, cmd, iobuff; tee_stream=devnull) seekstart(iobuff) lines = readlines(iobuff) - @test lines[2] == "You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations" + @test lines[2] == "BinaryBuilder: You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations" @test lines[3] == "Please repent." ur = preferred_runner()(dir; platform=platform, allow_unsafe_flags=true)