Skip to content

Commit 1b6b9c2

Browse files
committed
Bail out if 'go build' fails
1 parent 333dbfa commit 1b6b9c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/go-build-wrapper

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ if ! cd "$1"; then
2727
exit 1
2828
fi
2929

30-
go build -trimpath -ldflags "-extldflags '-Wl,-rpath,/run/host/usr/lib -Wl,-rpath,/run/host/usr/lib64' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2/toolbox"
30+
go build -trimpath -ldflags "-extldflags '-Wl,-rpath,/run/host/usr/lib -Wl,-rpath,/run/host/usr/lib64'
31+
-linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2/toolbox"
32+
if [ $? -ne 0 ]; then
33+
echo "go-build-wrapper: failed to build toolbox"
34+
exit 1
35+
fi
3136

3237
if ! interpreter=$(patchelf --print-interpreter "$2/toolbox"); then
3338
echo "go-build-wrapper: failed to read PT_INTERP from $2/toolbox" >&2

0 commit comments

Comments
 (0)