Skip to content

Commit 435def3

Browse files
committed
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
1 parent 336c4a5 commit 435def3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ GOBUILD_FLAGS := -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$
2424

2525
PREFIX ?= /usr/local
2626

27-
build: bin/gitlab-shell
27+
build: bin/gitlab-shell bin/gitlab-sshd
2828

2929
validate: verify test
3030

@@ -58,10 +58,13 @@ setup: _script_install bin/gitlab-shell
5858
_script_install:
5959
bin/install
6060

61-
compile: bin/gitlab-shell
61+
compile: bin/gitlab-shell bin/gitlab-sshd
6262
bin/gitlab-shell: $(GO_SOURCES)
6363
GOBIN="$(CURDIR)/bin" go install $(GOBUILD_FLAGS) ./cmd/...
6464

65+
bin/gitlab-sshd: $(GO_SOURCES)
66+
GOBIN="$(CURDIR)/bin" go install $(GOBUILD_FLAGS) ./cmd/gitlab-sshd
67+
6568
check:
6669
bin/check
6770

0 commit comments

Comments
 (0)