From 435def366122ffc39686f68052d3ed83b19055d3 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 4 Feb 2023 16:39:18 -0800 Subject: Add bin/gitlab-sshd as an explicit Makefile target Since https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/682, Kerberos headers and libraries are needed to build gitlab-sshd. If they are not available, `make build` successfully compiles `bin/gitlab-shell` but fails to build `bin/gitlab-sshd`. However, running `make build` again would do nothing and appear to be succeed because `bin/gitlab-shell` existed. This led to Omnibus GitLab quietly dropping the `gitlab-sshd` binary, as seen in https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6446#note_1265879416. To ensure `make build` properly fails if `bin/gitlab-sshd` cannot be built, we make the binary an explicit build target. Changelog: changed --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 290a783..1745551 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ GOBUILD_FLAGS := -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$ PREFIX ?= /usr/local -build: bin/gitlab-shell +build: bin/gitlab-shell bin/gitlab-sshd validate: verify test @@ -58,10 +58,13 @@ setup: _script_install bin/gitlab-shell _script_install: bin/install -compile: bin/gitlab-shell +compile: bin/gitlab-shell bin/gitlab-sshd bin/gitlab-shell: $(GO_SOURCES) GOBIN="$(CURDIR)/bin" go install $(GOBUILD_FLAGS) ./cmd/... +bin/gitlab-sshd: $(GO_SOURCES) + GOBIN="$(CURDIR)/bin" go install $(GOBUILD_FLAGS) ./cmd/gitlab-sshd + check: bin/check -- cgit v1.2.1