briansmith / ring

Safe, fast, small crypto using Rust
Other
3.68k stars 693 forks source link

error: failed to run custom build command for `ring v0.16.20` #1939

Closed 0Akise closed 6 months ago

0Akise commented 6 months ago

Hi. I'm from dioxus-cli, and from building ring v0.16.20 I encountered following error:

warning: GNU compiler is not supported for this target

error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `C:\Users\Akise\AppData\Local\Temp\cargo-installsCgV66\release\build\ring-fc9d0853843aa6ec\build-script-build` (exit code: 101)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-pc-windows-msvc")
  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 = Some("gcc")
  cargo:warning=GNU compiler is not supported for this target
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  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

  --- stderr
  running "gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "include" "-Wall" "-Wextra" "/GS" "/Gy" "/EHsc" "/GR-" "/Zc:wchar_t" "/Zc:forScope" "/Zc:inline" "/Zc:rvalueCast" "/sdl" "/Wall" "/wd4127" "/wd4464" "/wd4514" "/wd4710" "/wd4711" "/wd4820" "/wd5045" "/Ox" "-DNDEBUG" "-c" "/FoC:\\Users\\Akise\\AppData\\Local\\Temp\\cargo-installsCgV66\\release\\build\\ring-17260e6ef551500b\\out\\aes_nohw.obj" "crypto/fipsmodule/aes/aes_nohw.c"
  gcc: error: -E or -x required when input is from standard input
  thread 'main' panicked at 'execution failed', C:\Users\Akise\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ring-0.16.20\build.rs:656:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What I have tried

sorry, I'm not sure how to approach this error. any insight/advice would be appreciated.

JohnScience commented 6 months ago

Similar problem in a publishing GitHub action: https://github.com/JohnScience/chromium-chromedriver/actions/runs/7851428056/job/21428489721#step:4:2002

The action succeeds on amd64 but fails on arm64 (aka aarch64).

briansmith commented 6 months ago
warning: GNU compiler is not supported for this target

You cannot use GCC when building for -msvc, according to that warning. But, the environment variables are set to use GCC. So it is expected to fail.