hydrogen602
hydrogen602

Reputation: 21

Using tauri with multiple Rust executables

I'm using Tauri and Rust to make an app and I have two binaries in Rust: One is the tauri app, and the other is a helper program (turning Rust structs into Typescript interfaces). I set the tauri app binary as the default binary in the Cargo.toml

[package]
name = "app"
default-run = "app"

This setup works fine when I run npm run tauri dev. However, if I try bundling it into a MacOS application, the tauri build system copies the helper executable into app rather than the default binary that is the actual tauri app.

Is there some way to tell tauri which Rust binary to package when bundling a MacOS Application?

I've tried setting a default binary default-run = "app", and I've looked but not found anything in Tauri's docs for setting a binary.

I've also tried removing the helper binary, but it still tries bundle the (now missing) helper binary.

Removing the helper binary would be a fix of last resort because of its use while developing.

Upvotes: 2

Views: 714

Answers (1)

DeveloperMindset.com
DeveloperMindset.com

Reputation: 514

As far as I'm aware there are no such option inside of the Tauri builder yet.

Here's a copy_binaries function of tauri_build that's responsible for this behavior in your question.

What does work for us is to setup a Rust workspace with multiple Tauri packages, but share a common library, and then work the standalone release system from there.

Upvotes: 0

Related Questions