mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
hack: check windows resources are set in the binary
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -549,7 +549,8 @@ RUN --mount=type=cache,sharing=locked,id=moby-build-aptlib,target=/var/lib/apt \
|
||||
apt-get update && apt-get install --no-install-recommends -y \
|
||||
clang \
|
||||
lld \
|
||||
llvm
|
||||
llvm \
|
||||
icoutils
|
||||
ARG TARGETPLATFORM
|
||||
RUN --mount=type=cache,sharing=locked,id=moby-build-aptlib,target=/var/lib/apt \
|
||||
--mount=type=cache,sharing=locked,id=moby-build-aptcache,target=/var/cache/apt \
|
||||
|
||||
@@ -96,6 +96,18 @@ source "${MAKEDIR}/.go-autogen"
|
||||
set -x
|
||||
fi
|
||||
./hack/with-go-mod.sh go build -mod=vendor -modfile=vendor.mod -o "$DEST/$BINARY_FULLNAME" "${BUILDFLAGS[@]}" -ldflags "$LDFLAGS $LDFLAGS_STATIC $DOCKER_LDFLAGS" -gcflags="${GCFLAGS}" "$GO_PACKAGE"
|
||||
|
||||
# Verify that the built binary contains windows resources
|
||||
if [ "$(go env GOOS)" = "windows" ]; then
|
||||
if command -v wrestool > /dev/null 2>&1; then
|
||||
if ! wrestool -l "$DEST/$BINARY_FULLNAME" | grep -q -- '--type='; then
|
||||
echo "No resources found in $DEST/$BINARY_FULLNAME"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "WARNING: wrestool not found, skipping resources check"
|
||||
fi
|
||||
fi
|
||||
)
|
||||
|
||||
echo "Created binary: $DEST/$BINARY_FULLNAME"
|
||||
|
||||
Reference in New Issue
Block a user