Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-03-25 07:45:08 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-03-25 07:45:08 +0300
commit33723f8a85871797b6f38ab0340437a9b635f917 (patch)
tree9ff99365659f0e47673c9c8f5cd60610e88936f5 /Makefile.internal.mk
parent575fec0d865d576c295aa7263d190744bd0a0328 (diff)
Remove .GOPATH symlinks
Simplifies Makefiles to not use `.GOPATH` symlink. Updates `test.yaml` to reuse the Go cache in between jobs instead of removing and downloading all the dependencies for every job. Changelog: other
Diffstat (limited to 'Makefile.internal.mk')
-rw-r--r--Makefile.internal.mk19
1 files changed, 4 insertions, 15 deletions
diff --git a/Makefile.internal.mk b/Makefile.internal.mk
index 09f13225..88aecad2 100644
--- a/Makefile.internal.mk
+++ b/Makefile.internal.mk
@@ -10,30 +10,19 @@ endif
VERSION_FLAGS := -ldflags='-X "main.VERSION=$(VERSION)" -X "main.REVISION=$(REVISION)"'
-# cd into the GOPATH to workaround ./... not following symlinks
-_allpackages = $(shell ( cd $(CURDIR)/.GOPATH/src/$(IMPORT_PATH) && \
- GOPATH=$(CURDIR)/.GOPATH go list ./... 2>&1 1>&3 | \
- grep -v -e "^$$" $(addprefix -e ,$(IGNORED_PACKAGES)) 1>&2 ) 3>&1 | \
- grep -v -e "^$$" $(addprefix -e ,$(IGNORED_PACKAGES)))
-
-_allfiles = $(shell cd $(CURDIR)/.GOPATH/src/$(IMPORT_PATH) && find . -iname '*.go' | grep -v "^\./\." | grep -v -e "^$$" $(addprefix -e ,$(IGNORED_PACKAGES)) )
+_allpackages = $(shell (go list ./... | \
+ grep -v $(addprefix -e ,$(IGNORED_DIRS))))
# memoize allpackages, so that it's executed only once and only if used
allpackages = $(if $(__allpackages),,$(eval __allpackages := $$(_allpackages)))$(__allpackages)
-allfiles = $(if $(__allfiles),,$(eval __allfiles := $$(_allfiles)))$(__allfiles)
export GOPATH := $(CURDIR)/.GOPATH
-unexport GOBIN
+export GOBIN := $(CURDIR)/bin
Q := $(if $V,,@)
.GOPATH/.ok:
- $Q mkdir -p "$(dir .GOPATH/src/$(IMPORT_PATH))"
- $Q ln -s ../../../.. ".GOPATH/src/$(IMPORT_PATH)"
- $Q mkdir -p .GOPATH/test .GOPATH/cover
- $Q mkdir -p bin
- $Q ln -s ../bin .GOPATH/bin
- $Q touch $@
+ mkdir -p .GOPATH
.PHONY: bin/gocovmerge bin/golangci-lint
bin/gocovmerge: .GOPATH/.ok