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
318 stars 49 forks source link

Build Script Warning: clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument] #556

Closed erenon closed 1 month ago

erenon commented 1 month ago

Problem:

When building with bazel (using rules_rust bzlmod crate_universe), the following warning is printed many times:

Build Script Warning: clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]

I suspect it is coming from here: https://github.com/aws/aws-lc-rs/blob/671415fa90145746e4424275806ae0946504d044/aws-lc-sys/builder/cc_builder.rs#L108

Is there a reason pthread is added there like this (and not -pthread ). To silence the warning, -Wno-unused-command-line-argument should be specified.

I can send a PR if any solution is deemed ok. thanks!

Relevant details

AWS-LC for Rust version: 0.21.2. Linux, x86_64.

justsmth commented 1 month ago

Thanks for the report! I put up a PR to address this.

I'm curious which platform are you compiling for? I'll look more closely at the compiler output to see what other messages need to be dealt with.

erenon commented 1 month ago

Platform: Ubuntu 22.04, x86_64, clang 14. Anything specific you are interested in?

justsmth commented 1 month ago

Ok, I wasn't finding the warning messages you reported at first b/c I was using gcc. When I switched the compiler to clang, I saw them.

I confirmed that on the PR branch that those messages are now gone. The remaining compiler warning messages are intentional for debug/diagnostic purposes:

 ❯ cargo build -p aws-lc-sys
   Compiling libc v0.2.156
   Compiling once_cell v1.19.0
   Compiling fs_extra v1.3.0
   Compiling dunce v1.0.5
   Compiling paste v1.0.15
   Compiling jobserver v0.1.32
   Compiling cc v1.0.105
   Compiling cmake v0.1.51
   Compiling aws-lc-sys v0.22.0 (/home/justsmth/repos/aws-lc-rs/aws-lc-sys)
warning: aws-lc-sys@0.22.0: Building with: CC
warning: aws-lc-sys@0.22.0: Symbol Prefix: Some("aws_lc_0_22_0")
warning: aws-lc-sys@0.22.0: Compilation of 'c11.c' succeeded - Ok(["/home/justsmth/repos/aws-lc-rs/target/debug/build/aws-lc-sys-901ad5fa76471ad9/out/out-c11/65c584faa52a237e-c11.o"]).
warning: aws-lc-sys@0.22.0: CC environment variable set: clang
warning: aws-lc-sys@0.22.0: CXX environment variable set: clang++
warning: aws-lc-sys@0.22.0: Compilation of 'stdalign_check.c' succeeded - Ok(["/home/justsmth/repos/aws-lc-rs/target/debug/build/aws-lc-sys-901ad5fa76471ad9/out/out-stdalign_check/65c584faa52a237e-stdalign_check.o"]).
warning: aws-lc-sys@0.22.0: Compilation of 'builtin_swap_check.c' succeeded - Ok(["/home/justsmth/repos/aws-lc-rs/target/debug/build/aws-lc-sys-901ad5fa76471ad9/out/out-builtin_swap_check/65c584faa52a237e-builtin_swap_check.o"]).
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 11.47s
leontoeides commented 1 month ago

I'm facing a similar issue building on Windows & Visual studio.

I updated both VS Code and CMake to the latest versions.

warning: aws-lc-sys@0.22.0: Building with: CMake
warning: aws-lc-sys@0.22.0: Symbol Prefix: Some("aws_lc_0_22_0")
warning: aws-lc-sys@0.22.0: CMAKE environment variable set: cmake
warning: aws-lc-sys@0.22.0: cl : Command line error D8021 : invalid numeric argument '/Wno-unused-parameter'

Unfortunately the workaround for me was to switch from rustls to native-tls in my project's dependencies using crate features

justsmth commented 1 month ago

Hello @leontoeides -- I've seen the warning about '/Wno-unused-parameter' occur on Windows, but I wouldn't expect it to cause the build to fail. (You can see the same warning in our CI builds for Windows, but the build and subsequent tests succeed.) I'm curious whether there might be more information you can provide about your build failure?

We hope to have a patch out to soon to correct these issues. Thanks for contacting us!

leontoeides commented 1 month ago

Apologies - I inadvertently fixed the issue when I realigned some features across a few crates I use. I'm not able to duplicate the build error anymore. If it happens again I will post the full log. Thanks for the response

leontoeides commented 1 month ago

I managed ran into this error again on a completely separate project. Here is the output:

``` The following warnings were emitted during compilation: warning: aws-lc-sys@0.22.0: Building with: CMake warning: aws-lc-sys@0.22.0: Symbol Prefix: Some("aws_lc_0_22_0") warning: aws-lc-sys@0.22.0: CMAKE environment variable set: cmake warning: aws-lc-sys@0.22.0: cl : Command line error D8021 : invalid numeric argument '/Wno-unused-parameter' warning: aws-lc-sys@0.22.0: Compilation of 'c11.c' failed - Err(Error { kind: ToolExecError, message: "Command \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Community\\\\VC\\\\Tools\\\\MSVC\\\\14.41.34120\\\\bin\\\\HostX64\\\\x64\\\\cl.exe\" \"-nologo\" \"-MD\" \"-Z7\" \"-Brepro\" \"-I\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\generated-include\" \"-I\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\include\" \"-I\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\aws-lc\\\\include\" \"-I\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\aws-lc\\\\third_party\\\\s2n-bignum\\\\include\" \"-W4\" \"-Wno-unused-parameter\" \"-DBORINGSSL_IMPLEMENTATION=1\" \"-DBORINGSSL_PREFIX=aws_lc_0_22_0\" \"-WX\" \"-FoD:\\\\Rust\\\\redacted\\\\target\\\\debug\\\\build\\\\aws-lc-sys-7dad5723691bd22f\\\\out\\\\out-c11\\\\fb440b8e56278e74-c11.o\" \"-c\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\aws-lc\\\\tests\\\\compiler_features_tests\\\\c11.c\" with args cl.exe did not execute successfully (status code exit code: 2)." }). warning: aws-lc-sys@0.22.0: Setting CFLAGS: "-nologo -MD -Z7 -Brepro -std:c99 -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\generated-include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\third_party\\s2n-bignum\\include -W4 -DBORINGSSL_IMPLEMENTATION=1 -DBORINGSSL_PREFIX=aws_lc_0_22_0" error: failed to run custom build command for `aws-lc-sys v0.22.0` 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: `D:\Rust\redacted\target\debug\build\aws-lc-sys-aa13f1ca5ef2e838\build-script-main` (exit code: 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:rustc-cfg=x86_64_pc_windows_msvc cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC default_for Target: 'x86_64-pc-windows-msvc' cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC cargo:rerun-if-env-changed=CMAKE cargo:warning=Building with: CMake cargo:warning=Symbol Prefix: Some("aws_lc_0_22_0") cargo:rerun-if-env-changed=CMAKE cargo:warning=CMAKE environment variable set: cmake cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC OPT_LEVEL = Some(0) TARGET = Some(x86_64-pc-windows-msvc) cargo:rerun-if-env-changed=VCINSTALLDIR VCINSTALLDIR = None cargo:rerun-if-env-changed=VSTEL_MSBuildProjectFullPath VSTEL_MSBuildProjectFullPath = None cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE VSCMD_ARG_VCVARS_SPECTRE = None cargo:rerun-if-env-changed=WindowsSdkDir WindowsSdkDir = None cargo:rerun-if-env-changed=WindowsSDKVersion WindowsSDKVersion = None cargo:rerun-if-env-changed=LIB LIB = None PATH = Some(D:\Rust\redacted\target\debug\deps;D:\Rust\redacted\target\debug;C:\Users\User Name\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Program Files\PowerShell\7;C:\Program Files\Eclipse Adoptium\jdk-21.0.4.7-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\CMake\bin;D:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Users\User Name\.cargo\bin;C:\Users\User Name\AppData\Local\Microsoft\WindowsApps;C:\Users\User Name\AppData\Local\bin\NASM;D:\Program Files\protoc-win64\bin;C:\Program Files\JetBrains\RustRover 2024.1.6\bin;;) cargo:rerun-if-env-changed=INCLUDE INCLUDE = None HOST = Some(x86_64-pc-windows-msvc) cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc CC_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc CC_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some(cmpxchg16b,fxsr,lahfsahf,sse,sse2,sse3) DEBUG = Some(true) cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc CFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc CFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None OPT_LEVEL = Some(0) TARGET = Some(x86_64-pc-windows-msvc) cargo:rerun-if-env-changed=VCINSTALLDIR VCINSTALLDIR = None cargo:rerun-if-env-changed=VSTEL_MSBuildProjectFullPath VSTEL_MSBuildProjectFullPath = None cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE VSCMD_ARG_VCVARS_SPECTRE = None cargo:rerun-if-env-changed=WindowsSdkDir WindowsSdkDir = None cargo:rerun-if-env-changed=WindowsSDKVersion WindowsSDKVersion = None cargo:rerun-if-env-changed=LIB LIB = None PATH = Some(D:\Rust\redacted\target\debug\deps;D:\Rust\redacted\target\debug;C:\Users\User Name\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Program Files\PowerShell\7;C:\Program Files\Eclipse Adoptium\jdk-21.0.4.7-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\CMake\bin;D:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Users\User Name\.cargo\bin;C:\Users\User Name\AppData\Local\Microsoft\WindowsApps;C:\Users\User Name\AppData\Local\bin\NASM;D:\Program Files\protoc-win64\bin;C:\Program Files\JetBrains\RustRover 2024.1.6\bin;;) cargo:rerun-if-env-changed=INCLUDE INCLUDE = None HOST = Some(x86_64-pc-windows-msvc) cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc CC_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc CC_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some(cmpxchg16b,fxsr,lahfsahf,sse,sse2,sse3) DEBUG = Some(true) cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc CFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc CFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT cargo:warning=cl : Command line error D8021 : invalid numeric argument '/Wno-unused-parameter' cargo:warning=Compilation of 'c11.c' failed - Err(Error { kind: ToolExecError, message: "Command \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Community\\\\VC\\\\Tools\\\\MSVC\\\\14.41.34120\\\\bin\\\\HostX64\\\\x64\\\\cl.exe\" \"-nologo\" \"-MD\" \"-Z7\" \"-Brepro\" \"-I\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\generated-include\" \"-I\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\include\" \"-I\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\aws-lc\\\\include\" \"-I\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\aws-lc\\\\third_party\\\\s2n-bignum\\\\include\" \"-W4\" \"-Wno-unused-parameter\" \"-DBORINGSSL_IMPLEMENTATION=1\" \"-DBORINGSSL_PREFIX=aws_lc_0_22_0\" \"-WX\" \"-FoD:\\\\Rust\\\\redacted\\\\target\\\\debug\\\\build\\\\aws-lc-sys-7dad5723691bd22f\\\\out\\\\out-c11\\\\fb440b8e56278e74-c11.o\" \"-c\" \"C:\\\\Users\\\\User Name\\\\.cargo\\\\registry\\\\src\\\\index.crates.io-6f17d22bba15001f\\\\aws-lc-sys-0.22.0\\\\aws-lc\\\\tests\\\\compiler_features_tests\\\\c11.c\" with args cl.exe did not execute successfully (status code exit code: 2)." }). cargo:rerun-if-env-changed=CC cargo:rerun-if-env-changed=CXX cargo:warning=Setting CFLAGS: "-nologo -MD -Z7 -Brepro -std:c99 -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\generated-include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\third_party\\s2n-bignum\\include -W4 -DBORINGSSL_IMPLEMENTATION=1 -DBORINGSSL_PREFIX=aws_lc_0_22_0" cargo:rerun-if-env-changed=CMAKE_TOOLCHAIN_FILE cargo:rerun-if-env-changed=CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc 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\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0" "-G" "Visual Studio 17 2022" "-Thost=x64" "-Ax64" "-DBUILD_SHARED_LIBS=0" "-DCMAKE_BUILD_TYPE=debug" "-DBORINGSSL_PREFIX=aws_lc_0_22_0_" "-DBORINGSSL_PREFIX_HEADERS=C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\generated-include" "-DBUILD_TESTING=OFF" "-DBUILD_LIBSSL=OFF" "-DDISABLE_PERL=ON" "-DDISABLE_GO=ON" "-DCMAKE_INSTALL_PREFIX=D:\\Rust\\redacted\\target\\debug\\build\\aws-lc-sys-7dad5723691bd22f\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro -nologo -MD -Z7 -Brepro -std:c99 -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\generated-include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\third_party\\s2n-bignum\\include -W4 -DBORINGSSL_IMPLEMENTATION=1 -DBORINGSSL_PREFIX=aws_lc_0_22_0" "-DCMAKE_C_FLAGS_DEBUG= -nologo -MD -Brepro -nologo -MD -Z7 -Brepro -std:c99 -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\generated-include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\third_party\\s2n-bignum\\include -W4 -DBORINGSSL_IMPLEMENTATION=1 -DBORINGSSL_PREFIX=aws_lc_0_22_0" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro -nologo -MD -Z7 -Brepro -std:c99 -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\generated-include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\third_party\\s2n-bignum\\include -W4 -DBORINGSSL_IMPLEMENTATION=1 -DBORINGSSL_PREFIX=aws_lc_0_22_0" "-DCMAKE_ASM_FLAGS_DEBUG= -nologo -MD -Brepro -nologo -MD -Z7 -Brepro -std:c99 -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\generated-include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\include -I C:\\Users\\User Name\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\aws-lc-sys-0.22.0\\aws-lc\\third_party\\s2n-bignum\\include -W4 -DBORINGSSL_IMPLEMENTATION=1 -DBORINGSSL_PREFIX=aws_lc_0_22_0" "--no-warn-unused-cli" Not searching for unused variables given on the command line. -- The C compiler identification is MSVC 19.41.34123.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - broken -- Configuring incomplete, errors occurred! --- stderr CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 3.5 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 Error at C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: 'D:/Rust/redacted/target/debug/build/aws-lc-sys-7dad5723691bd22f/out/build/CMakeFiles/CMakeScratch/TryCompile-botd3j' Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" cmTC_640e0.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n MSBuild version 17.11.9+a69bbaaf5 for .NET Framework Build started 2024-10-19 6:23:28 PM. Project "D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj" on node 1 (default targets). PrepareForBuild: Creating directory "cmTC_640e0.dir\Debug\". Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details. Creating directory "D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\Debug\". Creating directory "cmTC_640e0.dir\Debug\cmTC_640e0.tlog\". InitializeBuildStatus: Creating "cmTC_640e0.dir\Debug\cmTC_640e0.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. Touching "cmTC_640e0.dir\Debug\cmTC_640e0.tlog\unsuccessfulbuild". ClCompile: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\CL.exe /c /IC:\Users\Dylan /IC:\Users\Dylan /IC:\Users\Dylan /IC:\Users\Dylan /Zi /nologo /W4 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D BORINGSSL_IMPLEMENTATION=1 /D BORINGSSL_PREFIX=aws_lc_0_22_0 /D "CMAKE_INTDIR=\"Debug\"" /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_640e0.dir\Debug\\" /Fd"cmTC_640e0.dir\Debug\vc143.pdb" /external:W4 /Gd /TC /errorReport:queue -Brepro -Brepro -std:c99 Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\generated-include Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\include Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\aws-lc\include Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\aws-lc\third_party\s2n-bignum\include "D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\testCCompiler.c" /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/generated-include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\generated-include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] (compiling source file '/Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/generated-include') /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] (compiling source file '/Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/include') /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\aws-lc\include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] (compiling source file '/Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/include') /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/third_party/s2n-bignum/include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\aws-lc\third_party\s2n-bignum\include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] (compiling source file '/Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/third_party/s2n-bignum/include') cl : command line warning D9002: ignoring unknown option '-std:c99' [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] generated-include include include include testCCompiler.c Generating Code... Done Building Project "D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj" (default targets) -- FAILED. Build FAILED. "D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj" (default target) (1) -> (ClCompile target) -> cl : command line warning D9002: ignoring unknown option '-std:c99' [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] "D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj" (default target) (1) -> (ClCompile target) -> /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/generated-include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\generated-include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\aws-lc\include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/third_party/s2n-bignum/include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\aws-lc\third_party\s2n-bignum\include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj] 1 Warning(s) 4 Error(s) Time Elapsed 00:00:00.87 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:7 (enable_language) thread 'main' panicked at C:\Users\User Name\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.51\src/lib.rs:1100: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/e92993dbb43f0a5d17fe56e2d82f90435d6521c8\library/std\src\panicking.rs:665 1: core::panicking::panic_fmt at /rustc/e92993dbb43f0a5d17fe56e2d82f90435d6521c8\library/core\src\panicking.rs:74 2: cmake::find_exe::{{closure}} 3: ::default 4: cmake::Config::build 5: build_script_main::cmake_builder::CmakeBuilder::new 6: ::build 7: build_script_main::is_crt_static 8: core::ops::function::FnOnce::call_once note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ```
justsmth commented 1 month ago

The output indicates that there are 1 Warning and 4 Errors:

          1 Warning(s)
          4 Error(s)

From what I've seen the warning would not cause an MSVC build to fail, but the errors would.

The 4 Errors appear to all be of the same type error C1083: Cannot open source file, referring to a file (e.g.) Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\generated-include, with a subsequent message of No such file or directory. The first such error is this:

      /Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/generated-include(1,1): error C1083: Cannot open source file: 'Bowker\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aws-lc-sys-0.22.0\generated-include': No such file or directory [D:\Rust\redacted\target\debug\build\aws-lc-sys-7dad5723691bd22f\out\build\CMakeFiles\CMakeScratch\TryCompile-botd3j\cmTC_640e0.vcxproj]
        (compiling source file '/Bowker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/generated-include')

Since the file it's looking for is under Bowker\.cargo\registry, this seems like it might be an issue related to the local registry index getting corrupted somehow? Does the problem go away after a cargo update or a cargo clean?

leontoeides commented 1 month ago

Hello Justin, I tried cargo clean and and I tried compiling on a different disk. No dice in either case. I moved the crate onto my work computer and compiled on there. It successfully compiled on my work laptop but I feel like I might be hearing from cybersecurity soon lol. It seems to be an issue with my personal computer. I will try reinstalling VS and CMake and see what happens. Thank you for helping look into this