Skip to content

Commit 659f130

Browse files
committed
Disable go module when downloading global binaries
Prevent `go get` from touching `go.mod` and `go.sum` when executing global binaries during the build process. Once golang/go#30515 is fixed, we should is whatever solution is provided there. Fixes: go-gitea#12010
1 parent d9aa007 commit 659f130

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ swagger-validate:
253253
.PHONY: errcheck
254254
errcheck:
255255
@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
256-
$(GO) get -u github.com/kisielk/errcheck; \
256+
GO111MODULE=off $(GO) get -u github.com/kisielk/errcheck; \
257257
fi
258258
errcheck $(GO_PACKAGES)
259259

@@ -264,14 +264,14 @@ revive:
264264
.PHONY: misspell-check
265265
misspell-check:
266266
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
267-
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
267+
GO111MODULE=off $(GO) get -u github.com/client9/misspell/cmd/misspell; \
268268
fi
269269
misspell -error -i unknwon,destory $(GO_SOURCES_OWN)
270270

271271
.PHONY: misspell
272272
misspell:
273273
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
274-
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
274+
GO111MODULE=off $(GO) get -u github.com/client9/misspell/cmd/misspell; \
275275
fi
276276
misspell -w -i unknwon $(GO_SOURCES_OWN)
277277

@@ -529,7 +529,7 @@ $(DIST_DIRS):
529529
.PHONY: release-windows
530530
release-windows: | $(DIST_DIRS)
531531
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
532-
$(GO) get -u src.techknowlogick.com/xgo; \
532+
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
533533
fi
534534
CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
535535
ifeq ($(CI),drone)
@@ -539,7 +539,7 @@ endif
539539
.PHONY: release-linux
540540
release-linux: | $(DIST_DIRS)
541541
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
542-
$(GO) get -u src.techknowlogick.com/xgo; \
542+
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
543543
fi
544544
CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) .
545545
ifeq ($(CI),drone)
@@ -549,7 +549,7 @@ endif
549549
.PHONY: release-darwin
550550
release-darwin: | $(DIST_DIRS)
551551
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
552-
$(GO) get -u src.techknowlogick.com/xgo; \
552+
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
553553
fi
554554
CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
555555
ifeq ($(CI),drone)

0 commit comments

Comments
 (0)