aws / efs-utils

Utilities for Amazon Elastic File System (EFS)
MIT License
300 stars 191 forks source link

SLES 15 SP6 spec/build issue #231

Closed jirib closed 5 days ago

jirib commented 3 months ago

The built was failing with

_64-unknown-linux-gnu/lib" "-o" "/root/efs-utils/build/rpmbuild/BUILD/amazon-efs-utils/src/proxy/target/release/deps/efs_proxy-e5a87a8b52c39e4a" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: lto1: fatal error: bytecode stream in file '/root/efs-utils/build/rpmbuild/BUILD/amazon-efs-utils/src/proxy/target/release/deps/libs2n_tls_sys-7ceb4c2a5758ddae.rlib' generated with GCC compiler older than 10.0
          compilation terminated.
          lto-wrapper: fatal error: gcc-13 returned 1 exit status
          compilation terminated.
          /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: error: lto-wrapper failed
          collect2: error: ld returned 1 exit status

error: could not compile `efs-proxy` (bin "efs-proxy") due to 1 previous error
error: Bad exit status from /var/tmp/rpm-tmp.cDIgTK (%build)

RPM build errors:
    bogus date in %changelog: Mon Apr 23 2024 Ryan Stankiewicz <rjstank@amazon.com> - 2.0.1
    bogus date in %changelog: Wed Jan 1 2023 Ryan Stankiewicz <rjstank@amazon.com> - 1.34.5
    Bad exit status from /var/tmp/rpm-tmp.cDIgTK (%build)
make: *** [Makefile:51: rpm-only] Error 1
$ rpm -qa gcc gcc13
gcc-7-3.9.1.x86_64
gcc13-13.3.0+git8781-150000.1.12.1.x86_64

I workaround that with the following - first the spec file, then the build itself:

%make_build CC="$CC" EXTRA_CFLAGS="$CFLAGS" EXTRA_LDFLAGS="$LDFLAGS"

and built it with

env LDFLAGS="-L /usr/lib64/gcc/x86_64-suse-linux/13/" CPPFLAGS="-I/usr/lib64/gcc/x86_64-suse-linux/13/include" CC=/usr/bin/gcc-13 make rpm
seanzatzdev-amazon commented 3 months ago

We will address this in the next release with https://github.com/aws/efs-utils/pull/228

jirib commented 3 months ago

We will address this in the next release with #228

not sure how replace of date can solve this... the issue seems in the linking part.

anthotse commented 3 months ago

There seems to be something wrong with using the cargo installed with zypper.

What I did for a successful make rpm:

  1. I launched an ec2 instance with suse-sles-15-sp6-v20240626-hvm-ssd-x86_64. Then I ran this as specified in the README:

  2. installed cargo with rustup

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    . "$HOME/.cargo/env"
  3. Ran the normal installation script

    sudo zypper refresh
    # cargo and rust here are installed again to make rpm build happy
    sudo zypper install -y git rpm-build make openssl-devel cargo rust
    git clone https://github.com/aws/efs-utils
    cd efs-utils
    make rpm # this succeeds.

If I uninstall rustup, make rpm fails with your error

rustup self uninstall 
make rpm

So a workaround right now is to install cargo/rust through rustup.