Skip to content

Commit 4bfe488

Browse files
fix: fails to build universal fat binary if main bin is renamed to another name (#10550)
* fix: fails to build universal fat binary if main bin is renamed to another name * lint --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
1 parent bba1a44 commit 4bfe488

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
fails to build universal fat binary if main bin is renamed to another name in `Cargo.toml`

tooling/cli/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tooling/cli/src/interface/rust.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,12 @@ impl AppSettings for RustAppSettings {
860860
}
861861

862862
fn app_binary_path(&self, options: &Options) -> crate::Result<PathBuf> {
863-
let bin_name = self.cargo_package_settings().name.clone();
863+
let binaries = self.get_binaries(&self.target_triple)?;
864+
let bin_name = binaries
865+
.iter()
866+
.find(|x| x.main())
867+
.expect("failed to find main binary")
868+
.name();
864869

865870
let out_dir = self
866871
.out_dir(options)
@@ -1082,10 +1087,6 @@ impl RustAppSettings {
10821087
})
10831088
}
10841089

1085-
pub fn cargo_package_settings(&self) -> &CargoPackageSettings {
1086-
&self.cargo_package_settings
1087-
}
1088-
10891090
fn target<'a>(&'a self, options: &'a Options) -> Option<&'a str> {
10901091
options
10911092
.target

tooling/cli/src/mobile/ios/project.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const TEMPLATE_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/templates/mobile
2929

3030
// unprefixed app_root seems pretty dangerous!!
3131
// TODO: figure out what cargo-mobile meant by that
32+
#[allow(clippy::too_many_arguments)]
3233
pub fn gen(
3334
tauri_config: &TauriConfig,
3435
config: &Config,

0 commit comments

Comments
 (0)