Building on Windows #11

Open
opened 2024-05-20 05:16:13 +00:00 by tejedu · 5 comments
tejedu commented 2024-05-20 05:16:13 +00:00 (Migrated from gitlab.com)

Hello. When I build (on Windows) the following error is given:

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

Caused by:
  process didn't exit successfully: `D:\source\h\target\front\debug\build\ring-992c24c593aaa4a9\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
  cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_
  OPT_LEVEL = Some("0")
  TARGET = Some("wasm32-unknown-unknown")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None

  --- stderr


  error occurred: Failed to find tool. Is `clang` installed? (see https://github.com/rust-lang/cc-rs#compile-time-requirements for help)

I can get the ssr and hydrate builds to both work, outside of cargo leptos watch by setting, only for the hydrate build, CC=zig cc and AR=zig ar. If these variables are set for the ssr build it fails with the error:

error occurred: Command "zig" "ar" "-out:D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\libring_core_0_17_8_.a" "-nologo" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\fad98b632b8ce3cc-curve25519.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\ca4b6ef5433f5aeb-aes_nohw.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\ca8bd8684bb569fa-montgomery.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\ca8bd8684bb569fa-montgomery_inv.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-ecp_nistz.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-gfp_p256.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-gfp_p384.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-p256.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a1949f2101df4b9c-limbs.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\7effb53edfc7fa2d-mem.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\bec76f70393ddef1-poly1305.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\7effb53edfc7fa2d-crypto.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\7effb53edfc7fa2d-cpu_intel.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\fad98b632b8ce3cc-curve25519_64_adx.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\bec76f70393ddef1-poly1305_vec.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-p256-nistz.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\chacha-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\aesni-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\vpaes-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\x86_64-mont-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\x86_64-mont5-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\p256-x86_64-asm-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\aesni-gcm-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\ghash-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\sha512-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\chacha20_poly1305_x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\sha256-x86_64-nasm.o" with args "" did not execute successfully (status code exit code: 1).

This makes me think I need to set the two variables conditionally, based on compilation to wasm32-unknown-unknown or on the feature hydrate. I don't know how to configure this within the cargo leptos system.

I've looked at https://doc.rust-lang.org/nightly/cargo/reference/config.html#env but I don't think it supports this conditional. I also considered the [[*.metadata.leptos]] parameter lib-cargo-args = [] but I don't know how to pass an environment variable here.

I'm probably just missing the point. Any guidance would be appreciated. :)

Hello. When I build (on Windows) the following error is given: ``` error: failed to run custom build command for `ring v0.17.8` Caused by: process didn't exit successfully: `D:\source\h\target\front\debug\build\ring-992c24c593aaa4a9\build-script-build` (exit code: 1) --- stdout cargo:rerun-if-env-changed=RING_PREGENERATE_ASM cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_ OPT_LEVEL = Some("0") TARGET = Some("wasm32-unknown-unknown") HOST = Some("x86_64-pc-windows-msvc") cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown CC_wasm32-unknown-unknown = None cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown CC_wasm32_unknown_unknown = None cargo:rerun-if-env-changed=TARGET_CC TARGET_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None DEBUG = Some("true") cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown CFLAGS_wasm32-unknown-unknown = None cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown CFLAGS_wasm32_unknown_unknown = None cargo:rerun-if-env-changed=TARGET_CFLAGS TARGET_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None --- stderr error occurred: Failed to find tool. Is `clang` installed? (see https://github.com/rust-lang/cc-rs#compile-time-requirements for help) ``` I can get the ssr and hydrate builds to both work, outside of `cargo leptos watch` by setting, only for the hydrate build, `CC=zig cc` and `AR=zig ar`. If these variables are set for the ssr build it fails with the error: ``` error occurred: Command "zig" "ar" "-out:D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\libring_core_0_17_8_.a" "-nologo" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\fad98b632b8ce3cc-curve25519.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\ca4b6ef5433f5aeb-aes_nohw.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\ca8bd8684bb569fa-montgomery.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\ca8bd8684bb569fa-montgomery_inv.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-ecp_nistz.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-gfp_p256.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-gfp_p384.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-p256.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a1949f2101df4b9c-limbs.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\7effb53edfc7fa2d-mem.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\bec76f70393ddef1-poly1305.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\7effb53edfc7fa2d-crypto.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\7effb53edfc7fa2d-cpu_intel.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\fad98b632b8ce3cc-curve25519_64_adx.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\bec76f70393ddef1-poly1305_vec.o" "D:\\source\\h\\target\\debug\\build\\ring-a4d2d6bca2cee4b9\\out\\a9af75d892b04b75-p256-nistz.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\chacha-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\aesni-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\vpaes-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\x86_64-mont-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\x86_64-mont5-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\p256-x86_64-asm-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\aesni-gcm-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\ghash-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\sha512-x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\chacha20_poly1305_x86_64-nasm.o" "C:\\Users\\ddb1\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\sha256-x86_64-nasm.o" with args "" did not execute successfully (status code exit code: 1). ``` This makes me think I need to set the two variables conditionally, based on compilation to wasm32-unknown-unknown or on the feature hydrate. I don't know how to configure this within the cargo leptos system. I've looked at https://doc.rust-lang.org/nightly/cargo/reference/config.html#env but I don't think it supports this conditional. I also considered the `[[*.metadata.leptos]]` parameter `lib-cargo-args = []` but I don't know how to pass an environment variable here. I'm probably just missing the point. Any guidance would be appreciated. :)
tejedu commented 2024-05-20 17:52:40 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
michael.catanzariti commented 2024-05-28 14:42:47 +00:00 (Migrated from gitlab.com)

Same issue here! Any workaround?

Same issue here! Any workaround?
michael.catanzariti commented 2024-05-28 15:06:03 +00:00 (Migrated from gitlab.com)

Hi again,

Following this documentation https://docs.rs/cc/latest/cc/#compile-time-requirements, I just added cl.exe (MSVC) to PATH environment variable and it works!

Hi again, Following this documentation https://docs.rs/cc/latest/cc/#compile-time-requirements, I just added cl.exe (MSVC) to PATH environment variable and it works!
kerkmann commented 2024-06-06 11:22:39 +00:00 (Migrated from gitlab.com)

That's nice to know. Ring is often making problems (not only on windows), but I'll add that information to some troubleshooting guide! Thanks! ❤️

That's nice to know. Ring is often making problems (not only on windows), but I'll add that information to some troubleshooting guide! Thanks! :heart:
michael.catanzariti commented 2024-06-11 09:09:58 +00:00 (Migrated from gitlab.com)

Another option can be to install clang for Windows from here: https://github.com/llvm/llvm-project/releases

Another option can be to install clang for Windows from here: https://github.com/llvm/llvm-project/releases
Sign in to join this conversation.
No labels
WIP
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kerkmann/leptos_oidc#11
No description provided.