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

Error cross-compiling Linux->Windows with "fips" feature #534

Open
eliad-wiz opened this issue Sep 24, 2024 · 3 comments
Open

Error cross-compiling Linux->Windows with "fips" feature #534

eliad-wiz opened this issue Sep 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@eliad-wiz
Copy link

Problem:

Cross compiling from linux to x86_64-pc-windows-gnu target fails when "fips" feature is enabled.

   Compiling aws-lc-fips-sys v0.12.11
The following warnings were emitted during compilation:

warning: [email protected]: Generating bindings - external bindgen. Platform: x86_64-pc-windows-gnu

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

Caused by:
  process didn't exit successfully: `/tmp/rust/wintest/target/debug/build/aws-lc-fips-sys-b42c249ef2f3928a/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_INTERNAL_BINDGEN
  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_STATIC
  cargo:warning=Generating bindings - external bindgen. Platform: x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_INCLUDES
  cargo:rustc-cfg=use_bindgen_generated
  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_x86_64_pc_windows_gnu

  --- stderr

  thread 'main' panicked at /home/eliad/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-fips-sys-0.12.11/builder/cmake_builder.rs:171:30:
  Failed to run vcvarsall.bat.
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

looks like it tries executing vcvarsall.bat locally

To reproduce, use the following Cargo.toml

[package]
name = "wintest"
version = "0.1.0"
edition = "2021"

[dependencies]
aws-lc-rs = { version = "1.9.0", features = ["fips"] }

and run cargo build --target x86_64-pc-windows-gnu

Relevant details

AWS-LC for Rust versions or commit: 1.9.0

System information:

  • CPU architecture: x86-64
  • OS: Ubuntu 22.04
@justsmth
Copy link
Contributor

Hello!

I see in the output this message:

Failed to run vcvarsall.bat

Do you have Visual Studio (Community Edition) installed on the build host? Do you know the location of the vcvarsall.bat script on that host?

@eliad-wiz
Copy link
Author

i'm cross compiling on a linux host.
no visual studio (i don't even see such option), not batch files.

i guess this script is intended for local windows compilation, not for cross-compilation.

@justsmth
Copy link
Contributor

Ahhh, of course.

Cross compilation is not a something that we test for FIPS builds. But it might be possible with a little effort.

We utilize that batch script to setup the build environment properly for Ninja. I'm not sure what alternative we would have when cross compiling from Linux.

We will look into this.

@justsmth justsmth added the enhancement New feature or request label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants