Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIPS build fails with cmake 4.0.0 on MacOS #764

Open
sunjay opened this issue Apr 2, 2025 · 4 comments
Open

FIPS build fails with cmake 4.0.0 on MacOS #764

sunjay opened this issue Apr 2, 2025 · 4 comments

Comments

@sunjay
Copy link

sunjay commented Apr 2, 2025

Problem:

This is a follow up to: #755

Building on MacOS with cmake 4.0.0 seems to not be working with the fips feature flag enabled. I can reproduce this using this repo by itself outside of my project.

Full Build Output
% cmake --version
cmake version 4.0.0
% cargo build --features fips
  Updating crates.io index
   Locking 142 packages to latest compatible versions
    Adding bindgen v0.69.5 (available: v0.71.1)
    Adding home v0.5.5 (available: v0.5.11)
    Adding once_cell v1.20.3 (available: v1.21.3)
    Adding regex v1.9.6 (available: v1.11.1)
    Adding regex-automata v0.3.9 (available: v0.4.9)
    Adding regex-syntax v0.7.5 (available: v0.8.5)
    Adding untrusted v0.7.1 (available: v0.9.0)
    Adding which v5.0.0 (available: v7.0.2)
Downloaded untrusted v0.7.1
Downloaded jobserver v0.1.33
Downloaded regex-syntax v0.7.5
Downloaded regex v1.9.6
Downloaded regex-automata v0.3.9
Downloaded toml_edit v0.22.24
Downloaded winnow v0.7.4
Downloaded 7 crates (1.5 MB) in 0.87s
 Compiling libc v0.2.171
 Compiling shlex v1.3.0
 Compiling dunce v1.0.5
 Compiling fs_extra v1.3.0
 Compiling memchr v2.7.4
 Compiling regex-syntax v0.7.5
 Compiling equivalent v1.0.2
 Compiling hashbrown v0.15.2
 Compiling toml_datetime v0.6.8
 Compiling winnow v0.7.4
 Compiling aws-lc-rs v1.13.0 (/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-rs)
 Compiling zeroize v1.8.1
 Compiling untrusted v0.7.1
 Compiling aho-corasick v1.1.3
 Compiling indexmap v2.8.0
 Compiling toml_edit v0.22.24
 Compiling regex-automata v0.3.9
 Compiling jobserver v0.1.33
 Compiling cc v1.2.17
 Compiling cmake v0.1.54
 Compiling links-testing v0.1.0 (/Users/sunjay/Documents/projects/aws-lc-rs/links-testing)
 Compiling aws-lc-sys v0.28.0 (/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys)
 Compiling regex v1.9.6
 Compiling aws-lc-fips-sys v0.13.5 (/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-fips-sys)
warning: [email protected]: Building with: CC
warning: [email protected]: Symbol Prefix: Some("aws_lc_0_28_0")
warning: [email protected]: ######
warning: [email protected]: ###### WARNING: MISSING GIT SUBMODULE ######
warning: [email protected]:   -- Did you initialize the repo's git submodules? Unable to find source file: /Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/c11.c.
warning: [email protected]:   -- run 'git submodule update --init --recursive' to initialize.
warning: [email protected]: ######
warning: [email protected]: ######
warning: [email protected]: clang: error: no such file or directory: '/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/c11.c'
warning: [email protected]: clang: error: no input files
warning: [email protected]: Compilation of 'c11.c' failed - Err(Error { kind: ToolExecError, message: "command did not execute successfully (status code exit status: 1): env -u IPHONEOS_DEPLOYMENT_TARGET LC_ALL=\"C\" \"cc\" \"-O0\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-gdwarf-2\" \"-fno-omit-frame-pointer\" \"--target=arm64-apple-macosx\" \"-mmacosx-version-min=15.4\" \"-Werror\" \"-Wall\" \"-Wextra\" \"-Wno-unused-parameter\" \"-o\" \"/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out/out-c11/7dfda64fdf5a526c-c11.o\" \"-c\" \"/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/c11.c\"" }).
warning: [email protected]: ######
warning: [email protected]: ###### WARNING: MISSING GIT SUBMODULE ######
warning: [email protected]:   -- Did you initialize the repo's git submodules? Unable to find source file: /Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c.
warning: [email protected]:   -- run 'git submodule update --init --recursive' to initialize.
warning: [email protected]: ######
warning: [email protected]: ######
warning: [email protected]: clang: error: no such file or directory: '/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c'
warning: [email protected]: clang: error: no input files
warning: [email protected]: Compilation of 'stdalign_check.c' failed - Err(Error { kind: ToolExecError, message: "command did not execute successfully (status code exit status: 1): env -u IPHONEOS_DEPLOYMENT_TARGET LC_ALL=\"C\" \"cc\" \"-O0\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-gdwarf-2\" \"-fno-omit-frame-pointer\" \"--target=arm64-apple-macosx\" \"-mmacosx-version-min=15.4\" \"-Werror\" \"-Wall\" \"-Wextra\" \"-Wno-unused-parameter\" \"-o\" \"/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out/out-stdalign_check/7dfda64fdf5a526c-stdalign_check.o\" \"-c\" \"/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c\"" }).
warning: [email protected]: ######
warning: [email protected]: ###### WARNING: MISSING GIT SUBMODULE ######
warning: [email protected]:   -- Did you initialize the repo's git submodules? Unable to find source file: /Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c.
warning: [email protected]:   -- run 'git submodule update --init --recursive' to initialize.
warning: [email protected]: ######
warning: [email protected]: ######
warning: [email protected]: clang: error: no such file or directory: '/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c'
warning: [email protected]: clang: error: no input files
warning: [email protected]: Compilation of 'builtin_swap_check.c' failed - Err(Error { kind: ToolExecError, message: "command did not execute successfully (status code exit status: 1): env -u IPHONEOS_DEPLOYMENT_TARGET LC_ALL=\"C\" \"cc\" \"-O0\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-gdwarf-2\" \"-fno-omit-frame-pointer\" \"--target=arm64-apple-macosx\" \"-mmacosx-version-min=15.4\" \"-Werror\" \"-Wall\" \"-Wextra\" \"-Wno-unused-parameter\" \"-o\" \"/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out/out-builtin_swap_check/7dfda64fdf5a526c-builtin_swap_check.o\" \"-c\" \"/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c\"" }).
error: failed to run custom build command for `aws-lc-sys v0.28.0 (/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys)`

Caused by:
process didn't exit successfully: `/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-e8d3f31934712e75/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_PREGENERATING_BINDINGS
cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN
cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM
cargo:rerun-if-env-changed=AWS_LC_SYS_CFLAGS
cargo:rerun-if-env-changed=AWS_LC_SYS_PREBUILT_NASM
cargo:rerun-if-env-changed=AWS_LC_SYS_C_STD
cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER
cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREGENERATED_SRC
cargo:rustc-cfg=aarch64_apple_darwin
cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC
default_for Target: 'aarch64-apple-darwin'
cargo:rerun-if-env-changed=CARGO_FEATURE_SSL
cargo:warning=Building with: CC
cargo:warning=Symbol Prefix: Some("aws_lc_0_28_0")
default_for Target: 'aarch64-apple-darwin'
cargo:rerun-if-env-changed=CARGO_FEATURE_SSL
cargo:root=/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out
default_for Target: 'aarch64-apple-darwin'
OPT_LEVEL = Some(0)
OUT_DIR = Some(/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out)
TARGET = Some(aarch64-apple-darwin)
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
CC_aarch64-apple-darwin = None
cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
CC_aarch64_apple_darwin = 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(true)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
CARGO_ENCODED_RUSTFLAGS = Some()
cargo:warning=######
cargo:warning=###### WARNING: MISSING GIT SUBMODULE ######
cargo:warning=  -- Did you initialize the repo's git submodules? Unable to find source file: /Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/c11.c.
cargo:warning=  -- run 'git submodule update --init --recursive' to initialize.
cargo:warning=######
cargo:warning=######
OPT_LEVEL = Some(0)
TARGET = Some(aarch64-apple-darwin)
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
CC_aarch64-apple-darwin = None
cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
CC_aarch64_apple_darwin = 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(true)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
CARGO_ENCODED_RUSTFLAGS = Some()
cargo:warning=clang: error: no such file or directory: '/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/c11.c'
cargo:warning=clang: error: no input files
cargo:warning=Compilation of 'c11.c' failed - Err(Error { kind: ToolExecError, message: "command did not execute successfully (status code exit status: 1): env -u IPHONEOS_DEPLOYMENT_TARGET LC_ALL=\"C\" \"cc\" \"-O0\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-gdwarf-2\" \"-fno-omit-frame-pointer\" \"--target=arm64-apple-macosx\" \"-mmacosx-version-min=15.4\" \"-Werror\" \"-Wall\" \"-Wextra\" \"-Wno-unused-parameter\" \"-o\" \"/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out/out-c11/7dfda64fdf5a526c-c11.o\" \"-c\" \"/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/c11.c\"" }).
cargo:rerun-if-env-changed=CC
cargo:rerun-if-env-changed=CXX
OUT_DIR = Some(/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out)
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
TARGET = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
OUT_DIR = Some(/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out)
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
TARGET = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
cargo:warning=######
cargo:warning=###### WARNING: MISSING GIT SUBMODULE ######
cargo:warning=  -- Did you initialize the repo's git submodules? Unable to find source file: /Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c.
cargo:warning=  -- run 'git submodule update --init --recursive' to initialize.
cargo:warning=######
cargo:warning=######
OPT_LEVEL = Some(0)
TARGET = Some(aarch64-apple-darwin)
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
CC_aarch64-apple-darwin = None
cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
CC_aarch64_apple_darwin = 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(true)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
CARGO_ENCODED_RUSTFLAGS = Some()
cargo:warning=clang: error: no such file or directory: '/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c'
cargo:warning=clang: error: no input files
cargo:warning=Compilation of 'stdalign_check.c' failed - Err(Error { kind: ToolExecError, message: "command did not execute successfully (status code exit status: 1): env -u IPHONEOS_DEPLOYMENT_TARGET LC_ALL=\"C\" \"cc\" \"-O0\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-gdwarf-2\" \"-fno-omit-frame-pointer\" \"--target=arm64-apple-macosx\" \"-mmacosx-version-min=15.4\" \"-Werror\" \"-Wall\" \"-Wextra\" \"-Wno-unused-parameter\" \"-o\" \"/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out/out-stdalign_check/7dfda64fdf5a526c-stdalign_check.o\" \"-c\" \"/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c\"" }).
cargo:warning=######
cargo:warning=###### WARNING: MISSING GIT SUBMODULE ######
cargo:warning=  -- Did you initialize the repo's git submodules? Unable to find source file: /Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c.
cargo:warning=  -- run 'git submodule update --init --recursive' to initialize.
cargo:warning=######
cargo:warning=######
OPT_LEVEL = Some(0)
TARGET = Some(aarch64-apple-darwin)
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
CC_aarch64-apple-darwin = None
cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
CC_aarch64_apple_darwin = 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(true)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
CARGO_ENCODED_RUSTFLAGS = Some()
cargo:warning=clang: error: no such file or directory: '/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c'
cargo:warning=clang: error: no input files
cargo:warning=Compilation of 'builtin_swap_check.c' failed - Err(Error { kind: ToolExecError, message: "command did not execute successfully (status code exit status: 1): env -u IPHONEOS_DEPLOYMENT_TARGET LC_ALL=\"C\" \"cc\" \"-O0\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-gdwarf-2\" \"-fno-omit-frame-pointer\" \"--target=arm64-apple-macosx\" \"-mmacosx-version-min=15.4\" \"-Werror\" \"-Wall\" \"-Wextra\" \"-Wno-unused-parameter\" \"-o\" \"/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out/out-builtin_swap_check/7dfda64fdf5a526c-builtin_swap_check.o\" \"-c\" \"/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c\"" }).
OPT_LEVEL = Some(0)
OUT_DIR = Some(/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out)
TARGET = Some(aarch64-apple-darwin)
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
CC_aarch64-apple-darwin = None
cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
CC_aarch64_apple_darwin = 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(true)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
CARGO_ENCODED_RUSTFLAGS = Some()

--- stderr

thread 'main' panicked at aws-lc-sys/builder/cc_builder.rs:473:9:
COMPILER: ccARGS: ["-O0", "-ffunction-sections", "-fdata-sections", "-fPIC", "-gdwarf-2", "-fno-omit-frame-pointer", "--target=arm64-apple-macosx", "-mmacosx-version-min=15.4", "-Wall", "-Wextra", "/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/memcmp_invalid_stripped_check.c", "-Wno-unused-parameter", "-o", "/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-sys-3b7b7149b40ddf93/out/memcmp_invalid_stripped_check"]EXECUTED: trueERROR: clang: error: no such file or directory: '/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/memcmp_invalid_stripped_check.c'
clang: error: no input files
OUTPUT: Failed to compile memcmp_invalid_stripped_check

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
warning: [email protected]: Building with: CMake
warning: [email protected]: Symbol Prefix: Some("aws_lc_fips_0_13_5")
warning: [email protected]: Clang v17.0.0 detected.
error: failed to run custom build command for `aws-lc-fips-sys v0.13.5 (/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-fips-sys)`

Caused by:
process didn't exit successfully: `/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-fips-sys-e1f229f64218b926/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:rerun-if-env-changed=AWS_LC_FIPS_SYS_CPU_JITTER_ENTROPY
cargo:rustc-cfg=aarch64_apple_darwin
cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_STATIC
cargo:warning=Building with: CMake
cargo:warning=Symbol Prefix: Some("aws_lc_fips_0_13_5")
cargo:rerun-if-env-changed=CMAKE
cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_STATIC
OPT_LEVEL = Some(0)
OUT_DIR = Some(/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-fips-sys-dd96f9678deaba2d/out)
TARGET = Some(aarch64-apple-darwin)
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
CC_aarch64-apple-darwin = None
cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
CC_aarch64_apple_darwin = 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(true)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
CARGO_ENCODED_RUSTFLAGS = Some()
cargo:warning=Clang v17.0.0 detected.
cargo:rerun-if-env-changed=CMAKE_TOOLCHAIN_FILE
cargo:rerun-if-env-changed=CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin
OUT_DIR = Some(/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-fips-sys-dd96f9678deaba2d/out)
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
TARGET = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
OUT_DIR = Some(/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-fips-sys-dd96f9678deaba2d/out)
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
TARGET = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = None
HOST = Some(aarch64-apple-darwin)
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
CFLAGS_aarch64_apple_darwin = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
CFLAGS_aarch64-apple-darwin = None
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/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-fips-sys-dd96f9678deaba2d/out/build" && CMAKE_PREFIX_PATH="" LC_ALL="C" "cmake" "/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-fips-sys" "-DBUILD_SHARED_LIBS=1" "-DCMAKE_BUILD_TYPE=debug" "-DBORINGSSL_PREFIX=aws_lc_fips_0_13_5_" "-DBORINGSSL_PREFIX_HEADERS=/Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-fips-sys/generated-include" "-DBUILD_TESTING=OFF" "-DBUILD_LIBSSL=OFF" "-DFIPS=1" "-DCMAKE_OSX_ARCHITECTURES=arm64" "-DCMAKE_SYSTEM_PROCESSOR=arm64" "-DCMAKE_INSTALL_PREFIX=/Users/sunjay/Documents/projects/aws-lc-rs/target/debug/build/aws-lc-fips-sys-dd96f9678deaba2d/out" "-DCMAKE_C_FLAGS= -Wno-overriding-option -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx -mmacosx-version-min=15.4" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx -mmacosx-version-min=15.4" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx -mmacosx-version-min=15.4" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "--no-warn-unused-cli"
Not searching for unused variables given on the command line.
-- The C compiler identification is AppleClang 17.0.0.17000013
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring incomplete, errors occurred!

--- stderr
CMake Deprecation Warning at CMakeLists.txt:10 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Error at CMakeLists.txt:31 (add_subdirectory):
  The source directory

    /Users/sunjay/Documents/projects/aws-lc-rs/aws-lc-fips-sys/aws-lc

  does not contain a CMakeLists.txt file.


CMake Warning at CMakeLists.txt:33 (message):
  ###### WARNING: MISSING GIT SUBMODULE ###### Did you initialize the repo's
  git submodules? CMakeLists.txt not found.

   -- run 'git submodule update --init --recursive' to initialize.


CMake Error at CMakeLists.txt:17 (set_target_properties):
  set_target_properties Can not find target to add properties to: crypto
Call Stack (most recent call first):
  CMakeLists.txt:51 (set_my_target_properties)


CMake Error at CMakeLists.txt:17 (set_target_properties):
  set_target_properties Can not find target to add properties to: crypto
Call Stack (most recent call first):
  CMakeLists.txt:73 (set_my_target_properties)



thread 'main' panicked at /Users/sunjay/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cmake-0.1.54/src/lib.rs:1119:5:

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

build script failed, must exit now
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Relevant details

AWS-LC for Rust versions or commit: 8ed1be8

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

Darwin 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:24 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6030 arm64 arm

Build log: See collapsible section above

@OrionNebula
Copy link

I think this is caused by the following change from the CMake 4.0 changelog:

Builds targeting macOS no longer choose any SDK or pass an -isysroot flag to the compiler by default. Instead, compilers are expected to choose a default macOS SDK on their own. In order to use a compiler that does not do this, users must now specify -DCMAKE_OSX_SYSROOT=macosx when configuring their build.

Most likely aws-lc-rs/aws-lc-fips-sys/builder/cmake_builder.rs needs to set that configuration option when building on MacOS, similarly to how it already does for iphonesimulator.

@tsunrise
Copy link

tsunrise commented Apr 2, 2025

We could have a temporary workaround by manually specifying SDKROOT by running something like SDKROOT=$(xcrun --show-sdk-path) cargo build ... Hopefully cmake_builder.rs could make this step automatic!

EDIT: Indeed I think this workaround fixes a different issue on Mac with cmake 4.0.0. I got the following error when having aws-lc-rs-fips-sys in my dependency

 make[2]: *** [aws-lc/crypto/fipsmodule/fips_apple_end.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  /Users/redacted/.cargo/registry/src/index.crates.io-redacted/aws-lc-fips-sys-0.13.5/aws-lc/crypto/fipsmodule/fips_shared_library_marker.c:17:10: fatal error: 'stdio.h' file not found
     17 | #include <stdio.h>

and the workaround fixes that.

@justsmth
Copy link
Contributor

justsmth commented Apr 3, 2025

Hello! I have reproduced this issue on my Mac. It appears to only affect the build of aws-lc-fips-sys. (So far, I can't reproduce this failure for aws-lc-sys.)

I'll look into this and try to get patch out for it soon. Thanks for letting us know about this! ❤️

EDIT: You can set AWS_LC_SYS_CMAKE_BUILDER=1 in the environment to force the aws-lc-sys build to use CMake. For most consumers, CMake is not needed.

@justsmth justsmth changed the title Build fails with cmake 4.0.0 on MacOS FIPS build fails with cmake 4.0.0 on MacOS Apr 3, 2025
@justsmth
Copy link
Contributor

justsmth commented Apr 3, 2025

I updated the issue title to indicate that this problem affects the FIPS build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants