aws / amazon-ecs-init

Amazon Elastic Container Service RPM
http://aws.amazon.com/ecs
Apache License 2.0
199 stars 118 forks source link

Cannot build RPM package on CentOS 7.9.2009 #458

Closed alencar closed 2 years ago

alencar commented 2 years ago

Summary

Cannot built RPM package on CentOS 7.9.2009

Description

While trying to build ecs-init package with CentOS, the package build fails

Steps

git clone https://github.com/aws/amazon-ecs-init.git
cd amazon-ecs-init
git checkout -b v1.57.0-1 v1.57.0-1
make generic-rpm

Expected Behaviour

RPM package is builds successful

Observed Behaviour

RPM package is not built with an error 1

Environment Details

Sources

$ git log -1
commit 1bc76f44b5e4d22f2f5ff943a974356aab48be72
Author: Feng Xiong <fenxiong@amazon.com>
Date:   Wed Nov 3 17:48:50 2021 +0000

    Release 1.57.0-1

CentOS Linux 7.9.2009 GCC 4.8.5 20150623 (Red Hat 4.8.5-44) Go 1.7.3 linux/amd64

Supporting Log Snippets

mkdir -p $WORK/github.com/aws/amazon-ecs-init/ecs-init/cache/_obj/
cd /tmp/tmp.ftQItHpaLW/src/github.com/aws/amazon-ecs-init/ecs-init/cache
/usr/lib/golang/pkg/tool/linux_amd64/compile -o $WORK/github.com/aws/amazon-ecs-init/ecs-init/cache.a -trimpath $WORK -p github.com/aws/amazon-ecs-init/ecs-init/cache -complete -buildid 4c9be9297ba09e670a184fab4bc896746b84780d -importmap github.com/aws/aws-sdk-go/aws=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/aws/aws-sdk-go/aws -importmap github.com/aws/aws-sdk-go/aws/credentials=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/aws/aws-sdk-go/aws/credentials -importmap github.com/aws/aws-sdk-go/aws/ec2metadata=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata -importmap github.com/aws/aws-sdk-go/aws/session=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/aws/aws-sdk-go/aws/session -importmap github.com/aws/aws-sdk-go/service/s3=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/aws/aws-sdk-go/service/s3 -importmap github.com/aws/aws-sdk-go/service/s3/s3manager=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager -importmap github.com/cihub/seelog=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/cihub/seelog -importmap github.com/golang/mock/gomock=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/golang/mock/gomock -importmap github.com/pkg/errors=github.com/aws/amazon-ecs-init/ecs-init/vendor/github.com/pkg/errors -D _/tmp/tmp.ftQItHpaLW/src/github.com/aws/amazon-ecs-init/ecs-init/cache -I $WORK -I /tmp/tmp.ftQItHpaLW/pkg/linux_amd64 -pack ./cache.go ./dependencies.go ./dependencies_mocks.go
error: Bad exit status from /var/tmp/rpm-tmp.mpoqqn (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.mpoqqn (%build)
make: *** [.generic-rpm-done] Error 1
[centos@ip-172-24-9-154 amazon-ecs-init]$ cat /var/tmp/rpm-tmp.mpoqqn
#!/bin/sh

  RPM_SOURCE_DIR="/home/centos/amazon-ecs-init/SOURCES"
  RPM_BUILD_DIR="/home/centos/amazon-ecs-init/BUILD"
  RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic"
  RPM_LD_FLAGS="-Wl,-z,relro "
  RPM_ARCH="x86_64"
  RPM_OS="linux"
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS
  RPM_DOC_DIR="/usr/share/doc"
  export RPM_DOC_DIR
  RPM_PACKAGE_NAME="amazon-ecs-init"
  RPM_PACKAGE_VERSION="1.57.0"
  RPM_PACKAGE_RELEASE="1"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  LANG=C
  export LANG
  unset CDPATH DISPLAY ||:
  RPM_BUILD_ROOT="/home/centos/amazon-ecs-init/BUILDROOT/amazon-ecs-init-1.57.0-1.x86_64"
  export RPM_BUILD_ROOT

  PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib64/pkgconfig:/usr/share/pkgconfig"
  export PKG_CONFIG_PATH

  set -x
  umask 022
  cd "/home/centos/amazon-ecs-init/BUILD"
cd 'amazon-ecs-init-1.57.0'
./scripts/gobuild.sh generic_rpm
lydiafilipe commented 2 years ago

It looks like this may be due to using Go 1.7.3, it seems that some of the dependencies require a later version, are you able to upgrade the go version? The ECS agent currently uses 1.17.3, so that would be recommended, though I believe above 1.8 should work.

angelcar commented 2 years ago

Closing for now as we haven't heard back. Feel free to reopen if there are more questions or concerns.