sehnryr/wfcache-api

Windows compile fails

Puxtril opened this issue · 2 comments

Windows 10 (22H2)
Visual Studio 2022 (MSVC)

Below is the error log:

The following warnings were emitted during compilation:

warning: cl : Command line error D8021 : invalid numeric argument '/Wno-unused-variable'

error: failed to run custom build command for `oozle v0.1.2`

Caused by:
  process didn't exit successfully: `D:\Puxtril\Downloads\wfcache-api\target\release\build\oozle-915d229dccf5720d\build-script-build` (exit code: 1)
  --- stdout
  cargo:CXXBRIDGE_PREFIX=oozle
  cargo:CXXBRIDGE_DIR0=D:\Puxtril\Downloads\wfcache-api\target\release\build\oozle-014570076d07ecba\out\cxxbridge\include
  cargo:CXXBRIDGE_DIR1=D:\Puxtril\Downloads\wfcache-api\target\release\build\oozle-014570076d07ecba\out\cxxbridge\crate
  TARGET = Some("x86_64-pc-windows-msvc")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-msvc
  CXX_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_msvc
  CXX_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc
  CXXFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc
  CXXFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  DEBUG = Some("false")
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-I" "D:\\Puxtril\\Downloads\\wfcache-api\\target\\release\\build\\oozle-014570076d07ecba\\out\\cxxbridge\\include" "-I" "D:\\Puxtril\\Downloads\\wfcache-api\\target\\release\\build\\oozle-014570076d07ecba\\out\\cxxbridge\\crate" "-W4" "-Wno-unused-variable" "-Wno-unused-parameter" "-FoD:\\Puxtril\\Downloads\\wfcache-api\\target\\release\\build\\oozle-014570076d07ecba\\out\\753954aebaed1264-lib.rs.o" "-c" "D:\\Puxtril\\Downloads\\wfcache-api\\target\\release\\build\\oozle-014570076d07ecba\\out\\cxxbridge\\sources\\oozle\\src\\lib.rs.cc"
  cargo:warning=cl : Command line error D8021 : invalid numeric argument '/Wno-unused-variable'
  exit code: 2

  --- stderr

  CXX include path:
    D:\Puxtril\Downloads\wfcache-api\target\release\build\oozle-014570076d07ecba\out\cxxbridge\include
    D:\Puxtril\Downloads\wfcache-api\target\release\build\oozle-014570076d07ecba\out\cxxbridge\crate


  error occurred: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-I" "D:\\Puxtril\\Downloads\\wfcache-api\\target\\release\\build\\oozle-014570076d07ecba\\out\\cxxbridge\\include" "-I" "D:\\Puxtril\\Downloads\\wfcache-api\\target\\release\\build\\oozle-014570076d07ecba\\out\\cxxbridge\\crate" "-W4" "-Wno-unused-variable" "-Wno-unused-parameter" "-FoD:\\Puxtril\\Downloads\\wfcache-api\\target\\release\\build\\oozle-014570076d07ecba\\out\\753954aebaed1264-lib.rs.o" "-c" "D:\\Puxtril\\Downloads\\wfcache-api\\target\\release\\build\\oozle-014570076d07ecba\\out\\cxxbridge\\sources\\oozle\\src\\lib.rs.cc" with args "cl.exe" did not execute successfully (status code exit code: 2).


warning: build failed, waiting for other jobs to finish...
error: failed to compile `wfcache-api v0.9.0 (D:\Puxtril\Downloads\wfcache-api)`, intermediate artifacts can be found at `D:\Puxtril\Downloads\wfcache-api\target`

This issue concerns the oozle dependency which uses a build.rs to compile the c++ code with cxx.
https://github.com/sehnryr/oozle/blob/948ac42440f68813f27dfa9ef147f86128301aea/build.rs#L12
I'll close this issue and fix this issue (by removing the flags -Wno-unused-variable and -Wno-unused-parameter) later this day.

You are welcome to open a PR on https://github.com/sehnryr/oozle

I've removed the flags that should have caused the issue on 4dc2b9a.

You'll just need to do a cargo update to update the dependencies if you were building this binary from source or just retry to install this package otherwise. The new version of oozle should have propagate through crates.io.