Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Tauri swallowed Wix (candle.exe) 's error output #12148

Closed
liigo opened this issue Jan 3, 2025 · 5 comments
Closed

[bug] Tauri swallowed Wix (candle.exe) 's error output #12148

liigo opened this issue Jan 3, 2025 · 5 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@liigo
Copy link
Contributor

liigo commented Jan 3, 2025

Describe the bug

When run cargo tauri build, tauri swallowed Wix (candle.exe) 's error output, and that makes it hard to find the root error.

    Running candle for "main.wxs"
    Error failed to bundle project:
    - error running candle.exe
    - `failed to run C:\Users\liigo\AppData\Local\tauri\WixTools314\candle.exe`

The swallowed error is (you only got this untill you run candle.exe manually):

Windows Installer XML Toolset Compiler version 3.14.1.8722
Copyright (c) .NET Foundation and contributors. All rights reserved.

main.wxs
main.wxs(15) : error CNDL0006 : The Product/@Manufacturer attribute's value cannot be an empty string. If a value is not required, simply remove the entire attribute.

see DioxusLabs/dioxus#3233 and DioxusLabs/dioxus-template#58

Reproduction

step 1: set "identifier": "" in tauri.conf.json (to get a bad main.wxs)
step 2: run cargo tauri build

Expected behavior

Instead of a just saying failed to run candle.exe, it should output the detail error at least contains:

main.wxs(15) : error CNDL0006 : The Product/@Manufacturer attribute's value cannot be an empty string.

Full tauri info output

> cargo tauri info

[✔] Environment
    - OS: Windows 10.0.19045 x86_64 (X64)
    ✔ WebView2: 121.0.2277.128
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26)
    ✔ cargo: 1.83.0 (5ffbef321 2024-10-29)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - bun: 1.1.30
    - deno: deno 2.0.6

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - tauri-cli 🦀: 2.0.4

[-] Plugins
    - tauri-plugin-shell 🦀: 2.2.0

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


### Stack trace

```text
N/A

Additional context

cargo tauri build

PS C:\Users\liigo\tmp\hi-tauri-sycamore-new> cargo tauri build
    Running beforeBuildCommand `trunk build --release`
2025-01-03T02:12:01.463698Z  INFO Starting trunk 0.21.5
2025-01-03T02:12:01.467227Z  INFO starting build
    Finished `release` profile [optimized] target(s) in 0.64s
2025-01-03T02:12:06.823934Z  INFO applying new distribution
2025-01-03T02:12:06.850674Z  INFO success
   Compiling hi-tauri-sycamore-new v0.1.0 (C:\Users\liigo\tmp\hi-tauri-sycamore-new\src-tauri)
    Finished `release` profile [optimized] target(s) in 1m 07s
    Built application at: E:\tmp\RUST_DIR\CARGO_TARGET_DIR\release\hi-tauri-sycamore-new.exe
    Info Target: x64
    Running candle for "main.wxs"
    Error failed to bundle project:
    - error running candle.exe
    - `failed to run C:\Users\liigo\AppData\Local\tauri\WixTools314\candle.exe`
PS C:\Users\liigo\tmp\hi-tauri-sycamore-new> 
@liigo liigo added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jan 3, 2025
liigo added a commit to liigo/tauri that referenced this issue Jan 3, 2025
@FabianLars
Copy link
Member

This is more or less intended. You should run cargo tauri build --verbose for more output.

Whether or not hiding everything by default is a good idea is debatable but at least we're consistent about that (same behavior on all platforms).

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2025
@liigo
Copy link
Contributor Author

liigo commented Jan 4, 2025

@FabianLars

You should run cargo tauri build --verbose for more output.

tauri-bundler crate (which is used by dioxus) also swallowed Wix (candle.exe) 's error output:

dx bundle --platform desktop

  17.527s ERROR Failed to bundle project: BundlerError(
    Error {
        context: "error running candle.exe",
        source: GenericError(
            "failed to run C:\\Users\\liigo\\AppData\\Local\\tauri\\WixTools314\\candle.exe",
        ),
    },
)
  17.532s ERROR err=BundleFailed(BundlerError(error running candle.exe

Caused by:
    `failed to run C:\Users\liigo\AppData\Local\tauri\WixTools314\candle.exe`))

( there is a link to DioxusLabs/dioxus#3233 )

@FabianLars
Copy link
Member

Sounds like they don't use tauri-bundler's log_level api then

@liigo
Copy link
Contributor Author

liigo commented Jan 6, 2025

Yes you're right, thanks. Dioxus' dx is a CLI tool, that may be configed to redirect tauri-bundler's output of log::debug!s to end users.


Edit: they do use tauri-bundler's log_level api (set to Debug, see following), but, I still can't see tauri-bundler's logs. I guess the reason maybe is, dioxus-cli uses tracing (and tracing_subscriber) crate instead of log crate. If the output of log::debug!s is considered as part of tauri-bundler's api, that's a bit hard to use then. @FabianLars

https://docs.rs/crate/dioxus-cli/0.6.1/source/src/cli/bundle.rs#208

  50.735s DEBUG dx::cli::bundle: Bundling project with settings: Settings {
    log_level: Debug,
    package: PackageSettings { ... }

Edit 2: they disabled log:

[dependencies]
# disable `log` entirely since `walrus` uses it and is *much* slower with it enableda
log = { version = "0.4", features = ["max_level_off", "release_max_level_off"] }

@FabianLars
Copy link
Member

Edit 2: they disabled log:

That is unfortunate then because those feature flags also "break" tracing-log.
We currently have no desire to switch to tracing in the cli crates (incl the bundler). :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants