Skip to content

Commit 4a71bba

Browse files
authored
[Runner] Prefix error messages in wrappers with BinaryBuilder (#172)
This makes it clearer where the messages come from.
1 parent 0820b59 commit 4a71bba

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BinaryBuilderBase"
22
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
33
authors = ["Elliot Saba <[email protected]>"]
4-
version = "1.0.0"
4+
version = "1.0.1"
55

66
[deps]
77
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"

src/Runner.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
219219
if lock_microarchitecture
220220
write(io, raw"""
221221
if [[ " ${ARGS[@]} " == *"-march="* ]]; then
222-
echo "Cannot force an architecture" >&2
222+
echo "BinaryBuilder: Cannot force an architecture" >&2
223223
exit 1
224224
fi
225225
""")
@@ -229,7 +229,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
229229
if no_soft_float
230230
write(io, raw"""
231231
if [[ " ${ARGS[@]} " == *"-mfloat-abi=soft"* ]]; then
232-
echo "${target} platform does not support soft-float ABI" >&2
232+
echo "BinaryBuilder: ${target} platform does not support soft-float ABI" >&2
233233
exit 1
234234
fi
235235
""")
@@ -239,7 +239,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
239239
if length(unsafe_flags) >= 1
240240
write(io, """
241241
if [[ "\${ARGS[@]}" =~ \"$(join(unsafe_flags, "\"|\""))\" ]]; then
242-
echo -e \"You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nPlease repent.\" >&2
242+
echo -e \"BinaryBuilder: You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nPlease repent.\" >&2
243243
exit 1
244244
fi
245245
""")

test/runners.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ end
270270
iobuff = IOBuffer()
271271
@test !run(ur, cmd, iobuff; tee_stream=devnull)
272272
seekstart(iobuff)
273-
@test readlines(iobuff)[2] == "Cannot force an architecture"
273+
@test readlines(iobuff)[2] == "BinaryBuilder: Cannot force an architecture"
274274

275275
ur = preferred_runner()(dir; platform=platform, lock_microarchitecture=false)
276276
iobuff = IOBuffer()
@@ -289,7 +289,7 @@ end
289289
@test !run(ur, cmd, iobuff; tee_stream=devnull)
290290
seekstart(iobuff)
291291
lines = readlines(iobuff)
292-
@test lines[2] == "You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations"
292+
@test lines[2] == "BinaryBuilder: You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations"
293293
@test lines[3] == "Please repent."
294294

295295
ur = preferred_runner()(dir; platform=platform, allow_unsafe_flags=true)

0 commit comments

Comments
 (0)