diff --git a/Makefile b/Makefile index 59616ad0777cf..207758136b0d5 100644 --- a/Makefile +++ b/Makefile @@ -45,8 +45,10 @@ GO_LDFLAGS ?= -w -s $(KUBECTL_SETVERSION) # debugger-friendly builds. ifeq ("$(TELEPORT_DEBUG)","true") BUILDFLAGS ?= $(ADDFLAGS) -gcflags=all="-N -l" +BUILDFLAGS_TBOT ?= $(ADDFLAGS) -gcflags=all="-N -l" else BUILDFLAGS ?= $(ADDFLAGS) -ldflags '$(GO_LDFLAGS)' -trimpath -buildmode=pie +BUILDFLAGS_TBOT ?= $(ADDFLAGS) -ldflags '$(GO_LDFLAGS)' -trimpath endif GO_ENV_OS := $(shell go env GOOS) @@ -278,6 +280,7 @@ $(error "Building for windows requires ARCH=amd64") endif CGOFLAG = CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ BUILDFLAGS = $(ADDFLAGS) -ldflags '-w -s $(KUBECTL_SETVERSION)' -trimpath -buildmode=pie +BUILDFLAGS_TBOT = $(ADDFLAGS) -ldflags '-w -s $(KUBECTL_SETVERSION)' -trimpath endif CGOFLAG_TSH ?= $(CGOFLAG) @@ -340,8 +343,14 @@ $(BUILDDIR)/tsh: GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG_TSH) go build -tags "$(FIPS_TAG) $(LIBFIDO2_BUILD_TAG) $(TOUCHID_TAG) $(PIV_BUILD_TAG) $(KUSTOMIZE_NO_DYNAMIC_PLUGIN)" -o $(BUILDDIR)/tsh $(BUILDFLAGS) ./tool/tsh .PHONY: $(BUILDDIR)/tbot +$(BUILDDIR)/tbot: CGO_ENABLED ?= 0 $(BUILDDIR)/tbot: - GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -tags "$(FIPS_TAG) $(KUSTOMIZE_NO_DYNAMIC_PLUGIN)" -o $(BUILDDIR)/tbot $(BUILDFLAGS) ./tool/tbot +# The -buildmode=pie flag requires external cgo linking. +ifeq ("$(CGO_ENABLED)", "1") + GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=1 go build -tags "$(FIPS_TAG) $(KUSTOMIZE_NO_DYNAMIC_PLUGIN)" -o $(BUILDDIR)/tbot $(BUILDFLAGS_TBOT) -buildmode=pie ./tool/tbot +else + GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 go build -tags "$(FIPS_TAG) $(KUSTOMIZE_NO_DYNAMIC_PLUGIN)" -o $(BUILDDIR)/tbot $(BUILDFLAGS_TBOT) ./tool/tbot +endif TELEPORT_ARGS ?= start .PHONY: teleport-hot-reload diff --git a/e b/e index c31a8ac95ae96..936421eec10c3 160000 --- a/e +++ b/e @@ -1 +1 @@ -Subproject commit c31a8ac95ae96fd542e65c65dcdc61454d05da9f +Subproject commit 936421eec10c3d52ea666b7bcd52e096e012642d diff --git a/integrations/teleport-spacelift-runner/Dockerfile b/integrations/teleport-spacelift-runner/Dockerfile index 19655bd0d9ae4..6482e96742079 100644 --- a/integrations/teleport-spacelift-runner/Dockerfile +++ b/integrations/teleport-spacelift-runner/Dockerfile @@ -30,12 +30,9 @@ RUN make build/tbot FROM $BASE_IMAGE # https://github.com/spacelift-io/runner-terraform/blob/main/Dockerfile -# Switch to root so we can invoke gcompat +# Switch to root so we can invoke chmod USER root -# Install gcompat to allow glibc compiled tbot to run on Spacelift. -RUN apk add --no-cache gcompat=1.1.0-r1 - # Copy in `tbot` COPY --from=builder /workspace/build/tbot /usr/local/bin RUN chmod 755 /usr/local/bin/tbot