From 087534437836f00841657e3457259f90ef2dd7ee Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Tue, 3 Aug 2021 12:31:11 +0000 Subject: [PATCH] app-emulation/amazon-ssm-agent: cross-compile and use correct go version The ebuild was missing a call to go_export() which exports GOARCH, and so was always built for host architecture. While COREOS_GO_VERSION was specified as go1.12, src_compile() has to use '${EGO}' to make use of it, so we were building with go1.16 (latest). Upstream builds with 1.12 for this version, so we will do the same. Signed-off-by: Jeremi Piotrowski --- ...build => amazon-ssm-agent-2.3.1319.0-r1.ebuild} | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/{amazon-ssm-agent-2.3.1319.0.ebuild => amazon-ssm-agent-2.3.1319.0-r1.ebuild} (80%) diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0-r1.ebuild similarity index 80% rename from sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0-r1.ebuild index 1f31e8b76f..ce6c39e455 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0-r1.ebuild @@ -28,23 +28,25 @@ src_prepare() { } src_compile() { + go_export + # this is replication of commands from the vendor makefile # but without network activity during build phase local GO_LDFLAGS="-s -w -extldflags=-Wl,-z,now,-z,relro,-z,defs" export GOPATH="${WORKDIR}/${PN}-${PV}" export GO111MODULE="off" # set agent release version - BRAZIL_PACKAGE_VERSION=${PV} go run ./agent/version/versiongenerator/version-gen.go + BRAZIL_PACKAGE_VERSION=${PV} ${EGO} run ./agent/version/versiongenerator/version-gen.go # build all the tools - go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ -o bin/amazon-ssm-agent ./agent || die - go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ -o bin/ssm-cli ./agent/cli-main || die - go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ -o bin/ssm-document-worker ./agent/framework/processor/executer/outofproc/worker || die - go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ -o bin/ssm-session-logger ./agent/session/logging || die - go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ -o bin/ssm-session-worker ./agent/framework/processor/executer/outofproc/sessionworker || die }