Skip to content

Commit

Permalink
scripts/build: make sure osusergo is set for static with CGO enabled
Browse files Browse the repository at this point in the history
We should check if we should actually have CGO enabled though

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Mar 25, 2022
1 parent 8280322 commit e67ed09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/build/.variables
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ fi
if [ "$CGO_ENABLED" = "1" ] && [ "$GO_LINKMODE" = "static" ] && [ "$(go env GOOS)" = "linux" ]; then
LDFLAGS="$LDFLAGS -extldflags -static"
fi
if [ "$CGO_ENABLED" = "1" ] && [ "$GO_LINKMODE" = "static" ] && [ "$(go env GOOS)" = "linux" ]; then
GO_BUILDTAGS="$GO_BUILDTAGS osusergo"
fi
if [ -n "$GO_STRIP" ]; then
LDFLAGS="$LDFLAGS -s"
fi
Expand Down

0 comments on commit e67ed09

Please sign in to comment.