Problem:
Building aws-lc-rs with FIPS enabled on Windows ARM64 fails due to x64/ARM64
toolchain mismatch during native CMake build.
In our CI (windows-11-arm runner), we target aarch64-pc-windows-msvc and
call vcvarsall.bat arm64 before cargo build.
However, the aws-lc-fips-sys build path appears to override this by invoking
vcvarsall.bat x64 via its Windows helper script, which results in x64
libraries being selected in the FIPS CMake subprocess and causes linker failure:
library machine type 'x64' conflicts with target machine type 'ARM64'
Non-FIPS builds (via aws-lc-sys) work on the same runner/target; the failure
is specific to the FIPS path (aws-lc-fips-sys).
Relevant details
AWS-LC for Rust versions or commit:
aws-lc-rs = 1.16.1
aws-lc-fips-sys = 0.13.12
cmake = 0.1.54
System information:
- CPU architecture: ARM64 (
aarch64)
- CPU name: GitHub-hosted Windows ARM runner (
windows-11-arm)
- OS: Windows 11 ARM (GitHub Actions hosted image)
Verified reproduction
In snowflakedb/universal-driver PR #427
on windows-11-arm, building sf_core with --all-features (which enables
rustls/fips → aws-lc-fips-sys) targeting aarch64-pc-windows-msvc fails
with LNK1112 x64 vs ARM64 conflict.
Likely minimal reproducer (not yet validated end-to-end)
Cargo.toml:
[package]
name = "fips-arm64-repro"
edition = "2021"
[dependencies]
aws-lc-rs = { version = "1.16", features = ["fips"] }
src/main.rs:
fn main() {
aws_lc_rs::init();
println!("aws-lc-rs FIPS loaded");
}
Steps:
- Use a Windows ARM64 machine (observed on GitHub Actions
windows-11-arm;
may also reproduce with x64 host cross-compiling to ARM64 target).
- Set up ARM64 MSVC environment:
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" arm64
- Install target:
rustup target add aarch64-pc-windows-msvc
- Build:
cargo build --target aarch64-pc-windows-msvc
- Expected: linker error with x64 vs ARM64 machine type conflict.
Observed behavior in source/build path:
aws-lc-fips-sys/builder/printenv.bat (lines 30-37) calls vcvarsall.bat x64.
aws-lc-fips-sys/builder/cmake_builder.rs (lines 273-281) imports env from
that script for Windows builds via collect_vcvarsall_bat().
- This overrides the caller's ARM64 env (
vcvarsall arm64) for the FIPS CMake
build path.
- The non-FIPS path (
aws-lc-sys/builder/cmake_builder.rs lines 305-324) has
explicit ARM64 Windows handling and works correctly.
Expected behavior:
- When target is
aarch64-pc-windows-msvc, FIPS build should respect the
target architecture and produce ARM64-compatible artifacts, consistent with
how aws-lc-sys (non-FIPS) handles it.
Build log (from CI run above):
error: failed to run custom build command for `aws-lc-fips-sys v0.13.12`
...
link : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'ARM64'
Problem:
Building
aws-lc-rswith FIPS enabled on Windows ARM64 fails due to x64/ARM64toolchain mismatch during native CMake build.
In our CI (
windows-11-armrunner), we targetaarch64-pc-windows-msvcandcall
vcvarsall.bat arm64beforecargo build.However, the
aws-lc-fips-sysbuild path appears to override this by invokingvcvarsall.bat x64via its Windows helper script, which results in x64libraries being selected in the FIPS CMake subprocess and causes linker failure:
library machine type 'x64' conflicts with target machine type 'ARM64'Non-FIPS builds (via
aws-lc-sys) work on the same runner/target; the failureis specific to the FIPS path (
aws-lc-fips-sys).Relevant details
AWS-LC for Rust versions or commit:
aws-lc-rs = 1.16.1aws-lc-fips-sys = 0.13.12cmake = 0.1.54System information:
aarch64)windows-11-arm)Verified reproduction
In snowflakedb/universal-driver PR #427
on
windows-11-arm, buildingsf_corewith--all-features(which enablesrustls/fips→aws-lc-fips-sys) targetingaarch64-pc-windows-msvcfailswith
LNK1112 x64 vs ARM64conflict.Likely minimal reproducer (not yet validated end-to-end)
Cargo.toml:src/main.rs:Steps:
windows-11-arm;may also reproduce with x64 host cross-compiling to ARM64 target).
rustup target add aarch64-pc-windows-msvcObserved behavior in source/build path:
aws-lc-fips-sys/builder/printenv.bat(lines 30-37) callsvcvarsall.bat x64.aws-lc-fips-sys/builder/cmake_builder.rs(lines 273-281) imports env fromthat script for Windows builds via
collect_vcvarsall_bat().vcvarsall arm64) for the FIPS CMakebuild path.
aws-lc-sys/builder/cmake_builder.rslines 305-324) hasexplicit ARM64 Windows handling and works correctly.
Expected behavior:
aarch64-pc-windows-msvc, FIPS build should respect thetarget architecture and produce ARM64-compatible artifacts, consistent with
how
aws-lc-sys(non-FIPS) handles it.Build log (from CI run above):