tauri-apps / tauri-docs

The source for all Tauri project documentation.
https://tauri.app
MIT License
774 stars 568 forks source link

[bug] ring not compiling on aarch64-pc-windows-msvc through parallels #2592

Open Vexcited opened 2 weeks ago

Vexcited commented 2 weeks ago

Describe the bug

I'm trying to run Tauri in a Windows 11 VM through Parallels on a M2 MacBook.

I did all the steps to install MSVC correctly. According to previous issues, everything related to Windows arm64 is fixed (even that ring compilation error) but I still get the issue and I wonder what's happening.

Reproduction

  1. Make a new project (I use the 2.0 rc)
  2. Try to run dev or build

Expected behavior

The app to build correctly.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 127.0.2651.105
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-pc-windows-msvc (default)
    - node: 22.7.0
    - pnpm: 9.8.0
    - npm: 10.8.2
    - bun: 1.1.26

[-] Packages
    - tauri [RUST]: 2.0.0-rc.6
    - tauri-build [RUST]: 2.0.0-rc.6
    - wry [RUST]: 0.42.0
    - tao [RUST]: 0.29.1
    - @tauri-apps/api [NPM]: 2.0.0-rc.3
    - @tauri-apps/cli [NPM]: 2.0.0-rc.7

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: SolidJS
    - bundler: Vite

Stack trace

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

Caused by:
  process didn't exit successfully: `C:\Users\vexcited\Projects\SolidCord\src-tauri\target\release\build\ring-d10e08102cb23e3a\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(3)
  TARGET = Some(aarch64-pc-windows-msvc)
  OUT_DIR = Some(C:\Users\vexcited\Projects\SolidCord\src-tauri\target\release\build\ring-68821a8deac67f17\out)
  HOST = Some(aarch64-pc-windows-msvc)
  cargo:rerun-if-env-changed=VCINSTALLDIR
  VCINSTALLDIR = None
  cargo:rerun-if-env-changed=VisualStudioDir
  VisualStudioDir = 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
  cargo:rerun-if-env-changed=PATH
  PATH = Some(C:\Users\vexcited\Projects\SolidCord\src-tauri\target\release\deps;C:\Users\vexcited\Projects\SolidCord\src-tauri\target\release;C:\Users\vexcited\.rustup\toolchains\stable-aarch64-pc-windows-msvc\lib\rustlib\aarch64-pc-windows-msvc\lib;C:\Users\vexcited\Projects\SolidCord\node_modules\.bin;C:\Users\vexcited\AppData\Roaming\npm\node_modules\pnpm\dist\node-gyp-bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot\bin;C:\Program Files\Parallels\Parallels Tools\Applications;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\msys64\clangarm64\bin;C:\Users\vexcited\.cargo\bin;C:\Users\vexcited\AppData\Local\Microsoft\WindowsApps;C:\Users\vexcited\AppData\Roaming\npm;C:\Users\vexcited\.bun\bin;C:\Users\vexcited\AppData\Local\Programs\Microsoft VS Code\bin)
  cargo:rerun-if-env-changed=INCLUDE
  INCLUDE = None
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_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(neon)
  DEBUG = Some(false)
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_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=In file included from crypto/curve25519/curve25519.c:24:
  cargo:warning=In file included from crypto/curve25519/internal.h:20:
  cargo:warning=In file included from crypto/curve25519/../internal.h:115:
  cargo:warning=include/ring-core/check.h:27:11: fatal error: 'assert.h' file not found
  cargo:warning=   27 | # include <assert.h>
  cargo:warning=      |           ^~~~~~~~~~
  cargo:warning=1 error generated.

  --- stderr
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\aesv8-armx-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\aesv8-armx-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\ghashv8-armx-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\ghashv8-armx-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\chacha-armv8-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\chacha-armv8-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\chacha20_poly1305_armv8-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\chacha20_poly1305_armv8-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\vpaes-armv8-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\vpaes-armv8-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\armv8-mont-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\armv8-mont-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\p256-armv8-asm-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\p256-armv8-asm-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\ghash-neon-armv8-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\ghash-neon-armv8-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\aesv8-gcm-armv8-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\aesv8-gcm-armv8-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\sha512-armv8-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\sha512-armv8-win64.S"
  running "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-oC:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\sha256-armv8-win64.o" "C:\\Users\\vexcited\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.17.8\\pregenerated\\sha256-armv8-win64.S"

  error occurred: Command "clang" "-O3" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-msvc" "-I" "include" "-I" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-o" "C:\\Users\\vexcited\\Projects\\SolidCord\\src-tauri\\target\\release\\build\\ring-68821a8deac67f17\\out\\fad98b632b8ce3cc-curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args clang did not execute successfully (status code exit code: 1).

warning: build failed, waiting for other jobs to finish...
    Error failed to build app: failed to build app

Additional context

I can't even build the CLI so I used the npm binary to run tauri dev, tauri build or tauri info.

FabianLars commented 2 weeks ago

This is more or less a known issue but one that was only talked about on discord and did not have a github tracking issue yet (thanks for creating one). Weirdly enough this seems to be specific to Parallels. Other vms work fine afaik (i use utm and last time this topic came up it worked fine).

I did not try parallels myself yet so it could also be that i simply set up my vm differently. Can you make sure all of the requirements listed in https://github.com/briansmith/ring/blob/main/BUILDING.md are fulfilled?

I'm still out of office for a while so won't be able to check this out myself.

Vexcited commented 2 weeks ago

That was it ! Thanks you so much !

I only had VS 2022 C++ ARM64 build tools installed but Clang tools wasn't (why isn't it included by default...)

I also did $env:Path += ";C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\ARM64\bin" as mentioned in the linked documentation.

I removed my msys2 clang installation because somehow it was breaking the build.

FabianLars commented 2 weeks ago

Nice, thanks for testing! I'll move this issue to the docs repo so we can write this down in the build guides :)