tauri-apps/tauri · error
failed to read binary path
Error message
failed to read binary path
What it means
For every non-main [[bin]] binary in the project, the MSI bundler converts its built path to a UTF-8 String for the WiX data. into_string() fails when that path (target directory plus binary name) contains non-UTF-8 bytes.
Source
Thrown at crates/tauri-bundler/src/bundle/windows/msi/mod.rs:953
binaries.push(Binary {
guid: Uuid::new_v4().to_string(),
path: dest
.into_os_string()
.into_string()
.expect("failed to read external binary path"),
id: wix_identifier(&dest_filename),
});
}
for bin in settings.binaries() {
if !bin.main() {
binaries.push(Binary {
guid: Uuid::new_v4().to_string(),
path: settings
.binary_path(bin)
.into_os_string()
.into_string()
.expect("failed to read binary path"),
id: wix_identifier(bin.name()),
})
}
}
Ok(binaries)
}
#[derive(Serialize)]
struct MergeModule {
name: String,
path: String,
}
fn get_merge_modules(settings: &Settings) -> crate::Result<Vec<MergeModule>> {
let mut merge_modules = Vec::new();
let regex = Regex::new(r"[^\w\d\.]")?;
for msm in glob::glob(View on GitHub (pinned to 52e4b6e71d)
Solutions
- Move or clone the project to an all-ASCII path (e.g. C:\src\app) and rebuild
- Rename the offending non-UTF-8 path component
- On Windows, also set TMP/TEMP to an ASCII directory as a precaution
Defensive patterns
Strategy: validation
Validate before calling
// before MSI bundling a multi-bin crate, confirm the target path is UTF-8
let out = std::path::Path::new(env!("CARGO_TARGET_DIR"));
if out.to_str().is_none() {
eprintln!("project/target path is not valid UTF-8 — move the project to an ASCII path");
std::process::exit(1);
} Prevention
- Check out projects into all-ASCII directories on build machines
- Rename any non-UTF-8 path components in the build root
- Keep TMP/TEMP ASCII as well — this error often co-occurs with the temp-path variant
When it happens
Trigger: MSI bundling a crate that declares extra [[bin]] targets while the project or target path contains non-UTF-8 bytes — a legacy-encoded checkout directory on Unix, or unpaired-surrogate path segments on Windows.
Common situations: Projects checked out under user directories with non-UTF-8 names; locale-mangled folder names; usually appears together with the temp-path variant (error 176).
Related errors
- failed to extract external binary filename
- failed to read external binary path
- failed to convert merge module filename to string
- Language {} not found. It must be one of {}
- Failed to setup custom handlebar template
AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20).
Data as JSON: /api/errors/8c16b6625233bb29.
Report an issue: GitHub.