tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
82.26k stars 2.47k forks source link

[bug] error: failed to run custom build command for webview2-com-sys v0.13.0 in windows #8011

Open hjmallon opened 11 months ago

hjmallon commented 11 months ago

Describe the bug

This is a direct duplicate of https://github.com/tauri-apps/tauri/issues/4124 (deliberately, since that one is closed)

Tauri fails to build on Rust when installed with the standalone installer. webview2-com-sys doesn't build.

This is down to this bug https://github.com/wravery/webview2-rs/issues/23 which is patched here (not merged yet) https://github.com/wravery/webview2-rs/pull/24.

webview2-com-sys has a hard requirement on rustfmt existing during its build.rs.

I am going to work around by installing via rustup (as the Tauri docs recommend), but we should still work with upstream to fix this, since it seems quite easy to fix.

Reproduction

Install cargo and rust with standalone on Windows https://forge.rust-lang.org/infra/other-installation-methods.html#standalone-installers Try to build a tauri app

Expected behavior

No response

Platform and versions

yarn run v1.22.19
$ tauri info

[⚠] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 117.0.2045.60
    ✔ MSVC: Visual Studio Build Tools 2022
    ✔ rustc: 1.73.0 (cc66ad468 2023-10-03)
    ✔ Cargo: 1.73.0 (9c4383fb5 2023-08-26)
    ⚠ rustup: not installed!
      If you have rust installed some other way, we recommend uninstalling it
      then use rustup instead. Visit https://rustup.rs/
    ⚠ Rust toolchain: couldn't be detected!
      Maybe you don't have rustup installed? if so, Visit https://rustup.rs/
    - node: 18.18.0
    - yarn: 1.22.19
    - npm: 9.8.1

[-] Packages
    - tauri [RUST]: 1.5.1
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.4
    - tao [RUST]: 0.16.4
    - tauri-cli [RUST]: not installed!
    - @tauri-apps/api [NPM]: 1.5.0
    - @tauri-apps/cli [NPM]: 1.5.2

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite
Done in 7.50s.

Stack trace

No response

Additional context

No response

EDIT: Also related to https://github.com/tauri-apps/tauri/issues/7024

hjmallon commented 11 months ago

In theory this 0.27 release fixes the issue https://github.com/wravery/webview2-rs/pull/25

lorrding commented 7 months ago

Any update on this? Is there any workaround other than installing Rustup? (I can't do that on this laptop).

Can't we update the dependency to the current v0.28 release?

FabianLars commented 7 months ago

Can't we update the dependency to the current v0.28 release?

Likely not in v1. v2 is pretty close though.

Also, check out the workarounds mentioned in the issue linked above (https://github.com/tauri-apps/tauri/issues/4124).