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

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

Open pront opened 1 day ago

pront commented 1 day ago

Problem:

Build error:

clang: error: overriding '-mmacos-version-min=14.7' option with '--target=arm64-apple-macosx15.1' [-Werror,-Woverriding-option] ``` error: failed to run custom build command for `aws-lc-fips-sys v0.12.13` note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation. Caused by: process didn't exit successfully: `/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-4a4993c8465640bf/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-a5a091a5020ce430/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-a5a091a5020ce430/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 negative, NOT enabling AWS_LC_STDALIGN_AVAILABLE: -- Change Dir: '/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-a5a091a5020ce430/out/build/aws-lc/CMakeFiles/CMakeTmp' Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /opt/homebrew/bin/gmake -f Makefile cmTC_5969a/fast /opt/homebrew/bin/gmake -f CMakeFiles/cmTC_5969a.dir/build.make CMakeFiles/cmTC_5969a.dir/build gmake[1]: Entering directory '/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-a5a091a5020ce430/out/build/aws-lc/CMakeFiles/CMakeTmp' /opt/homebrew/opt/llvm/bin/clang -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx15.1 -fno-function-sections -fno-data-sections -std=c99 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Werror -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wwrite-strings -Wformat-security -Wunused-result -Wvla -Wtype-limits -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -ggdb -Wall -fvisibility=hidden -fno-common -Wnewline-eof -fcolor-diagnostics -Wstring-concatenation -Wimplicit-fallthrough -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -Werror -MD -MT CMakeFiles/cmTC_5969a.dir/stdalign_check.c.o -MF CMakeFiles/cmTC_5969a.dir/stdalign_check.c.o.d -o CMakeFiles/cmTC_5969a.dir/stdalign_check.c.o -c /Users/pavlos.rontidis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-fips-sys-0.12.13/aws-lc/tests/compiler_features_tests/stdalign_check.c clang: error: overriding '-mmacos-version-min=14.7' option with '--target=arm64-apple-macosx15.1' [-Werror,-Woverriding-option] gmake[1]: *** [CMakeFiles/cmTC_5969a.dir/build.make:82: CMakeFiles/cmTC_5969a.dir/stdalign_check.c.o] Error 1 gmake[1]: Leaving directory '/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-a5a091a5020ce430/out/build/aws-lc/CMakeFiles/CMakeTmp' gmake: *** [Makefile:133: cmTC_5969a/fast] Error 2 -- builtin_swap_check.c probe is negative, NOT enabling AWS_LC_BUILTIN_SWAP_SUPPORTED: -- Change Dir: '/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-a5a091a5020ce430/out/build/aws-lc/CMakeFiles/CMakeTmp' Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /opt/homebrew/bin/gmake -f Makefile cmTC_bbde8/fast /opt/homebrew/bin/gmake -f CMakeFiles/cmTC_bbde8.dir/build.make CMakeFiles/cmTC_bbde8.dir/build gmake[1]: Entering directory '/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-a5a091a5020ce430/out/build/aws-lc/CMakeFiles/CMakeTmp' /opt/homebrew/opt/llvm/bin/clang -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx15.1 -fno-function-sections -fno-data-sections -std=c99 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Werror -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wwrite-strings -Wformat-security -Wunused-result -Wvla -Wtype-limits -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -ggdb -Wall -fvisibility=hidden -fno-common -Wnewline-eof -fcolor-diagnostics -Wstring-concatenation -Wimplicit-fallthrough -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -Werror -MD -MT CMakeFiles/cmTC_bbde8.dir/builtin_swap_check.c.o -MF CMakeFiles/cmTC_bbde8.dir/builtin_swap_check.c.o.d -o CMakeFiles/cmTC_bbde8.dir/builtin_swap_check.c.o -c /Users/pavlos.rontidis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-fips-sys-0.12.13/aws-lc/tests/compiler_features_tests/builtin_swap_check.c clang: error: overriding '-mmacos-version-min=14.7' option with '--target=arm64-apple-macosx15.1' [-Werror,-Woverriding-option] gmake[1]: *** [CMakeFiles/cmTC_bbde8.dir/build.make:82: CMakeFiles/cmTC_bbde8.dir/builtin_swap_check.c.o] Error 1 gmake[1]: Leaving directory '/Users/pavlos.rontidis/CLionProjects/vector/target/debug/build/aws-lc-fips-sys-a5a091a5020ce430/out/build/aws-lc/CMakeFiles/CMakeTmp' gmake: *** [Makefile:133: cmTC_bbde8/fast] Error 2 -- Disabling debug symbols for Clang internal assembler -- Configuring incomplete, errors occurred! --- 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 value or use a ... 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 value or use a ... 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. CMake Error at /opt/homebrew/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /opt/homebrew/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE) /opt/homebrew/share/cmake/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) aws-lc/crypto/CMakeLists.txt:623 (find_package) 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: 1 build script failed, must exit now stack backtrace: 0: rust_begin_unwind at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5 1: core::panicking::panic_fmt at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14 2: cmake::fail 3: cmake::run 4: cmake::Config::build 5: build_script_main::cmake_builder::CmakeBuilder::build_rust_wrapper 6: ::build 7: build_script_main::main 8: core::ops::function::FnOnce::call_once note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ```

You can checkout this PR: https://github.com/vectordotdev/vector/pull/21504

Relevant details

AWS-LC for Rust versions or commit:

aws-lc-fips-sys v0.12.13

System information:

❯ sw_vers
ProductName:        macOS
ProductVersion:     14.7.1
BuildVersion:       23H222
❯ xcodebuild -showsdks
DriverKit SDKs:
        DriverKit 24.1                  -sdk driverkit24.1

iOS SDKs:
        iOS 18.1                        -sdk iphoneos18.1

iOS Simulator SDKs:
        Simulator - iOS 18.1            -sdk iphonesimulator18.1

macOS SDKs:
        macOS 15.1                      -sdk macosx15.1
        macOS 15.1                      -sdk macosx15.1

tvOS SDKs:
        tvOS 18.1                       -sdk appletvos18.1

tvOS Simulator SDKs:
        Simulator - tvOS 18.1           -sdk appletvsimulator18.1

visionOS SDKs:
        visionOS 2.1                    -sdk xros2.1

visionOS Simulator SDKs:
        Simulator - visionOS 2.1        -sdk xrsimulator2.1

watchOS SDKs:
        watchOS 11.1                    -sdk watchos11.1

watchOS Simulator SDKs:
        Simulator - watchOS 11.1        -sdk watchsimulator11.1

Build log: See above.

❯ 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
justsmth commented 17 hours ago

Hello @pront -- Thanks for reporting this!

We started noticing this failure on certain CI jobs a couple of weeks ago. I put up a PR to address it: #584

As a workaround, you might try setting CFLAGS in your environment:

export CFLAGS="-Wno-overriding-t-option"

This appears to have worked when I tested it here.

We plan to put out another release of aws-lc-fips-sys soon to correct this issue.

pront commented 17 hours ago

We plan to put out another release of aws-lc-fips-sys soon to correct this issue.

Thank you @justsmth. Looking forward to the next release.