Skip to content

Remove NASM requirement for windows builds #1477

Closed
aws/s2n-quic
#2037
@camshaft

Description

@camshaft

Problem:

When attempting to switch s2n-quic to use aws-lc-rs on all platforms, I ran into an issue for windows where NASM is required to be installed in the environment (see ci build).

While I see the aws-lc-rs CI has worked around this issue by installing NASM, this is an additional dependency that ring doesn't require, and could be considered an additional hurdle to aws-lc-rs being a drop-in ring replacement. Looking at the ring build script, it looks like they've pre-generated files to avoid the NASM dependency. I think it would be best to do the same in aws-lc-rs.

Build output

  cargo:rustc-cfg=use_bindgen_generated
  CMAKE_TOOLCHAIN_FILE_x86_64-pc-windows-msvc = None
  CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-pc-windows-msvc = None
  CMAKE_GENERATOR_x86_64_pc_windows_msvc = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-pc-windows-msvc = None
  CMAKE_PREFIX_PATH_x86_64_pc_windows_msvc = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-pc-windows-msvc = None
  CMAKE_x86_64_pc_windows_msvc = None
  HOST_CMAKE = None
  CMAKE = Some("cmake")
  running: "cmake" "C:\\Users\\runneradmin\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.12.0" "-G" "Visual Studio 17 2022" "-Thost=x64" "-Ax64" "-DBUILD_SHARED_LIBS=0" "-DBORINGSSL_PREFIX=aws_lc_0_12_0_" "-DBORINGSSL_PREFIX_HEADERS=C:\\Users\\runneradmin\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.12.0\\generated-include" "-DBUILD_TESTING=OFF" "-DBUILD_LIBSSL=OFF" "-DDISABLE_PERL=ON" "-DDISABLE_GO=ON" "-DCMAKE_INSTALL_PREFIX=D:\\a\\s2n-quic\\s2n-quic\\target\\debug\\build\\aws-lc-sys-47a8a1f3d5620838\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Debug" "--no-warn-unused-cli"
  Not searching for unused variables given on the command line.
  -- The C compiler identification is MSVC 19.37.32825.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Go not found. Disabling some code generation and using pre-generated code in generated-src/
  -- Perl not found. Disabling some code generation and using pre-generated code in generated-src/
  -- The ASM_NASM compiler identification is unknown
  -- Didn't find assembler
  -- Configuring incomplete, errors occurred!

  --- stderr
  CMake Deprecation Warning at CMakeLists.txt:6 (cmake_minimum_required):
    Compatibility with CMake < 3.5 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.5 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 Error at aws-lc/crypto/CMakeLists.txt:72 (enable_language):
    No CMAKE_ASM_NASM_COMPILER could be found.



  thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.50\src\lib.rs:1098:5:

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

  build script failed, must exit now
  stack backtrace:
     0: std::panicking::begin_panic_handler
               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\std\src\panicking.rs:597
     1: core::panicking::panic_fmt
               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\core\src\panicking.rs:72
     2: cmake::find_exe::{{closure}}
     3: <cmake::Version as core::default::Default>::default
     4: cmake::Config::build
     5: build_script_main::prepare_cmake_build::{{closure}}
     6: build_script_main::prepare_cmake_build::{{closure}}
     7: core::ops::function::FnOnce::call_once
     8: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
     9: std::rt::lang_start
    10: std::rt::lang_start_internal::closure$2
               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\std\src\rt.rs:148
    11: std::panicking::try::do_call
               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\std\src\panicking.rs:504
    12: std::panicking::try
               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\std\src\panicking.rs:468
    13: std::panic::catch_unwind
               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\std\src\panic.rs:142
    14: std::rt::lang_start_internal
               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\std\src\rt.rs:148
    15: std::rt::lang_start
    16: main
    17: invoke_main
               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
    18: __scrt_common_main_seh
               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    19: BaseThreadInitThunk
    20: RtlUserThreadStart
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions