aws / aws-lc-rs

aws-lc-rs is a cryptographic library using AWS-LC for its cryptographic operations. The library strives to be API-compatible with the popular Rust library named ring.
Other
318 stars 49 forks source link

github actions ubuntu 24 can't build aws-lc #474

Closed daywalker90 closed 3 months ago

daywalker90 commented 3 months ago

Problem:

github actions with ubuntu 24.04 trying to build aws-lc-sys v0.20.1 fails

Relevant details

AWS-LC for Rust versions or commit: (6b1bce0...)

[[package]]
name = "aws-lc-rs"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77"
dependencies = [
 "aws-lc-sys",
 "mirai-annotations",
 "paste",
 "zeroize",
]

[[package]]
name = "aws-lc-sys"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f0e249228c6ad2d240c2dc94b714d711629d52bad946075d8e9b2f5391f0703"
dependencies = [
 "bindgen",
 "cc",
 "cmake",
 "dunce",
 "fs_extra",
 "libc",
 "paste",
]

System information: for linux, below info can be collected by running uname -srvmp

Build log:

Caused by: process didn't exit successfully: /target/optimized/build/aws-lc-sys-63b1b5d13166e747/build-script-main (exit status: 101) --- stdout cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX cargo:rerun-if-env-changed=AWS_LC_SYS_INTERNAL_BINDGEN cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM cargo:rustc-cfg=x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC default_for Target: 'x86_64-unknown-linux-gnu' cargo:rerun-if-env-changed=CARGO_FEATURE_SSL default_for Target: 'x86_64-unknown-linux-gnu' cargo:rerun-if-env-changed=CARGO_FEATURE_SSL cargo:root=/target/x86_64-unknown-linux-gnu/optimized/build/aws-lc-sys-77b830ae1e41e2b4/out default_for Target: 'x86_64-unknown-linux-gnu' OPT_LEVEL = Some(3) TARGET = Some(x86_64-unknown-linux-gnu) OUT_DIR = Some(/target/x86_64-unknown-linux-gnu/optimized/build/aws-lc-sys-77b830ae1e41e2b4/out) HOST = Some(x86_64-unknown-linux-gnu) cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu CC_x86_64-unknown-linux-gnu = None cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu CC_x86_64_unknown_linux_gnu = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT RUSTC_WRAPPER = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None DEBUG = Some(false) CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2) cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu CFLAGS_x86_64-unknown-linux-gnu = None cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu CFLAGS_x86_64_unknown_linux_gnu = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None

--- stderr thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.20.1/builder/cc_builder.rs:244:13: Your compiler (cc) is not supported due to a memcmp related bug reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189.We strongly recommend against using this compiler.EXECUTED: true ERROR: OUTPUT:
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... Error: Process completed with exit code 101.

justsmth commented 3 months ago

Your compiler (cc) is not supported due to a memcmp related bug reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189.We strongly recommend against using this compiler.

It appears our build script detected that your compiler is affected by this bug. You can see the build logic for detecting that bug here. The program we compiler/run to detect this bug is memcmp_invalid_stripped_check.c.

Do you know which compiler is being used for this build? (I don't see it listed in the output.)

daywalker90 commented 3 months ago

These are installed on the image:

gcc --version
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
clang --version
Ubuntu clang version 18.1.3 (1ubuntu1)

CC and CXX are not set so i think ubuntu defaults to gcc

also for reference: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md

justsmth commented 3 months ago

Rust's cc crate appears to use the cc command. What compiler version does running cc indicate? (It's typically the same compiler as "gcc".)

justsmth commented 3 months ago

Another step that might help us diagnose the issue would be to set AWS_LC_SYS_CMAKE_BUILDER=1 in your build environment to force the build to use CMake. I'm curious whether it will report the same compiler bug.

daywalker90 commented 3 months ago
cc --version
cc (Ubuntu 13.2.0-23ubuntu4) 13.2.0

seems to be gcc

justsmth commented 3 months ago

Are you also having build failures when setting AWS_LC_SYS_CMAKE_BUILDER=1?

daywalker90 commented 3 months ago

I can't reproduce it even without setting that atm. Something else must have updated and fixed it or something