Skip to content

Commit

Permalink
feat(bundler): enhance notarization error message (#7974)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Oct 19, 2023
1 parent 9bead42 commit 3880b42
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/improve-notarytool-error-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-bundler": patch:enhance
---

Include notarytool log output on error message in case notarization fails.
17 changes: 16 additions & 1 deletion tooling/bundler/src/bundle/macos/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,22 @@ pub fn notarize(
staple_app(app_bundle_path)?;
Ok(())
} else {
Err(anyhow::anyhow!("{log_message}").into())
if let Ok(output) = Command::new("xcrun")
.args(["notarytool", "log"])
.arg(&submit_output.id)
.notarytool_args(&auth)
.output_ok()
{
Err(
anyhow::anyhow!(
"{log_message}\nLog:\n{}",
String::from_utf8_lossy(&output.stdout)
)
.into(),
)
} else {
Err(anyhow::anyhow!("{log_message}").into())
}
}
} else {
Err(anyhow::anyhow!("failed to parse notarytool output as JSON: `{output_str}`").into())
Expand Down

0 comments on commit 3880b42

Please sign in to comment.