Skip to content

Build golangci-lint and dependencies in a global temp dir

What does this MR do?

Changes the Makefile to build golangci-lint and goargs outside the GitLab Runner source code directory in the global temp dir. The compiled assets remain in their current location (.tmp/).

Why was this MR needed?

Running make lint on macOS 12.6.1 with Go 1.18.8 results in a number of errors:

plugin/analyzer.go:5:2: no required module provides package gitlab.com/pedropombeiro/goargs; to add it:
	go get gitlab.com/pedropombeiro/goargs

Once fixing that one, I get this error:

main module (gitlab.com/gitlab-org/gitlab-runner) does not contain package gitlab.com/gitlab-org/gitlab-runner/.tmp/build/golangci-lint/cmd/golangci-lint

This error occurs only on macOS. On Fedora 36 and Debian 11 the version on main works without problem.

What's the best way to test this MR?

Run make lint on macOS 12 with Go 1.18.

What are the relevant issue numbers?

n/a

Edited by Kevin Goslar

Merge request reports