Skip to content

Commit

Permalink
[Runner] Prefix error messages in wrappers with BinaryBuilder (#172)
Browse files Browse the repository at this point in the history
This makes it clearer where the messages come from.
  • Loading branch information
giordano committed Oct 16, 2021
1 parent 0820b59 commit 4a71bba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BinaryBuilderBase"
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
authors = ["Elliot Saba <[email protected]>"]
version = "1.0.0"
version = "1.0.1"

[deps]
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Expand Down
6 changes: 3 additions & 3 deletions src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
""")
Expand All @@ -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
""")
Expand All @@ -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
""")
Expand Down
4 changes: 2 additions & 2 deletions test/runners.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down

2 comments on commit 4a71bba

@giordano
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/46877

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.1 -m "<description of version>" 4a71bba31b0a1bf6ce5042d39d48e22b9b4012e0
git push origin v1.0.1

Please sign in to comment.