Merge pull request #46219 from thaJeztah/24.0_backport_with-go-mod_ROOTDIR

[24.0 backport] hack: use Git-free ROOTDIR
This commit is contained in:
Bjorn Neergaard 2023-08-15 16:06:24 -06:00 committed by GitHub
commit 6f8cf86c30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -599,7 +599,7 @@ RUN <<EOT
XX_CC_PREFER_LINKER=ld xx-clang --setup-target-triple
fi
EOT
RUN --mount=type=bind,target=. \
RUN --mount=type=bind,target=.,rw \
--mount=type=tmpfs,target=cli/winresources/dockerd \
--mount=type=tmpfs,target=cli/winresources/docker-proxy \
--mount=type=cache,target=/root/.cache/go-build,id=moby-build-$TARGETPLATFORM <<EOT

View file

@ -3,7 +3,7 @@
set -e
SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOTDIR="$(git -C "$SCRIPTDIR" rev-parse --show-toplevel)"
ROOTDIR="$(cd "${SCRIPTDIR}/.." && pwd)"
set -x

View file

@ -78,7 +78,7 @@ source "${MAKEDIR}/.go-autogen"
if [ -n "$DOCKER_DEBUG" ]; then
set -x
fi
go build -o "$DEST/$BINARY_FULLNAME" "${BUILDFLAGS[@]}" -ldflags "$LDFLAGS $LDFLAGS_STATIC $DOCKER_LDFLAGS" ${GO_PACKAGE}
./hack/with-go-mod.sh go build -mod=vendor -modfile=vendor.mod -o "$DEST/$BINARY_FULLNAME" "${BUILDFLAGS[@]}" -ldflags "$LDFLAGS $LDFLAGS_STATIC $DOCKER_LDFLAGS" "$GO_PACKAGE"
)
echo "Created binary: $DEST/$BINARY_FULLNAME"

View file

@ -3,7 +3,7 @@
# Check that no one is trying to commit a go.mod.
SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOTDIR="$(git -C "$SCRIPTDIR" rev-parse --show-toplevel)"
ROOTDIR="$(cd "${SCRIPTDIR}/../.." && pwd)"
if test -e "${ROOTDIR}/go.mod"; then
{

View file

@ -9,7 +9,7 @@
set -e
SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOTDIR="$(git -C "$SCRIPTDIR" rev-parse --show-toplevel)"
ROOTDIR="$(cd "${SCRIPTDIR}/.." && pwd)"
if test -e "${ROOTDIR}/go.mod"; then
{