aws / efs-utils

Utilities for Amazon Elastic File System (EFS)
MIT License
294 stars 188 forks source link

Issue installing (compiling efs-proxy) with newer versions - gcc 13 - SLES 15 SP 5 #220

Closed guisesterheim closed 4 months ago

guisesterheim commented 4 months ago

Hi!

I'm trying to follow the installation path for SLES Enterprise and apparently gcc 13 doesn't want to be my friend. Can I have some help please? Thank you very much in advance!

The error:

= note: lto1: fatal error: bytecode stream in file '/tmp/efs-utils/build/rpmbuild/BUILD/amazon-efs-utils/src/proxy/target/release/deps/libs2n_tls_sys-7028e52286416882.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.E4WvPA (%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.E4WvPA (%build) make: *** [Makefile:51: rpm-only] Error 1

cat /etc/os-release

NAME="SLES" VERSION="15-SP5" VERSION_ID="15.5" PRETTY_NAME="SUSE Linux Enterprise Server 15 SP5" ID="sles" ID_LIKE="suse" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:suse:sles:15:sp5" VARIANT_ID="sles-sap"

zypper info gcc

Information for package gcc:

Repository : SLE-Module-Basesystem15-SP5-Pool Name : gcc Version : 7-3.9.1 Arch : x86_64 Vendor : SUSE LLC https://www.suse.com/ Support Level : Level 3 Installed Size : 0 B Installed : Yes Status : up-to-date Source package : gcc-7-3.9.1.src Upstream URL : http://gcc.gnu.org/ Summary : The system GNU C Compiler Description : The system GNU C Compiler.

zypper info make Information for package make:

Repository : SLE-Module-Basesystem15-SP5-Pool Name : make Version : 4.2.1-7.3.2 Arch : x86_64 Vendor : SUSE LLC https://www.suse.com/ Support Level : Level 3 Installed Size : 394.6 KiB Installed : Yes Status : up-to-date Source package : make-4.2.1-7.3.2.src Upstream URL : http://www.gnu.org/software/make/make.html Summary : GNU make Description : The GNU make command with extensive documentation.

zypper info rpm-build Information for package rpm-build:

Repository : SLE-Module-DevTools15-SP5-Updates Name : rpm-build Version : 4.14.3-150400.59.16.1 Arch : x86_64 Vendor : SUSE LLC https://www.suse.com/ Support Level : Level 3 Installed Size : 29.0 KiB Installed : Yes Status : up-to-date Source package : rpm-4.14.3-150400.59.16.1.src Summary : Tools and Scripts to create rpm packages Description : If you want to build a rpm, you need this package. It provides rpmbuild and requires some packages that are usually required.

zypper info rust Information for package rust:

Repository : SLE-Module-DevTools15-SP5-Updates Name : rust Version : 1.78.0-150500.27.12.1 Arch : x86_64 Vendor : SUSE LLC https://www.suse.com/ Support Level : Level 3 Installed Size : 79 B Installed : Yes Status : up-to-date Source package : rust-1.78.0-150500.27.12.1.src Upstream URL : https://www.rust-lang.org Summary : A systems programming language Description : Rust is a systems programming language focused on three goals: safety, speed, and concurrency.

anthotse commented 4 months ago

There seems to be an issue with compiling efs-utils when using cargo/rust installed from zypper. I was able to successfully build efs-utils when using cargo/rust installed from rustup instead. Please try these instructions:

Install rust and cargo using rustup (https://www.rust-lang.org/tools/install).

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "$HOME/.cargo/env"

Then, install dependencies and build/install efs-utils.

$ sudo zypper refresh
$ sudo zypper install -y git rpm-build make openssl-devel
$ git clone https://github.com/aws/efs-utils
$ cd efs-utils
$ make rpm
$ sudo zypper --no-gpg-checks install -y build/amazon-efs-utils*rpm
guisesterheim commented 4 months ago

Thank you @anthotse

Here's the Ansible code for achieving the same:

---

- name: Install Rust and Cargo from rustup
  shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

- name: Make sure efs-utils is not present
  file:
    path: /tmp/efs-utils
    state: absent

- name: Clone efs-utils repo
  command: git clone https://github.com/aws/efs-utils /tmp/efs-utils

- name: Make rpm
  shell: |
    export PATH="/root/.cargo/bin:$PATH" && \
    make clean rpm
  args:
    chdir: /tmp/efs-utils

- name: Find generated RPM file
  find:
    paths: /tmp/efs-utils/build
    patterns: 'amazon-efs-utils*rpm'
  register: found_rpm_file

- name: Install amazon-efs-utils
  yum:
    name: "{{ found_rpm_file.files[0].path }}"
    state: present
    disable_gpg_check: true