tauri-apps / tauri

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

[bug] Command failed with exit code 4294967295. #8862

Closed Yago1290 closed 7 months ago

Yago1290 commented 7 months ago

Describe the bug

when i run $ tauri dev, When I run the dev command tauri doesn't work help me! :(

error: linker link.exe not found | = note: program not found

note: the msvc targets depend on the msvc linker but link.exe was not found

note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.

note: VS Code is a different product, and is not sufficient.

error: could not compile lock_api (build script) due to previous error warning: build failed, waiting for other jobs to finish... error: could not compile windows_x86_64_msvc (build script) due to previous error error: could not compile getrandom (build script) due to previous error error: could not compile parking_lot_core (build script) due to previous error error: could not compile serde_json (build script) due to previous error error: could not compile thiserror (build script) due to previous error error: could not compile serde (build script) due to previous error error: could not compile proc-macro2 (build script) due to previous error error: could not compile syn (build script) due to previous error error: could not compile winapi (build script) due to previous error  ELIFECYCLE  Command failed with exit code 4294967295.

Reproduction

my reprodution its a step-to-step of next tauri app : https://tauri.app/v1/guides/getting-started/setup/next-js/

Expected behavior

No response

Full tauri info output

[✘] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 121.0.2277.112
    ✘ Couldn't detect any Visual Studio or VS Build Tools instance with MSVC and SDK components. Download from https://aka.ms/vs/17/release/vs_BuildTools.exe
    ✔ rustc: 1.75.0 (82e1608df 2023-12-21)
    ✔ cargo: 1.75.0 (1d8b05cdd 2023-11-20)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.10.0
    - pnpm: 8.15.1
    - yarn: 1.22.19
    - npm: 10.2.3
    - bun: 1.0.26

[-] Packages
    - tauri [RUST]: 1.5.4
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.7
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 1.5.9

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../out
    - devPath: http://localhost:3000/
    - framework: React (Next.js)
    - bundler: Webpack

Stack trace

No response

Additional context

No response

pewsheen commented 7 months ago

Have you installed the Microsoft Visual Studio C++ Build Tools? If not, you could follow the guide here: https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-windows

drobbins-ancile commented 5 months ago

Have you installed the Microsoft Visual Studio C++ Build Tools? If not, you could follow the guide here: tauri.app/v1/guides/getting-started/prerequisites#setting-up-windows

We're seeing this issue in a build process after installing the visualstudio2022buildtools and visualstudio2022-workload-vctools packages via chocolatey. As far as I can tell from the documentation this should satisfy the dependency requirement outlined in the guide you linked above.

Is there somewhere else we could look to determine what we're missing?

FabianLars commented 5 months ago

@drobbins-ancile Looking at the description of visualstudio2022-workload-vctools it installs the recommended components unless you use the --no-includeRecommended. Did you by any chance use that flag? The most important components for Tauri/Rust are part of the recommended set.

If that's not it, can you check if typing link.exe and rc.exe in your normal terminal (where you run tauri commands) gives you any "not found" errors?

drobbins-ancile commented 5 months ago

@drobbins-ancile Looking at the description of visualstudio2022-workload-vctools it installs the recommended components unless you use the --no-includeRecommended. Did you by any chance use that flag? The most important components for Tauri/Rust are part of the recommended set.

If that's not it, can you check if typing link.exe and rc.exe in your normal terminal (where you run tauri commands) gives you any "not found" errors?

We are installing with these options (in an AWS codebuild project - server 2019 core).

choco install visualstudio2022buildtools -y -n --package-parameters "--all --norestart --nocache --quiet"
choco install visualstudio2022-workload-vctools -y -n --package-parameters "--all --norestart --nocache --quiet"

Both link and rc are not found. No errors during the installs of these packages.

At this point I'm assuming the vs2022 install isn't adding the required locations to the PATH env variable.

FabianLars commented 5 months ago

At this point I'm assuming the vs2022 install isn't adding the required locations to the PATH env variable.

Yeah, indeed looks like it. I have 0 experience with choco and aws so i hope someone else will chime in (or it's enough of a pointer for you to figure it out yourself 🙏 )

drobbins-ancile commented 5 months ago

At this point I'm assuming the vs2022 install isn't adding the required locations to the PATH env variable.

Yeah, indeed looks like it. I have 0 experience with choco and aws so i hope someone else will chime in (or it's enough of a pointer for you to figure it out yourself 🙏 )

Just to confirm - yarn tauri info is looking for the link and rc executables when it's making the check for VS build tools?

FabianLars commented 5 months ago

No, it's using https://github.com/microsoft/vswhere but i don't know how exactly vswhere works.