浏览代码

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

[24.0 backport] hack: use Git-free ROOTDIR
Bjorn Neergaard 1 年之前
父节点
当前提交
6f8cf86c30
共有 5 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      Dockerfile
  2. 1 1
      hack/generate-authors.sh
  3. 1 1
      hack/make/.binary
  4. 1 1
      hack/validate/no-module
  5. 1 1
      hack/with-go-mod.sh

+ 1 - 1
Dockerfile

@@ -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

+ 1 - 1
hack/generate-authors.sh

@@ -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
 

+ 1 - 1
hack/make/.binary

@@ -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"

+ 1 - 1
hack/validate/no-module

@@ -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
 	{

+ 1 - 1
hack/with-go-mod.sh

@@ -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
 	{