From 31ebcbc9cd21049637753058068c86a9b57408f3 Mon Sep 17 00:00:00 2001 From: Fred Heinecke Date: Thu, 10 Mar 2022 10:23:10 -0600 Subject: [PATCH 1/6] Attempted fix of RPM naming issue --- Makefile | 2 +- build.assets/build-package.sh | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4200a5992304a..3081ec1b18898 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ # Stable releases: "1.0.0" # Pre-releases: "1.0.0-alpha.1", "1.0.0-beta.2", "1.0.0-rc.3" # Master/dev branch: "1.0.0-dev" -VERSION=9.0.0-rc.1 +VERSION=9.0.0-fred.5 DOCKER_IMAGE ?= quay.io/gravitational/teleport DOCKER_IMAGE_CI ?= quay.io/gravitational/teleport-ci diff --git a/build.assets/build-package.sh b/build.assets/build-package.sh index 6295dd7ca31a2..a55e0b3bca9d9 100755 --- a/build.assets/build-package.sh +++ b/build.assets/build-package.sh @@ -192,11 +192,6 @@ elif [[ "${ARCH}" == "arm64" ]]; then TEXT_ARCH="ARMv8/ARM64" fi -# amd64 RPMs should use CentOS 7 compatible artifacts -if [[ "${PACKAGE_TYPE}" == "rpm" && "${ARCH}" == "x86_64" ]]; then - OPTIONAL_RUNTIME_SECTION+="-centos7" -fi - # set optional runtime section for filename if [[ "${RUNTIME}" == "fips" ]]; then OPTIONAL_RUNTIME_SECTION+="-fips" From e4da1ef435af3b4751d2a66b1014a01a5a12d0fc Mon Sep 17 00:00:00 2001 From: Fred Heinecke Date: Thu, 10 Mar 2022 10:42:42 -0600 Subject: [PATCH 2/6] Another try --- Makefile | 2 +- build.assets/build-package.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3081ec1b18898..c196c28c373c8 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ # Stable releases: "1.0.0" # Pre-releases: "1.0.0-alpha.1", "1.0.0-beta.2", "1.0.0-rc.3" # Master/dev branch: "1.0.0-dev" -VERSION=9.0.0-fred.5 +VERSION=9.0.0-fred.6 DOCKER_IMAGE ?= quay.io/gravitational/teleport DOCKER_IMAGE_CI ?= quay.io/gravitational/teleport-ci diff --git a/build.assets/build-package.sh b/build.assets/build-package.sh index a55e0b3bca9d9..1c9e23d7ddfc0 100755 --- a/build.assets/build-package.sh +++ b/build.assets/build-package.sh @@ -192,6 +192,11 @@ elif [[ "${ARCH}" == "arm64" ]]; then TEXT_ARCH="ARMv8/ARM64" fi +# amd64 RPMs should use CentOS 7 compatible artifacts +if [[ "${PACKAGE_TYPE}" == "rpm" && "${ARCH}" == "x86_64" ]]; then + OPTINAL_TARBALL_SECTION+="-centos7" +fi + # set optional runtime section for filename if [[ "${RUNTIME}" == "fips" ]]; then OPTIONAL_RUNTIME_SECTION+="-fips" @@ -199,7 +204,7 @@ fi # set variables appropriately depending on type of package being built if [[ "${TELEPORT_TYPE}" == "ent" ]]; then - TARBALL_FILENAME="teleport-ent-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz" + TARBALL_FILENAME="teleport-ent-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTINAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz" URL="${DOWNLOAD_ROOT}/${TARBALL_FILENAME}" TAR_PATH="teleport-ent" RPM_NAME="teleport-ent" @@ -210,7 +215,7 @@ if [[ "${TELEPORT_TYPE}" == "ent" ]]; then TYPE_DESCRIPTION="[${TEXT_ARCH} Enterprise edition]" fi else - TARBALL_FILENAME="teleport-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz" + TARBALL_FILENAME="teleport-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTINAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz" URL="${DOWNLOAD_ROOT}/${TARBALL_FILENAME}" TAR_PATH="teleport" RPM_NAME="teleport" From a19c0c1b657759776ad0d15314eef544652faad0 Mon Sep 17 00:00:00 2001 From: Fred Heinecke Date: Thu, 10 Mar 2022 10:57:43 -0600 Subject: [PATCH 3/6] Reverted makefile version --- Makefile | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index c196c28c373c8..399933fdf75c0 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ # Stable releases: "1.0.0" # Pre-releases: "1.0.0-alpha.1", "1.0.0-beta.2", "1.0.0-rc.3" # Master/dev branch: "1.0.0-dev" -VERSION=9.0.0-fred.6 +VERSION=10.0.0-dev DOCKER_IMAGE ?= quay.io/gravitational/teleport DOCKER_IMAGE_CI ?= quay.io/gravitational/teleport-ci @@ -728,7 +728,8 @@ version: $(VERSRC) # This rule triggers re-generation of version files specified if Makefile changes. $(VERSRC): Makefile VERSION=$(VERSION) $(MAKE) -f version.mk setver - # "TODO: Enable automatic updating of API import paths using update-api-import-path target once agreed upon the solution". + # Update api module path, but don't fail on error. + $(MAKE) update-api-import-path || true # This rule updates the api module path to be in sync with the current api release version. # e.g. github.com/gravitational/teleport/api/vX -> github.com/gravitational/teleport/api/vY @@ -819,19 +820,24 @@ enter: grpc: $(MAKE) -C build.assets grpc -# proto file dependencies within the api module must be passed with the 'M' flag. This -# way protoc generated files will use the correct api module import path in the case where -# the import path has a version suffix, e.g. github.com/gravitational/teleport/api/v8 -GOGOPROTO_IMPORTMAP ?= $\ - Mgithub.com/gravitational/teleport/api/types/types.proto=$(API_IMPORT_PATH)/types,$\ - Mgithub.com/gravitational/teleport/api/types/events/events.proto=$(API_IMPORT_PATH)/types/events,$\ - Mgithub.com/gravitational/teleport/api/types/wrappers/wrappers.proto=$(API_IMPORT_PATH)/types/wrappers,$\ - Mgithub.com/gravitational/teleport/api/types/webauthn/webauthn.proto=$(API_IMPORT_PATH)/types/webauthn +print/env: + env # buildbox-grpc generates GRPC stubs .PHONY: buildbox-grpc +buildbox-grpc: API_IMPORT_PATH := $(shell head -1 api/go.mod | awk '{print $$2}') +# Proto file dependencies within the api module must be passed with the 'M' +# flag. This way protoc generated files will use the correct api module import +# path in the case where the import path has a version suffix, e.g. +# "github.com/gravitational/teleport/api/v8". +buildbox-grpc: GOGOPROTO_IMPORTMAP := $\ + Mgithub.com/gravitational/teleport/api/types/events/events.proto=$(API_IMPORT_PATH)/types/events,$\ + Mgithub.com/gravitational/teleport/api/types/types.proto=$(API_IMPORT_PATH)/types,$\ + Mgithub.com/gravitational/teleport/api/types/webauthn/webauthn.proto=$(API_IMPORT_PATH)/types/webauthn,$\ + Mgithub.com/gravitational/teleport/api/types/wrappers/wrappers.proto=$(API_IMPORT_PATH)/types/wrappers,$\ + Mignoreme=ignoreme buildbox-grpc: - echo $$PROTO_INCLUDE + @echo "PROTO_INCLUDE = $$PROTO_INCLUDE" $(CLANG_FORMAT) -i -style='{ColumnLimit: 100, IndentWidth: 4, Language: Proto}' \ api/client/proto/authservice.proto \ api/client/proto/joinservice.proto \ @@ -844,9 +850,6 @@ buildbox-grpc: lib/multiplexer/test/ping.proto \ lib/web/envelope.proto -# we eval within the make target to avoid invoking `go run` with every other call to the makefile - $(eval API_IMPORT_PATH := $(shell go run build.assets/gomod/print-import-path/main.go ./api)) - cd api/client/proto && protoc -I=.:$$PROTO_INCLUDE \ --gogofast_out=plugins=grpc,$(GOGOPROTO_IMPORTMAP):. \ certs.proto authservice.proto joinservice.proto From 3c34a78926f26a6a5007f7e273b55ba5aa5fa2d5 Mon Sep 17 00:00:00 2001 From: Fred Heinecke Date: Thu, 10 Mar 2022 11:30:16 -0600 Subject: [PATCH 4/6] Reverted makefile back to branch/v9 version --- Makefile | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 399933fdf75c0..996111773e3f6 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ # Stable releases: "1.0.0" # Pre-releases: "1.0.0-alpha.1", "1.0.0-beta.2", "1.0.0-rc.3" # Master/dev branch: "1.0.0-dev" -VERSION=10.0.0-dev +VERSION=9.0.0-rc.1 DOCKER_IMAGE ?= quay.io/gravitational/teleport DOCKER_IMAGE_CI ?= quay.io/gravitational/teleport-ci @@ -728,8 +728,7 @@ version: $(VERSRC) # This rule triggers re-generation of version files specified if Makefile changes. $(VERSRC): Makefile VERSION=$(VERSION) $(MAKE) -f version.mk setver - # Update api module path, but don't fail on error. - $(MAKE) update-api-import-path || true + # "TODO: Enable automatic updating of API import paths using update-api-import-path target once agreed upon the solution". # This rule updates the api module path to be in sync with the current api release version. # e.g. github.com/gravitational/teleport/api/vX -> github.com/gravitational/teleport/api/vY @@ -820,24 +819,19 @@ enter: grpc: $(MAKE) -C build.assets grpc -print/env: - env +# proto file dependencies within the api module must be passed with the 'M' flag. This +# way protoc generated files will use the correct api module import path in the case where +# the import path has a version suffix, e.g. github.com/gravitational/teleport/api/v8 +GOGOPROTO_IMPORTMAP ?= $\ + Mgithub.com/gravitational/teleport/api/types/types.proto=$(API_IMPORT_PATH)/types,$\ + Mgithub.com/gravitational/teleport/api/types/events/events.proto=$(API_IMPORT_PATH)/types/events,$\ + Mgithub.com/gravitational/teleport/api/types/wrappers/wrappers.proto=$(API_IMPORT_PATH)/types/wrappers,$\ + Mgithub.com/gravitational/teleport/api/types/webauthn/webauthn.proto=$(API_IMPORT_PATH)/types/webauthn # buildbox-grpc generates GRPC stubs .PHONY: buildbox-grpc -buildbox-grpc: API_IMPORT_PATH := $(shell head -1 api/go.mod | awk '{print $$2}') -# Proto file dependencies within the api module must be passed with the 'M' -# flag. This way protoc generated files will use the correct api module import -# path in the case where the import path has a version suffix, e.g. -# "github.com/gravitational/teleport/api/v8". -buildbox-grpc: GOGOPROTO_IMPORTMAP := $\ - Mgithub.com/gravitational/teleport/api/types/events/events.proto=$(API_IMPORT_PATH)/types/events,$\ - Mgithub.com/gravitational/teleport/api/types/types.proto=$(API_IMPORT_PATH)/types,$\ - Mgithub.com/gravitational/teleport/api/types/webauthn/webauthn.proto=$(API_IMPORT_PATH)/types/webauthn,$\ - Mgithub.com/gravitational/teleport/api/types/wrappers/wrappers.proto=$(API_IMPORT_PATH)/types/wrappers,$\ - Mignoreme=ignoreme buildbox-grpc: - @echo "PROTO_INCLUDE = $$PROTO_INCLUDE" + echo $$PROTO_INCLUDE $(CLANG_FORMAT) -i -style='{ColumnLimit: 100, IndentWidth: 4, Language: Proto}' \ api/client/proto/authservice.proto \ api/client/proto/joinservice.proto \ @@ -850,6 +844,9 @@ buildbox-grpc: lib/multiplexer/test/ping.proto \ lib/web/envelope.proto +# we eval within the make target to avoid invoking `go run` with every other call to the makefile + $(eval API_IMPORT_PATH := $(shell go run build.assets/gomod/print-import-path/main.go ./api)) + cd api/client/proto && protoc -I=.:$$PROTO_INCLUDE \ --gogofast_out=plugins=grpc,$(GOGOPROTO_IMPORTMAP):. \ certs.proto authservice.proto joinservice.proto @@ -1051,4 +1048,4 @@ dronegen: # installed locally. To backport, type "make backport PR=1234 TO=branch/1,branch/2". .PHONY: backport backport: - (cd ./assets/backport && go run main.go -pr=$(PR) -to=$(TO)) + (cd ./assets/backport && go run main.go -pr=$(PR) -to=$(TO)) \ No newline at end of file From 790cdb824e9ff6d77b255d32d2d1978159cf5623 Mon Sep 17 00:00:00 2001 From: Fred Heinecke Date: Thu, 10 Mar 2022 11:32:11 -0600 Subject: [PATCH 5/6] Actually fixed makefile to branch/v9 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 996111773e3f6..4200a5992304a 100644 --- a/Makefile +++ b/Makefile @@ -1048,4 +1048,4 @@ dronegen: # installed locally. To backport, type "make backport PR=1234 TO=branch/1,branch/2". .PHONY: backport backport: - (cd ./assets/backport && go run main.go -pr=$(PR) -to=$(TO)) \ No newline at end of file + (cd ./assets/backport && go run main.go -pr=$(PR) -to=$(TO)) From de9933ae725b932e0c43188b2b59df7f3c263a9d Mon Sep 17 00:00:00 2001 From: fheinecke Date: Thu, 10 Mar 2022 11:32:38 -0600 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: Roman Tkachenko --- build.assets/build-package.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.assets/build-package.sh b/build.assets/build-package.sh index 1c9e23d7ddfc0..8a793184deb20 100755 --- a/build.assets/build-package.sh +++ b/build.assets/build-package.sh @@ -194,7 +194,7 @@ fi # amd64 RPMs should use CentOS 7 compatible artifacts if [[ "${PACKAGE_TYPE}" == "rpm" && "${ARCH}" == "x86_64" ]]; then - OPTINAL_TARBALL_SECTION+="-centos7" + OPTIONAL_TARBALL_SECTION+="-centos7" fi # set optional runtime section for filename @@ -204,7 +204,7 @@ fi # set variables appropriately depending on type of package being built if [[ "${TELEPORT_TYPE}" == "ent" ]]; then - TARBALL_FILENAME="teleport-ent-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTINAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz" + TARBALL_FILENAME="teleport-ent-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz" URL="${DOWNLOAD_ROOT}/${TARBALL_FILENAME}" TAR_PATH="teleport-ent" RPM_NAME="teleport-ent" @@ -215,7 +215,7 @@ if [[ "${TELEPORT_TYPE}" == "ent" ]]; then TYPE_DESCRIPTION="[${TEXT_ARCH} Enterprise edition]" fi else - TARBALL_FILENAME="teleport-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTINAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz" + TARBALL_FILENAME="teleport-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz" URL="${DOWNLOAD_ROOT}/${TARBALL_FILENAME}" TAR_PATH="teleport" RPM_NAME="teleport"