Unable to build the runner project based on the documentation
I tired building the gitlab-runner project based on the instructions at https://docs.gitlab.com/runner/development/
But when running any make build command it get Missing required arguments. TARGET_FLAVOR and TARGET_FLAVOR_IMAGE_VERSION must be defined
.
Any tips on what I'm missing? I checked if this is something that needed to be passed as a parameter to make but have not found any documentation, ci-code or issues mentioning this.
Full build log:
Last login: Fri Sep 23 10:06:01 on ttys000
$ uname -m
x86_64
$ sw_vers
ProductName: macOS
ProductVersion: 12.6
BuildVersion: 21G115
$ go version
go version go1.19.1 darwin/amd64
$ export GOPATH=~/.go
$ export PATH=$PATH:$(go env GOPATH)/bin
$ docker version
Client:
Cloud integration: v1.0.29
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:04:45 2022
OS/Arch: darwin/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.12.0 (85629)
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:01:23 2022
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.6.8
GitCommit: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
$ git clone git@gitlab.com:gitlab-org/gitlab-runner.git
Cloning into 'gitlab-runner'...
remote: Enumerating objects: 110286, done.
remote: Counting objects: 100% (1793/1793), done.
remote: Compressing objects: 100% (768/768), done.
remote: Total 110286 (delta 1161), reused 1491 (delta 996), pack-reused 108493
Receiving objects: 100% (110286/110286), 160.85 MiB | 5.82 MiB/s, done.
Resolving deltas: 100% (63615/63615), done.
$ cd gitlab-runner
$ make deps
go install github.com/mitchellh/gox@v1.0.1
# Installing "https://github.com/vektra/mockery/releases/download/v1.1.0/mockery_1.1.0_Darwin_x86_64.tar.gz" as .tmp/mockery-1.1.0
$ make runner-and-helper-bin-host
# Building gitlab-runner in version 15.5.0~beta.58.g0d2ad7a9 for host platform
/Applications/Xcode.app/Contents/Developer/usr/bin/make runner-bin BUILD_PLATFORMS="-osarch=darwin/amd64"
go install github.com/mitchellh/gox@v1.0.1
# Building gitlab-runner in version 15.5.0~beta.58.g0d2ad7a9 for -osarch=darwin/amd64
gox -osarch=darwin/amd64 \
-ldflags "-X gitlab.com/gitlab-org/gitlab-runner/common.NAME=gitlab-runner -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=15.5.0~beta.58.g0d2ad7a9 -X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=0d2ad7a9 -X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=2022-09-23T08:10:13+0000 -X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=main -w" \
-output="out/binaries/gitlab-runner-{{.OS}}-{{.Arch}}" \
gitlab.com/gitlab-org/gitlab-runner
Number of parallel builds: 15
--> darwin/amd64: gitlab.com/gitlab-org/gitlab-runner
cp -f "out/binaries/gitlab-runner-darwin-amd64" out/binaries/gitlab-runner
go install github.com/mitchellh/gox@v1.0.1
gox -osarch=linux/amd64 -ldflags "-X gitlab.com/gitlab-org/gitlab-runner/common.NAME="gitlab-runner-helper" -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=15.5.0~beta.58.g0d2ad7a9 -X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=0d2ad7a9 -X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=2022-09-23T08:10:13+0000 -X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=main -w" -output=out/binaries/gitlab-runner-helper/gitlab-runner-helper.x86_64 gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Number of parallel builds: 15
--> linux/amd64: gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
go install github.com/mitchellh/gox@v1.0.1
gox -osarch=linux/amd64 -ldflags "-X gitlab.com/gitlab-org/gitlab-runner/common.NAME=gitlab-runner -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=15.5.0~beta.58.g0d2ad7a9 -X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=0d2ad7a9 -X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=2022-09-23T08:10:13+0000 -X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=main -w" -output=out/binaries/gitlab-runner-helper/gitlab-runner-helper.x86_64 gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Number of parallel builds: 15
--> linux/amd64: gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Missing required arguments. TARGET_FLAVOR and TARGET_FLAVOR_IMAGE_VERSION must be defined
make[1]: *** [out/helper-images/prebuilt-alpine-x86_64.tar] Error 1
make: *** [helper-dockerarchive-host] Error 2