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
317 stars 50 forks source link

Build fails on clang version 19.1.3 #601

Open pront opened 2 hours ago

pront commented 2 hours ago

Problem:

Continuation of https://github.com/aws/aws-lc-rs/issues/587#issuecomment-2483860842.

The build output:

error: failed to run custom build command for `aws-lc-fips-sys v0.12.13`

Caused by:
  process didn't exit successfully: `/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-e0039db9928a266f/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_NO_PREFIX
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_PREGENERATING_BINDINGS
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_EXTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_NO_ASM
  cargo:rustc-cfg=aarch64_apple_darwin
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_STATIC
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_STATIC
  cargo:rerun-if-env-changed=CMAKE_TOOLCHAIN_FILE
  cargo:rerun-if-env-changed=CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin
  CMAKE_TOOLCHAIN_FILE_aarch64-apple-darwin = None
  CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_aarch64-apple-darwin = None
  CMAKE_GENERATOR_aarch64_apple_darwin = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-apple-darwin = None
  CMAKE_PREFIX_PATH_aarch64_apple_darwin = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-apple-darwin = None
  CMAKE_aarch64_apple_darwin = None
  HOST_CMAKE = None
  CMAKE = Some("cmake")
  running: cd "/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-c12b65e2bed0dda8/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/Users/pavlos.rontidis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-fips-sys-0.12.13" "-DBUILD_SHARED_LIBS=1" "-DCMAKE_BUILD_TYPE=debug" "-DBORINGSSL_PREFIX=aws_lc_fips_0_12_13_" "-DBORINGSSL_PREFIX_HEADERS=/Users/pavlos.rontidis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-fips-sys-0.12.13/generated-include" "-DBUILD_TESTING=OFF" "-DBUILD_LIBSSL=OFF" "-DFIPS=1" "-DCMAKE_OSX_ARCHITECTURES=arm64" "-DCMAKE_SYSTEM_PROCESSOR=arm64" "-DCMAKE_INSTALL_PREFIX=/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-c12b65e2bed0dda8/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx15.1" "-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx15.1" "-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx15.1" "-DCMAKE_ASM_COMPILER=/opt/homebrew/opt/llvm/bin/clang" "--no-warn-unused-cli"
  Not searching for unused variables given on the command line.
  -- FIPS build mode configured
  -- FIPS entropy source method configured: Passive
  -- stdalign_check.c probe is positive, enabling AWS_LC_STDALIGN_AVAILABLE
  -- builtin_swap_check.c probe is positive, enabling AWS_LC_BUILTIN_SWAP_SUPPORTED
  -- Disabling debug symbols for Clang internal assembler
  -- Configuring done (1.4s)
  -- Generating done (0.2s)
  -- Build files have been written to: /Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-c12b65e2bed0dda8/out/build
  running: cd "/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-c12b65e2bed0dda8/out/build" && MAKEFLAGS="-j --jobserver-fds=8,9 --jobserver-auth=8,9" "cmake" "--build" "." "--target" "install" "--config" "Debug"
  [  0%] Built target boringssl_prefix_symbols
  [  0%] Built target global_target
  [ 21%] Built target bcm_library
  [ 22%] Built target bcm_o_target
  [ 24%] Built target jitterentropy
  [ 24%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/connect.c.o

  --- stderr
  CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
    Compatibility with CMake < 3.10 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Deprecation Warning at aws-lc/CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.10 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Warning (dev) at aws-lc/crypto/CMakeLists.txt:582 (add_custom_command):
    The following keywords are not supported when using
    add_custom_command(TARGET): DEPENDS.

    Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
    Run "cmake --help-policy CMP0175" for policy details.  Use the cmake_policy
    command to set the policy and suppress this warning.
  This warning is for project developers.  Use -Wno-dev to suppress it.

  gmake: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  /Users/pavlos.rontidis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-fips-sys-0.12.13/aws-lc/crypto/bio/connect.c:493:29: error: cast from 'bio_info_cb' (aka 'long (*)(struct bio_st *, int, const char *, int, long, long)') to 'int (*)(const struct bio_st *, int, int)' converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
    493 |       data->info_callback = (int (*)(const struct bio_st *, int, int))fp;
        |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  gmake[2]: *** [aws-lc/crypto/CMakeFiles/crypto_objects.dir/build.make:577: aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/connect.c.o] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:327: aws-lc/crypto/CMakeFiles/crypto_objects.dir/all] Error 2
  gmake: *** [Makefile:136: all] Error 2
  thread 'main' panicked at /Users/pavlos.rontidis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 2

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
``

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

System information: for linux, below info can be collected by running `uname -srvmp`
 * CPU architecture: (x86, x86-64, ARMv7...)
 * CPU name: (Xeon Platinum 8000, AMD EPYC 7000...)
 * OS: (Ubuntu 20.04, Windows Server 2019...)

Build log:
 * The log tells compiler and version.
```text
# Sample of build log
+ cargo build
...
clang --version
Homebrew clang version 19.1.3
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/19.1.3/bin
Configuration file: /opt/homebrew/etc/clang/arm64-apple-darwin23.cfg
❯ sw_vers
ProductName:        macOS
ProductVersion:     14.7.1
BuildVersion:       23H222
justsmth commented 2 hours ago

Oh Sorry! This was the same build error that we already have reported:

We've already fixed this on the mainline, but it won't be available for aws-lc-fips-sys until we switch over to the AWS-LC-FIPS 3.x branch -- which should be very soon!

The good news is that it finally prompted me to put up a PR to add Clang 19 to the AWS-LC CI: https://github.com/aws/aws-lc/pull/1998