summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2023-02-04 16:39:18 -0800
committerStan Hu <stanhu@gmail.com>2023-02-07 21:15:15 -0800
commit435def366122ffc39686f68052d3ed83b19055d3 (patch)
tree198bcd1896cd29bcec9f46cd7a472cfec77f22ba
parent336c4a51aa332b0cc1c68798003a1d82ab4a9cc3 (diff)
downloadgitlab-shell-435def366122ffc39686f68052d3ed83b19055d3.tar.gz
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
-rw-r--r--Makefile7
1 files 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