-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: correct go build error passing #1067
Conversation
2615e67
to
d9313fc
Compare
d9313fc
to
a2c2732
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for CI to pass, if not issues this is ok to merge.
if ! (go build -mod=mod -o "$output" -trimpath "${package}"); then | ||
warn " go build of $output failed." | ||
return 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ error handling here was missing
@@ -144,7 +145,7 @@ function doBuild() { | |||
|
|||
mkdir -p "$dir" | |||
|
|||
if ! (cd "$build_dir_name" && goBuild "$package" "$goos" "$goarch") > build-log; then | |||
if ! (cd "$build_dir_name" && goBuild "$package" "$goos" "$goarch") > "$build_dir_name/build-log" 2>&1; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ why error logs were not created correctly OR were missing stderr
Aims to Close #673
The meta reason is the entire build pipeline not being written with
set -e
, which means every potential error path needs to be manually handled, or it will be ignored.For fix here, I suspect things worked fine until we added
glibc-check
here, which madego build
no longer be the last command ingoBuild
, and ifgo build
fails its code is not the code returned bygoBuild
, but we continue to the next command, which may run ok due to no binaries to check 🙃TODO