@@ -96,7 +96,7 @@ pub struct RustupTarget {
9696}
9797
9898pub struct Rust {
99- app_settings : RustAppSettings ,
99+ app_settings : Arc < RustAppSettings > ,
100100 config_features : Vec < String > ,
101101 product_name : Option < String > ,
102102 available_targets : Option < Vec < RustupTarget > > ,
@@ -138,15 +138,15 @@ impl Interface for Rust {
138138 let app_settings = RustAppSettings :: new ( config, manifest, target) ?;
139139
140140 Ok ( Self {
141- app_settings,
141+ app_settings : Arc :: new ( app_settings ) ,
142142 config_features : config. build . features . clone ( ) . unwrap_or_default ( ) ,
143143 product_name : config. package . product_name . clone ( ) ,
144144 available_targets : None ,
145145 } )
146146 }
147147
148- fn app_settings ( & self ) -> & Self :: AppSettings {
149- & self . app_settings
148+ fn app_settings ( & self ) -> Arc < Self :: AppSettings > {
149+ self . app_settings . clone ( )
150150 }
151151
152152 fn build ( & mut self , options : Options ) -> crate :: Result < ( ) > {
@@ -350,6 +350,8 @@ fn shared_options(
350350 args. push ( "--bins" . into ( ) ) ;
351351 let all_features = app_settings
352352 . manifest
353+ . lock ( )
354+ . unwrap ( )
353355 . all_enabled_features ( if let Some ( f) = features { f } else { & [ ] } ) ;
354356 if !all_features. contains ( & "tauri/rustls-tls" . into ( ) ) {
355357 features
@@ -382,7 +384,7 @@ fn dev_options(
382384 shared_options ( mobile, args, features, app_settings) ;
383385
384386 if !args. contains ( & "--no-default-features" . into ( ) ) {
385- let manifest_features = app_settings. manifest . features ( ) ;
387+ let manifest_features = app_settings. manifest . lock ( ) . unwrap ( ) . features ( ) ;
386388 let enable_features: Vec < String > = manifest_features
387389 . get ( "default" )
388390 . cloned ( )
@@ -504,7 +506,7 @@ impl Rust {
504506 match reload_config ( config. as_deref ( ) ) {
505507 Ok ( config) => {
506508 info ! ( "Tauri configuration changed. Rewriting manifest..." ) ;
507- self . app_settings . manifest =
509+ * self . app_settings . manifest . lock ( ) . unwrap ( ) =
508510 rewrite_manifest ( config. lock ( ) . unwrap ( ) . as_ref ( ) . unwrap ( ) ) ?
509511 }
510512 Err ( err) => {
@@ -672,7 +674,7 @@ impl CargoSettings {
672674}
673675
674676pub struct RustAppSettings {
675- manifest : Manifest ,
677+ manifest : Mutex < Manifest > ,
676678 cargo_settings : CargoSettings ,
677679 cargo_package_settings : CargoPackageSettings ,
678680 package_settings : PackageSettings ,
@@ -702,7 +704,7 @@ impl AppSettings for RustAppSettings {
702704 self . target_triple . starts_with ( "x86_64" ) || self . target_triple . starts_with ( "aarch64" ) ;
703705
704706 let mut settings = tauri_config_to_bundle_settings (
705- & self . manifest ,
707+ & self . manifest . lock ( ) . unwrap ( ) ,
706708 features,
707709 config. tauri . bundle . clone ( ) ,
708710 arch64bits,
@@ -855,6 +857,8 @@ impl AppSettings for RustAppSettings {
855857 fn app_name ( & self ) -> Option < String > {
856858 self
857859 . manifest
860+ . lock ( )
861+ . unwrap ( )
858862 . inner
859863 . as_table ( )
860864 . get ( "package" )
@@ -867,6 +871,8 @@ impl AppSettings for RustAppSettings {
867871 fn lib_name ( & self ) -> Option < String > {
868872 self
869873 . manifest
874+ . lock ( )
875+ . unwrap ( )
870876 . inner
871877 . as_table ( )
872878 . get ( "lib" )
@@ -991,7 +997,7 @@ impl RustAppSettings {
991997 let target = Target :: from_triple ( & target_triple) ;
992998
993999 Ok ( Self {
994- manifest,
1000+ manifest : Mutex :: new ( manifest ) ,
9951001 cargo_settings,
9961002 cargo_package_settings,
9971003 package_settings,
0 commit comments