crbench//

← all cases

fix(core): Correctly detect Android Tauri configuration file, closes #7785

Tier 2 easy rust · local · real merged PR from tauri-apps/tauri #7802

Ground-truth defects

d1 · correctness · high · tooling/cli/src/helpers/config.rs
The rewritten `reload()` reads the current target out of the config handle with `if let Some(conf) = &*config_handle().lock().unwrap()` and calls `get_internal` from inside that block. The `MutexGuard` is a temporary in the `if let` scrutinee, so it is alive for the whole body rather than being dropped at the end of the statement, and `get_internal` locks the same `Mutex` again when it stores the freshly parsed config (`*config_handle().lock().unwrap() = Some(ConfigMetadata { .. })`). `std::sync::Mutex` is not re-entrant, so the second lock blocks on a guard held by the same thread and the process hangs with no error and no panic. The caller is the dev-server file watcher (`tooling/cli/src/dev.rs` calls `reload_config` when tauri.conf.json changes), so `tauri dev` deadlocks on the first config edit — the exact workflow the PR set out to improve.

The change under review

diff (truncated — full diff)
diff --git a/.changes/cli-config-target-mobile.md b/.changes/cli-config-target-mobile.md
new file mode 100644
index 000000000000..6157544e8c12
--- /dev/null
+++ b/.changes/cli-config-target-mobile.md
@@ -0,0 +1,6 @@
+---
+"tauri-cli": patch:bug
+"@tauri-apps/cli": patch:bug
+---
+
+Properly read platform-specific configuration files for mobile targets.
diff --git a/.changes/codegen-target-from-utils.md b/.changes/codegen-target-from-utils.md
new file mode 100644
index 000000000000..dfb2ef17babd
--- /dev/null
+++ b/.changes/codegen-target-from-utils.md
@@ -0,0 +1,6 @@
+---
+"tauri-codegen": patch:enhance
+"tauri-macros": patch:enhance
+---
+
+Use `Target` enum from `tauri_utils::platform`.
diff --git a/.changes/mobile-config-naming-conventions.md b/.changes/mobile-config-naming-conventions.md
new file mode 100644
index 000000000000..5517951ab269
--- /dev/null
+++ b/.changes/mobile-config-naming-conventions.md
@@ -0,0 +1,5 @@
+---
+"tauri-utils": patch:breaking
+---
+
+Follow file name conventions set by desktop for mobile Tauri configuration files. Added `target` argument on most `config::parse` methods.
diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs
index 8e46612f429e..66eae198cebc 100644
--- a/core/tauri-build/src/lib.rs
+++ b/core/tauri-build/src/lib.rs
@@ -294,6 +294,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
   cfg_alias("mobile", mobile);
 
   let mut config = serde_json::from_value(tauri_utils::config::parse::read_from(
+    tauri_utils::platform::Target::from_triple(&std::env::var("TARGET").unwrap()),
     std::env::current_dir().unwrap(),
   )?)?;
   if let Ok(env) = std::env::var("TAURI_CONFIG") {
diff --git a/core/tauri-codegen/src/context.rs b/core/tauri-codegen/src/context.rs
index 788db7db5d43..f9bdde66b1b6 100644
--- a/core/tauri-codegen/src/context.rs
+++ b/core/tauri-codegen/src/context.rs
@@ -15,6 +15,7 @@ use tauri_utils::config::{AppUrl, Config, PatternKind, WindowUrl};
 use tauri_utils::html::{
   inject_nonce_token, parse as parse_html, serialize_node as serialize_html_node,
 };
+use tauri_utils::platform::Target;
 
 use crate::embedded_assets::{AssetOptions, CspHashes, EmbeddedAssets, EmbeddedAssetsError};
 
@@ -112,26 +113,6 @@ fn map_isolation(
   }
 }
 
-#[derive(PartialEq, Eq, Clone, Copy)]
-enum Target {
-  Linux,
-  Windows,
-  Darwin,
-  Android,
-  // iOS.
-  Ios,
-}
-
-impl Target {
-  fn is_mobile(&self) -> bool {
-    matches!(self, Target::Android | Target::Ios)
-  }
-
-  fn is_desktop(&self) -> bool {
-    !self.is_mobile()
-  }
-}
-
 /// Build a `tauri::Context` for including in application code.
 pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsError> {
   let ContextData {
@@ -141,34 +122,11 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
     root,
   } = data;
 
-  let target =
-    if let Ok(target) = std::env::var("TARGET").or_else(|_| std::env::var("TAURI_TARGET_TRIPLE")) {
-      if target.contains("unknown-linux") {
-        Target::Linux
-      } else if target.contains("pc-windows") {
-        Target::Windows
-      } else if target.contains("apple-darwin") {
-        Target::Darwin
-      } else if target.contains("android") {
-        Target::Android
-      } else if target.contains("apple-ios") {
-        Target::Ios
-      } else {
-        panic!("unknown codegen target {target}");
-      }
-    } else if cfg!(target_os = "linux") {
-      Target::Linux
-    } else if cfg!(windows) {
-      Target::Windows
-    } else if cfg!(target_os = "macos") {
-      Target::Darwin
-    } else if cfg!(target_os = "android") {
-      Target::Android
-    } else if cfg!(target_os = "ios") {
-      Target::Ios
-    } else {
-      panic!("unknown codegen target")
-    };
+  let target = std::env::var("TARGET")
+    .or_else(|_| std::env::var("TAURI_TARGET_TRIPLE"))
+    .as_deref()
+    .map(Target::from_triple)
+    .unwrap_or_else(|_| Target::current());
 
   let mut options = AssetOptions::new(config.tauri.pattern.clone())
     .freeze_prototype(config.tauri.security.freeze_prototype)
diff --git a/core/tauri-codegen/src/lib.rs b/core/tauri-codegen/src/lib.rs
index cf55797f169e..eeb2d6c9fff4 100644
--- a/core/tauri-codegen/src/lib.rs
+++ b/core/tauri-codegen/src/lib.rs
@@ -67,7 +67,10 @@ pub fn get_config(path: &Path) -> Result<(Config, PathBuf), CodegenConfigError>
   // it is impossible for the content of two separate configs to get mixed up. The chances are
   // already unlikely unless the developer goes out of their way to run the cli on a different
   // project than the target crate.
-  let mut config = serde_json::from_value(tauri_utils::config::parse::read_from(parent.clone())?)?;
+  let mut config = serde_json::from_value(tauri_utils::config::parse::read_from(
+    tauri_utils::platform::Target::current(),
+    parent.clone(),
+  )?)?;
   if let Ok(env) = std::env::var("TAURI_CONFIG") {
     let merge_config: serde_json::Value =
       serde_json::from_str(&env).map_err(CodegenConfigError::FormatInline)?;
diff --git a/core/tauri-macros/src/context.rs b/core/tauri-macros/src/context.rs
index c2855eebb29d..6d0ffd6892b1 100644
--- a/core/tauri-macros/src/context.rs
+++ b/core/tauri-macros/src/context.rs
@@ -11,7 +11,7 @@ use syn::{
   LitStr, PathArguments, PathSegment, Token,
 };
 use tauri_codegen::{context_codegen, get_config, ContextData};
-use tauri_utils::config::parse::does_supported_file_name_exist;
+use tauri_utils::{config::parse::does_supported_file_name_exist, platform::Target};
 
 pub(crate) struct ContextItems {
   config_file: PathBuf,
@@ -20,6 +20,12 @@ pub(crate) struct ContextItems {
 
 impl Parse for ContextItems {
   fn parse(input: &ParseBuffer<'_>) -> syn::parse::Result<Self> {
+    let target = std::env::var("TARGET")
+      .or_else(|_| std::env::var("TAURI_TARGET_TRIPLE"))
+      .as_deref()
+      .map(Target::from_triple)
+      .unwrap_or_else(|_| Target::current());
+
     let config_file = if input.is_empty() {
       std::env::var("CARGO_MANIFEST_DIR").map(|m| PathBuf::from(m).join("tauri.conf.json"))
     } else {
@@ -36,7 +42,7 @@ impl Parse for ContextItems {
       VarError::NotUnicode(_) => "CARGO_MANIFEST_DIR env var contained invalid utf8".into(),
     })
     .and_then(|path| {
-      if does_supported_file_name_exist(&path) {
+      if does_supported_file_name_exist(target, &path) {
         Ok(path)
       } else {
         Err(format!(
diff --git a/core/tauri-utils/src/config/parse.rs b/core/tauri-utils/src/config/parse.rs
index 6590620edd34..b098cb545707 100644
--- a/core/tauri-utils/src/config/parse.rs
+++ b/core/tauri-utils/src/config/parse.rs
@@ -3,6 +3,7 @@
 // SPDX-License-Identifier: MIT
 
 use crate::config::Config;
+use crate::platform::Target;
 use json_patch::merge;
 use serde::de::DeserializeOwned;
 use serde_json::Value;
@@ -47,47 +48,29 @@ impl ConfigFormat {
     }
   }
 
-  fn into_platform_file_name(self) -> &'static str {
+  fn into_platform_file_name(self, target: Target) -> &'static str {
     match self {
-      Self::Json => {
-        if cfg!(target_os = "macos") {
-          "tauri.macos.conf.json"
-        } else if cfg!(windows) {
-          "tauri.windows.conf.json"
-        } else if cfg!(target_os = "android") {
-          "tauri.android.conf.json"
-        } else if cfg!(target_os = "ios") {
-          "tauri.ios.conf.json"
-        } else {
-          "tauri.linux.conf.json"
-        }
-      }
-      Self::Json5 => {
-        if cfg!(target_os = "macos") {
-          "tauri.macos.conf.json5"
-        } else if cfg!(windows) {
-          "tauri.windows.conf.json5"
-        } else if cfg!(target_os = "android") {
-          "tauri.android.conf.json"
-        } else if cfg!(target_os = "ios") {
-          "tauri.ios.conf.json"
-        } else {
-          "tauri.linux.conf.json5"
-        }
-      }
-      Self::Toml => {
-        if cfg!(target_os = "macos") {
-          "Tauri.macos.toml"
-        } else if cfg!(windows) {
-          "Tauri.windows.toml"
-        } else if cfg!(target_os = "android") {
-          "tauri.android.toml"
-        } else if cfg!(target_os = "ios") {
-          "tauri.ios.toml"
-        } else {
-          "Tauri.linux.toml"
-        }
-      }
+      Self::Json => match target {
+        Target::Darwin => "tauri.macos.conf.json",
+        Target::Windows => "tauri.windows.conf.json",
+        Target::Linux => "tauri.linux.conf.json",
+        Target::Android => "tauri.android.conf.json",
+        Target::Ios => "tauri.ios.conf.json",
+      },
+      Self::Json5 => match target {
+        Target::Darwin => "tauri.macos.conf.json5",
+        Target::Windows => "tauri.windows.conf.json5",
+        Target::Linux => "tauri.linux.conf.json5",
+        Target::Android => "tauri.android.conf.json5",
+        Target::Ios => "tauri.ios.conf.json5",
+      },
+      Self::Toml => match target {
+        Target::Darwin => "Tauri.macos.toml",
+        Target::Windows => "Tauri.windows.toml",
+        Target::Linux => "Tauri.linux.toml",
+        Target::Android => "Tauri.android.toml",
+        Target::Ios => "Tauri.ios.toml",
+      },
     }
   }
 }
@@ -154,18 +137,18 @@ pub enum ConfigError {
 }
 
 /// Determines if the given folder has a configuration file.
-pub fn folder_has_configuration_file(folder: &Path) -> bool {
+pub fn folder_has_configuration_file(target: Target, folder: &Path) -> bool {
   folder.join(ConfigFormat::Json.into_file_name()).exists()
       || folder.join(ConfigFormat::Json5.into_file_name()).exists()
       || folder.join(ConfigFormat::Toml.into_file_name()).exists()
        // platform file names
-       || folder.join(ConfigFormat::Json.into_platform_file_name()).exists()
-      || folder.join(ConfigFormat::Json5.into_platform_file_name()).exists()
-      || folder.join(ConfigFormat::Toml.into_platform_file_name()).exists()
+       || folder.join(ConfigFormat::Json.into_platform_file_name(target)).exists()
+      || folder.join(ConfigFormat::Json5.into_platform_file_name(target)).exists()
+      || folder.join(ConfigFormat::Toml.into_platform_file_name(target)).exists()
 }
 
 /// Determines if the given file path represents a Tauri configuration file.
-pub fn is_configuration_file(path: &Path) -> bool {
+pub fn is_configuration_file(target: Target, path: &Path) -> bool {
   path
     .file_name()
     .map(|file_name| {
@@ -173,9 +156,9 @@ pub fn is_configuration_file(path: &Path) -> bool {
         || file_name == OsStr::new(ConfigFormat::Json5.into_file_name())
         || file_name == OsStr::new(ConfigFormat::Toml.into_file_name())
       // platform file names
-      || file_name == OsStr::new(ConfigFormat::Json.into_platform_file_name())
-        || file_name == OsStr::new(ConfigFormat::Json5.into_platform_file_name())
-        || file_name == OsStr::new(ConfigFormat::Toml.into_platform_file_name())
+      || file_name == OsStr::new(ConfigFormat::Json.into_platform_file_name(target))
+        || file_name == OsStr::new(ConfigFormat::Json5.into_platform_file_name(target))
+        || file_name == OsStr::new(ConfigFormat::Toml.into_platform_file_name(target))
     })
     .unwrap_or_default()
 }
@@ -192,9 +175,9 @@ pub fn is_configuration_file(path: &Path) -> bool {
 /// Merging the configurations using [JSON Merge Patch (RFC 7396)].
 ///
 /// [JSON Merge Patch (RFC 7396)]: https://datatracker.ietf.org/doc/html/rfc7396.
-pub fn read_from(root_dir: PathBuf) -> Result<Value, ConfigError> {
-  let mut config: Value = parse_value(root_dir.join("tauri.conf.json"))?.0;
-  if let Some((platform_config, _)) = read_platform(root_dir)? {
+pub fn read_from(target: Target, root_dir: PathBuf) -> Result<Value, ConfigError> {
+  let mut config: Value = parse_value(target, root_dir.join("tauri.conf.json"))?.0;
+  if let Some((platform_config, _)) = read_platform(target, root_dir)? {
     merge(&mut config, &platform_config);
   }
   Ok(config)
@@ -203,10 +186,13 @@ pub fn read_from(root_dir: PathBuf) -> Result<Value, ConfigError> {
 /// Reads the platform-specific configuration file from the given root directory if it exists.
 ///
 /// Check [`read_from`] for more information.
-pub fn read_platform(root_dir: PathBuf) -> Result<Option<(Value, PathBuf)>, ConfigError> {
-  let platform_config_path = root_dir.join(ConfigFormat::Json.into_platform_file_name());
-  if does_supported_file_name_exist(&platform_config_path) {
-    let (platform_config, path): (Value, PathBuf) = parse_value(platform_config_path)?;
+pub fn read_platform(
+  target: Target,
+  root_dir: PathBuf,
+) -> Result<Option<(Value, PathBuf)>, ConfigError> {
+  let platform_config_path = root_dir.join(ConfigFormat::Json.into_platform_file_name(target));
+  if does_supported_file_name_exist(target, &platform_config_path) {
+    let (platform_config, path): (Value, PathBuf) = parse_value(target, platform_config_path)?;
     Ok(Some((platform_config, path)))
   } else {
     Ok(None)
@@ -217,16 +203,16 @@ pub fn read_platform(root_dir: PathBuf) -> Result<Option<(Value, PathBuf)>, Conf
 ///
 /// The passed path is expected to be the path to the "default" configuration format, in this case
 /// JSON with `.json`.
-pub fn does_supported_file_name_exist(path: impl Into<PathBuf>) -> bool {
+pub fn does_supported_file_name_exist(target: Target, path: impl Into<PathBuf>) -> bool {
   let path = path.into();
   let source_file_name = path.file_name().unwrap().to_str().unwrap();
   let lookup_platform_config = ENABLED_FORMATS
     .iter()
-    .any(|format| source_file_name == format.into_platform_file_name());
+    .any(|format| source_file_name == format.into_platform_file_name(target));
   ENABLED_FORMATS.iter().any(|format| {
     path
       .with_file_name(if lookup_platform_config {
-        format.into_platform_file_name()
+        format.into_platform_file_name(target)
       } else {
         format.into_file_name()
       })
@@ -248,31 +234,37 @@ pub fn does_supported_file_name_exist(path: impl Into<PathBuf>) -> bool {
 ///   a. Parse it with `toml`
 ///   b. Return error if all above steps failed
 /// 4. Return error if all above steps failed
-pub fn parse(path: impl Into<PathBuf>) -> Result<(Config, PathBuf), ConfigError> {
-  do_parse(path.into())
+pub fn parse(target: Target, path: impl Into<PathBuf>) -> Result<(Config, PathBuf), ConfigError> {
+  do_parse(target, path.into())
 }
 
 /// See [`parse`] for specifics, returns a JSON [`Value`] instead of [`Config`].
-pub fn parse_value(path: impl Into<PathBuf>) -> Result<(Value, PathBuf), ConfigError> {
-  do_parse(path.into())
+pub fn parse_value(
+  target: Target,
+  path: impl Into<PathBuf>,
+) -> Result<(Value, PathBuf), ConfigError> {
+  do_parse(target, path.into())
 }
 
-fn do_parse<D: DeserializeOwned>(path: PathBuf) -> Result<(D, PathBuf), ConfigError> {
+fn do_parse<D: DeserializeOwned>(
+  target: Target,
+  path: PathBuf,
+) -> Result<(D, PathBuf), ConfigError> {
   let file_name = path
     .file_name()
     .map(OsStr::to_string_lossy)
     .unwrap_or_default();
   let lookup_platform_config = ENABLED_FORMATS
     .iter()
-    .any(|format| file_name == format.into_platform_file_name());
+    .any(|format| file_name == format.into_platform_file_name(target));
 
   let json5 = path.with_file_name(if lookup_platform_config {
-    ConfigFormat::Json5.into_platform_file_name()
+    ConfigFormat::Json5.into_platform_file_name(target)
   } else {
     ConfigFormat::Json5.into_file_name()
   });
   let toml = path.with_file_name(if lookup_platform_config {
-    ConfigFormat::Toml.into_platform_file_name()
+    ConfigFormat::Toml.into_platform_file_name(target)
   } else {
     ConfigFormat::Toml.into_file_name()
   });
diff --git a/core/tauri-utils/src/platform.rs b/core/tauri-utils/src/platform.rs
index 0ca4fd617966..248c5aa66cee 100644
--- a/core/tauri-utils/src/platform.rs
+++ b/core/tauri-utils/src/platform.rs
@@ -10,6 +10,59 @@ use crate::{Env, PackageInfo};
 
 mod starting_binary;
 
+/// Platform target.
+#[derive(PartialEq, Eq, Copy, Clone)]
+pub enum Target {
+  /// MacOS.
+  Darwin,
+  /// Windows.
+  Windows,
+  /// Linux.
+  Linux,
+  /// Android.
+  Android,
+  /// iOS.
+  Ios,
+}
+
+impl Target {
+  /// Parses the target from the given target triple.
+  pub fn from_triple(target: &str) -> Self {
+    if target.contains("darwin") {
+      Self::Darwin
+    } else if target.contains("windows") {
+      Self::Windows
+    } else if target.contains("android") {
+      Self::Android
+    } else if target.contains("ios") {
+      Self::Ios
+    } else {
+      Self::Linux
+    }
+  }
+
+  /// Gets the current build target.
+  pub fn current() -> Self {
+    if cfg!(target_os = "macos") {
+      Self::Darwin
+    } else if cfg!(target_os = "windows") {
+      Self::Windows
+    } else {
+      Self::Linux
+    }
+  }
+
+  /// Whether the target is mobile or not.
+  pub fn is_mobile(&self) -> bool {
+    matches!(self, Target::Android | Target::Ios)
+  }
+
+  /// Whether the target is desktop or not.
+  pub fn is_desktop(&self) -> bool {
+    !self.is_mobile()
+  }
+}
+
 /// Retrieves the currently running binary's path, taking into account security considerations.
 ///
 /// The path is cached as soon as possible (before even `main` runs) and that value is returned
diff --git a/tooling/cli/src/build.rs b/tooling/cli/src/build.rs
index 74d33d3bf3af..a9a7e4bc3614 100644
--- a/tooling/cli/src/build.rs
+++ b/tooling/cli/src/build.rs
@@ -23,6 +23,7 @@ use std::{
   process::Command,
 };
 use tauri_bundler::bundle::{bundle_project, Bundle, PackageType};
+use tauri_utils::platform::Target;
 
 #[derive(Debug, Clone, Parser)]
 #[clap(about = "Tauri build")]
@@ -65,9 +66,15 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
   options.ci = options.ci || std::env::var("CI").is_ok();
   let ci = options.ci;
 
-  let mut interface = setup(&mut options, false)?;
+  let target = options
+    .target
+    .as_deref()
+    .map(Target::from_triple)
+    .unwrap_or_else(Target::current);
 
-  let config = get_config(options.config.as_deref())?;
+  let mut interface = setup(target, &mut options, false)?;
+
+  let config = get_config(target, options.config.as_deref())?;
   let config_guard = config.lock().unwrap();
   let config_ = config_guard.as_ref().unwrap();
 
@@ -208,11 +215,11 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
   Ok(())
 }
 
-pub fn setup(options: &mut Options, mobile: bool) -> Result<AppInterface> {
+pub fn setup(target: Target, options: &mut Options, mobile: bool) -> Result<AppInterface> {
   let (merge_config, merge_config_path) = resolve_merge_config(&options.config)?;
   options.config = merge_config;
 
-  let config = get_config(options.config.as_deref())?;
+  let config = get_config(target, options.config.as_deref())?;
 
   let tauri_path = tauri_dir();

Leaderboard for this case

easy · 8 of 9 bots fully caught it (89% solve rate) · 89% avg coverage.

#BotResultCaughtCoverageFindingsFalse alarms
1 cursor solved 1/1 100.0% 3 0
2 Drape (Deep Review) solved 1/1 100.0% 4 0
3 Drape (Review) solved 1/1 100.0% 5 0
4 greptile solved 1/1 100.0% 2 0
5 Mjolnir (Opus 5.5) solved 1/1 100.0% 3 0
6 Mjolnir (Sonnet 5.5) solved 1/1 100.0% 4 0
7 qodo solved 1/1 100.0% 4 0
8 Cubic solved 1/1 100.0% 9 2
9 Claude Code (Opus 5.5) miss 0/1 0.0% 6 3

Bot results

Claude Code (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✗ —
valid · impact medium
The change wires TARGET into try_build, context_codegen and the macro's existence check, but `get_config` gets `Target::current()`. That resolves to the host OS, so codegen merges the host's platform config instead of the mobile or cross target's. It can also disagree with tauri-build. The change left this sibling inconsistent, so it counts as introduced. The cited file names are only examples. [grounded: diff] [consensus 3/3: valid=3]
invalid
`get_config` never parses the file passed to the macro. It only reads the parent directory's tauri.conf.json plus a platform file, so the claimed failure, where the passed file fails to resolve or parse under the other target, does not follow from the target mismatch. [invalid: contradiction] [consensus 3/3: invalid=3]
valid · impact low
`Target::current()` is new public API documented as 'Gets the current build target'. It only checks macOS and Windows and falls back to Linux, so on Android or iOS builds it returns Linux. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
Before the change, discovery used the host's platform file names via cfg!. Now it always uses Linux names, so a macOS or Windows folder identified only by its host platform file is no longer detected. This is an edge case. [grounded: diff] [consensus 3/3: valid=3]
invalid
The rename is intentional and recorded as a breaking change. The old mobile names were also effectively dead code: they were chosen through cfg!(target_os) in host-compiled CLI and build tooling, so no existing file that used to be read is now ignored. [invalid: contradiction] [consensus 3/3: invalid=3]
invalid · impact low
Before the change, icon generation also read the host's platform config, because the file names were chosen with cfg! in the host-compiled CLI. Behaviour is the same as before, so the issue is pre-existing. [invalid: introduced=no] [consensus 3/4: invalid=3, valid=1]
raw comments (6)
core/tauri-codegen/src/lib.rs:71
`get_config` hardcodes `Target::current()`. That function only checks `cfg!(target_os)`, so it resolves to the host OS: tauri-codegen runs inside the `generate_context!` proc macro and the tauri-build codegen build script, and both are compiled for the host. Other parts of this change read the real target from `TARGET`/`TAURI_TARGET_TRIPLE` (`try_build`, `context_codegen`, and the `does_supported_file_name_exist` check in tauri-macros). So when building for Android/iOS, or cross-compiling desktop (e.g. Windows from Linux), the embedded context merges the host's platform config (tauri.linux/macos.conf.json) instead of tauri.android/ios/windows.conf.json. That contradicts the stated goal of reading platform-specific config for mobile targets. It also means tauri-build's `try_build`, which uses the TARGET-based config, can disagree with the config embedded by codegen. `get_config` should take the target from `TARGET`/`TAURI_TARGET_TRIPLE` like the other call sites.
core/tauri-macros/src/context.rs:45
The existence check uses the TARGET-derived target, but `get_config` (called below) parses with `Target::current()`. When a custom platform config file is passed to the macro, it can pass the check under one target and then fail to resolve or parse under the other.
core/tauri-utils/src/platform.rs:45
`Target::current()` never returns Android or Ios, even when compiled with target_os android/ios. Instead it falls back to Linux. Any runtime or on-device use of this public API would report the wrong platform. It should check `cfg!(target_os = "android")` and `cfg!(target_os = "ios")` as well.
tooling/cli/src/helpers/app_paths.rs:77
Project discovery is hardcoded to `Target::Linux`. Before this change it used the host's platform file names. Now a folder whose only config file is a platform file for macOS, Windows or mobile (e.g. tauri.macos.conf.json) no longer counts as a Tauri project on macOS or Windows hosts.
core/tauri-utils/src/config/parse.rs:68
The mobile TOML file names changed from `tauri.android.toml`/`tauri.ios.toml` to `Tauri.android.toml`/`Tauri.ios.toml`. On case-sensitive filesystems, existing mobile TOML config files are now silently ignored and nothing warns about it.
tooling/cli/src/icon.rs:366
The Android icon generation path loads the Tauri config with `Target::current()` (desktop) instead of `Target::Android`. Any Android-specific config overrides are therefore ignored in this code.
Cubic · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
invalid
When `--target` is omitted, the platform config was chosen from the host OS before this PR too (via `cfg!` in parse.rs). `Target::current()` keeps that behaviour, so the mismatch with a Cargo-configured target is pre-existing, not new. [invalid: introduced=no] [consensus 5/5: invalid=5]
invalid
Same as finding 0: the host fallback copies the old `cfg!` host detection, so ignoring Cargo's configured target is pre-existing. [invalid: introduced=no] [consensus 5/5: invalid=5]
valid · matches d1 · impact high
valid · impact medium
This PR made tauri-build and `context_codegen` resolve the target from TARGET, but codegen `get_config` still uses the host OS. That is an incomplete change: during Android/iOS builds codegen reads the host's platform config file instead of the mobile one. [grounded: tree core/tauri-codegen/src/lib.rs] [consensus 5/5: valid=5]
valid · impact medium
The macro works out the target from TARGET, but `get_config` then calls `read_from(Target::current(), ...)`, so cross-compiled mobile builds merge the host platform config. The 'or fails' part is overstated, but the wrong config being loaded is real. [grounded: tree core/tauri-macros/src/context.rs] [consensus 5/5: valid=5]
valid · impact low
The new public `Target::current()` has no android/ios cfg branches, unlike the code it replaced, so it returns Linux when compiled for Android or iOS. Current callers run on the host, so the impact is limited. [grounded: tree core/tauri-utils/src/platform.rs] [consensus 5/5: valid=5]
valid · impact low
Previously, host cfg detection on macOS loaded tauri.macos.conf.*; now the macOS branch (macos == true) loads the iOS config. [grounded: diff] [consensus 4/5: valid=4, uncertain=1]
uncertain
Every config load in the iOS flow passes Ios, so a conflicting cached target only arises in a hypothetical multi-command process that is not shown here. [uncertain: no evidence quoted] [consensus 4/5: uncertain=4, invalid=1]
valid · impact low
Before this PR, the lookup recognised the host OS's platform config file names. Hardcoding Linux means macOS and Windows platform files are no longer recognised. The practical impact is small because tauri.conf.json is usually there anyway. [grounded: diff] [consensus 5/5: valid=5]
raw comments (10)
tooling/cli/src/dev.rs:92
<!-- cubic:v=79966af6-a914-4384-87ed-30fbafebbf95 --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":9} --> P1: `tauri dev` ignores a project’s Cargo-configured target when `--target` is omitted: this fallback selects the host platform, while `AppInterface::new` later reads `.cargo/config` and builds the configured target. Resolve the effective Cargo target before loading configuration so platform-specific files match the target actually built. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tooling/cli/src/dev.rs, line 92: <comment>`tauri dev` ignores a project’s Cargo-configured target when `--target` is omitted: this fallback selects the host platform, while `AppInterface::new` later reads `.cargo/config` and builds the configured target. Resolve the effective Cargo target before loading configuration so platform-specific files match the target actually built.</comment> <file context> @@ -84,7 +85,12 @@ pub fn command(options: Options) -> Result<()> { + .target + .as_deref() + .map(Target::from_triple) + .unwrap_or_else(Target::current); + let mut interface = setup(target, &mut options, false)?; let exit_on_panic = options.exit_on_panic; </file context> ``` </details>
tooling/cli/src/build.rs:73
<!-- cubic:v=10b5a044-b389-47f4-933c-8505449b9f46 --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":10} --> P1: `build` ignores Cargo's configured target when `--target` is absent, so it parses the host platform config instead of the platform being built. Resolve the effective target from the same Cargo configuration before calling `get_config`. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tooling/cli/src/build.rs, line 73: <comment>`build` ignores Cargo's configured target when `--target` is absent, so it parses the host platform config instead of the platform being built. Resolve the effective target from the same Cargo configuration before calling `get_config`.</comment> <file context> @@ -65,9 +66,15 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { + .target + .as_deref() + .map(Target::from_triple) + .unwrap_or_else(Target::current); - let config = get_config(options.config.as_deref())?; </file context> ``` </details>
tooling/cli/src/helpers/config.rs:212
<!-- cubic:v=42ee64cd-3245-4d02-afd4-fb02a0c73ba5 --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":9} --> P1: `reload` deadlocks whenever a config is already loaded because `get_internal` tries to lock `config_handle` while this `if let` still holds its mutex guard. Copy the target out while locked, drop the guard, then call `get_internal`. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tooling/cli/src/helpers/config.rs, line 208: <comment>`reload` deadlocks whenever a config is already loaded because `get_internal` tries to lock `config_handle` while this `if let` still holds its mutex guard. Copy the target out while locked, drop the guard, then call `get_internal`.</comment> <file context> @@ -186,17 +192,22 @@ fn get_internal(merge_config: Option<&str>, reload: bool) -> crate::Result<Confi pub fn reload(merge_config: Option<&str>) -> crate::Result<ConfigHandle> { - get_internal(merge_config, true) + if let Some(conf) = &*config_handle().lock().unwrap() { + get_internal(merge_config, true, conf.target) + } else { </file context> ``` </details> ```suggestion let target = config_handle() .lock() .unwrap() .as_ref() .map(|conf| conf.target); if let Some(target) = target { get_internal(merge_config, true, target) } else { Err(anyhow::anyhow!("config not loaded")) } ```
core/tauri-codegen/src/lib.rs:71
<!-- cubic:v=b25dfa84-357b-42e6-b1ef-4f211d4f12cd --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":10} --> P1: `get_config` selects the host OS here, so mobile and cross-compiled builds read the host platform config instead of the actual build target. Resolve the target from `TARGET`/`TAURI_TARGET_TRIPLE` (as `context_codegen` does), with `Target::current()` only as the fallback. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At core/tauri-codegen/src/lib.rs, line 71: <comment>`get_config` selects the host OS here, so mobile and cross-compiled builds read the host platform config instead of the actual build target. Resolve the target from `TARGET`/`TAURI_TARGET_TRIPLE` (as `context_codegen` does), with `Target::current()` only as the fallback.</comment> <file context> @@ -67,7 +67,10 @@ pub fn get_config(path: &Path) -> Result<(Config, PathBuf), CodegenConfigError> // project than the target crate. - let mut config = serde_json::from_value(tauri_utils::config::parse::read_from(parent.clone())?)?; + let mut config = serde_json::from_value(tauri_utils::config::parse::read_from( + tauri_utils::platform::Target::current(), + parent.clone(), + )?)?; </file context> ``` </details> ```suggestion std::env::var("TARGET") .or_else(|_| std::env::var("TAURI_TARGET_TRIPLE")) .as_deref() .map(tauri_utils::platform::Target::from_triple) .unwrap_or_else(|_| tauri_utils::platform::Target::current()), ```
core/tauri-macros/src/context.rs:45
<!-- cubic:v=76fac0db-5574-4fe0-8b1c-ce4a1138169a --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":10} --> P1: `generate_context` validates the config with `target` here but then reloads it through `read_from(Target::current(), ...)`; cross-compiling to Android or iOS therefore loads the host config or fails. Pass the resolved target through `get_config` and use it for the final load. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At core/tauri-macros/src/context.rs, line 45: <comment>`generate_context` validates the config with `target` here but then reloads it through `read_from(Target::current(), ...)`; cross-compiling to Android or iOS therefore loads the host config or fails. Pass the resolved target through `get_config` and use it for the final load.</comment> <file context> @@ -36,7 +42,7 @@ impl Parse for ContextItems { }) .and_then(|path| { - if does_supported_file_name_exist(&path) { + if does_supported_file_name_exist(target, &path) { Ok(path) } else { </file context> ``` </details>
core/tauri-utils/src/platform.rs:39
<!-- cubic:v=49d4a2bb-aa77-479d-9b51-1181b0627555 --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":10} --> P1: `Target::current()` classifies Android and iOS builds as Linux, causing callers that rely on this fallback to select `tauri.linux.*` instead of the mobile platform config. Add explicit `android` and `ios` checks before the Linux fallback. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At core/tauri-utils/src/platform.rs, line 39: <comment>`Target::current()` classifies Android and iOS builds as Linux, causing callers that rely on this fallback to select `tauri.linux.*` instead of the mobile platform config. Add explicit `android` and `ios` checks before the Linux fallback.</comment> <file context> @@ -10,6 +10,59 @@ use crate::{Env, PackageInfo}; + Self::Android + } else if target.contains("ios") { + Self::Ios + } else { + Self::Linux + } </file context> ``` </details>
tooling/cli/src/mobile/ios/xcode_script.rs:71
<!-- cubic:v=028cee30-1f84-486a-9b26-da794e950079 --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":9} --> P2: The macOS Xcode path still loads the iOS platform config. Pass `Target::Darwin` when `macos` is true, otherwise `Target::Ios`, so macOS builds apply their platform-specific overrides. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tooling/cli/src/mobile/ios/xcode_script.rs, line 71: <comment>The macOS Xcode path still loads the iOS platform config. Pass `Target::Darwin` when `macos` is true, otherwise `Target::Ios`, so macOS builds apply their platform-specific overrides.</comment> <file context> @@ -68,7 +68,7 @@ pub fn command(options: Options) -> Result<()> { let macos = macos_from_platform(&options.platform); - let tauri_config = get_tauri_config(None)?; + let tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, None)?; let (config, metadata, cli_options) = { </file context> ``` </details> ```suggestion let tauri_config = get_tauri_config( if macos { tauri_utils::platform::Target::Darwin } else { tauri_utils::platform::Target::Ios }, None, )?; ```
tooling/cli/src/mobile/ios/build.rs:82
<!-- cubic:v=d2263a58-6b6f-4c21-b5aa-b75160ff287d --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":9} --> P2: `get_tauri_config` can return a cached config parsed for a different target because the cache ignores `ConfigMetadata.target`. Repeated CLI or Node invocations can therefore make this iOS build ignore `tauri.ios.conf.*`; make cache reuse target-aware. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tooling/cli/src/mobile/ios/build.rs, line 82: <comment>`get_tauri_config` can return a cached config parsed for a different target because the cache ignores `ConfigMetadata.target`. Repeated CLI or Node invocations can therefore make this iOS build ignore `tauri.ios.conf.*`; make cache reuse target-aware.</comment> <file context> @@ -78,7 +78,10 @@ pub fn command(mut options: Options, noise_level: NoiseLevel) -> Result<()> { - let tauri_config = get_tauri_config(options.config.as_deref())?; + let tauri_config = get_tauri_config( + tauri_utils::platform::Target::Ios, + options.config.as_deref(), + )?; </file context> ``` </details>
tooling/cli/src/helpers/app_paths.rs:77
<!-- cubic:v=5a95cd63-5b27-4cd3-bc0d-246d2165fd5a --> <!-- cubic:review-run=f99b1be1-734a-5f19-aa86-52d00796564b --> <!-- metadata:{"confidence":8} --> P2: `get_tauri_dir()` hardcodes `Target::Linux` for the project-root lookup, but this function is host-agnostic and never knows the build target. Before this PR the platform check used `cfg!` host detection, so on macOS/Windows hosts `tauri.macos.conf.json5` / `tauri.windows.conf.json5` were recognized; now only `tauri.linux.conf.json5` matches, and Android/iOS platform names are never matched either. Use `Target::current()` here to preserve the previous host-OS semantics, matching the other host-side callers in `icon.rs` and `info/app.rs`. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tooling/cli/src/helpers/app_paths.rs, line 77: <comment>`get_tauri_dir()` hardcodes `Target::Linux` for the project-root lookup, but this function is host-agnostic and never knows the build target. Before this PR the platform check used `cfg!` host detection, so on macOS/Windows hosts `tauri.macos.conf.json5` / `tauri.windows.conf.json5` were recognized; now only `tauri.linux.conf.json5` matches, and Android/iOS platform names are never matched either. Use `Target::current()` here to preserve the previous host-OS semantics, matching the other host-side callers in `icon.rs` and `info/app.rs`.</comment> <file context> @@ -73,7 +74,7 @@ fn get_tauri_dir() -> PathBuf { } - lookup(&cwd, |path| folder_has_configuration_file(path) || is_configuration_file(path)) + lookup(&cwd, |path| folder_has_configuration_file(Target::Linux, path) || is_configuration_file(Target::Linux, path)) .map(|p| if p.is_dir() { p } else { p.parent().unwrap().to_path_buf() }) .unwrap_or_else(|| </file context> ``` </details> ```suggestion lookup(&cwd, |path| folder_has_configuration_file(Target::current(), path) || is_configuration_file(Target::current(), path)) ```
PR-level
<!-- cubic:review-summary:start --> **9 issues found** across 27 files <!-- cubic:review-summary:end --> <details> <summary>Prompt for AI agents (unresolved issues)</summary> ```text Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately. <file name="tooling/cli/src/mobile/ios/xcode_script.rs"> <violation number="1" location="tooling/cli/src/mobile/ios/xcode_script.rs:71"> P2: The macOS Xcode path still loads the iOS platform config. Pass `Target::Darwin` when `macos` is true, otherwise `Target::Ios`, so macOS builds apply their platform-specific overrides.</violation> </file> <file name="tooling/cli/src/dev.rs"> <violation number="1" location="tooling/cli/src/dev.rs:92"> P1: `tauri dev` ignores a project’s Cargo-configured target when `--target` is omitted: this fallback selects the host platform, while `AppInterface::new` later reads `.cargo/config` and builds the configured target. Resolve the effective Cargo target before loading configuration so platform-specific files match the target actually built.</violation> </file> <file name="tooling/cli/src/build.rs"> <violation number="1" location="tooling/cli/src/build.rs:73"> P1: `build` ignores Cargo's configured target when `--target` is absent, so it parses the host platform config instead of the platform being built. Resolve the effective target from the same Cargo configuration before calling `get_config`.</violation> </file> <file name="tooling/cli/src/mobile/ios/build.rs"> <violation number="1" location="tooling/cli/src/mobile/ios/build.rs:82"> P2: `get_tauri_config` can return a cached config parsed for a different target because the cache ignores `ConfigMetadata.target`. Repeated CLI or Node invocations can therefore make this iOS build ignore `tauri.ios.conf.*`; make cache reuse target-aware.</violation> </file> <file name="tooling/cli/src/helpers/config.rs"> <violation number="1" location="tooling/cli/src/helpers/config.rs:208"> P1: `reload` deadlocks whenever a config is already loaded because `get_internal` tries to lock `config_handle` while this `if let` still holds its mutex guard. Copy the target out while locked, drop the guard, then call `get_internal`.</violation> </file> <file name="core/tauri-codegen/src/lib.rs"> <violation number="1" location="core/tauri-codegen/src/lib.rs:71"> P1: `get_config` selects the host OS here, so mobile and cross-compiled builds read the host platform config instead of the actual build target. Resolve the target from `TARGET`/`TAURI_TARGET_TRIPLE` (as `context_codegen` does), with `Target::current()` only as the fallback.</violation> </file> <file name="tooling/cli/src/helpers/app_paths.rs"> <violation number="1" location="tooling/cli/src/helpers/app_paths.rs:77"> P2: `get_tauri_dir()` hardcodes `Target::Linux` for the project-root lookup, but this function is host-agnostic and never knows the build target. Before this PR the platform check used `cfg!` host detection, so on macOS/Windows hosts `tauri.macos.conf.json5` / `tauri.windows.conf.json5` were recognized; now only `tauri.linux.conf.json5` matches, and Android/iOS platform names are never matched either. Use `Target::current()` here to preserve the previous host-OS semantics, matching the other host-side callers in `icon.rs` and `info/app.rs`.</violation> </file> <file name="core/tauri-macros/src/context.rs"> <violation number="1" location="core/tauri-macros/src/context.rs:45"> P1: `generate_context` validates the config with `target` here but then reloads it through `read_from(Target::current(), ...)`; cross-compiling to Android or iOS therefore loads the host config or fails. Pass the resolved target through `get_config` and use it for the final load.</violation> </file> <file name="core/tauri-utils/src/platform.rs"> <violation number="1" location="core/tauri-utils/src/platform.rs:39"> P1: `Target::current()` classifies Android and iOS builds as Linux, causing callers that rely on this fallback to select `tauri.linux.*` instead of the mobile platform config. Add explicit `android` and `ios` checks before the Linux fallback.</violation> </file> ``` </details> <sub>Reply with feedback, questions, or to request a fix.<br /><br />[View guided diff](https://www.cubic.dev/pr/drape-io/crbench-cubic-2026-09/pull/118?utm_source=github&utm_medium=review_footer) | [Turn on auto-fix](https://www.cubic.dev/action/auto-fix/pr/drape-io/crbench-cubic-2026-09/118?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F118) | [Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/drape-io/crbench-cubic-2026-09/118/ai_pr_review_github_delivery_5d3030d9e316704b577deb13a7e97465925ae6055069762626fcb96db18d8e24?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F118)</sub> <!-- cubic:review-post:ai_pr_review_github_delivery_5d3030d9e316704b577deb13a7e97465925ae6055069762626fcb96db18d8e24:8d36b4a094e1e90bf6818c5855b5c097f8677d38:f99b1be1-734a-5f19-aa86-52d00796564b -->
cursor · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact medium
The change makes tauri-build, context_codegen and the macro work out the target from TARGET, but leaves codegen's get_config on Target::current(), which is the host. An Android/iOS or cross build therefore embeds the host's platform overlay, which defeats the stated fix. This counts as an incomplete change. [grounded: diff] [consensus 5/5: valid=5]
valid · impact low
The old codegen fallback and the old parse.rs cfg logic both handled android/ios. The new Target::current() maps everything other than macOS and Windows to Linux, so code compiled for a mobile target that falls back to current() now picks the Linux overlay. Since codegen usually runs on the host, this is rarely hit. [grounded: tree core/tauri-utils/src/platform.rs] [consensus 5/5: valid=5]
raw comments (4)
tooling/cli/src/helpers/config.rs:212
### Config reload deadlocks on mutex **High Severity** <!-- DESCRIPTION START --> `reload` keeps the `config_handle` mutex locked for the whole `if let` body while `get_internal` tries to lock that same `std::sync::Mutex` again. This process hangs or panics on `tauri android/ios dev` when `devPath` is localhost, and on `tauri dev` whenever a config file change triggers a reload. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 1f5a2e14-766f-4d93-9211-8155d58afd9b --> <!-- LOCATIONS START tooling/cli/src/helpers/config.rs#L206-L213 tooling/cli/src/mobile/mod.rs#L188-L189 tooling/cli/src/interface/rust.rs#L513-L514 LOCATIONS END --> <details> <summary>Additional Locations (2)</summary> - [`tooling/cli/src/mobile/mod.rs#L188-L189`](https://github.com/drape-io/crbench-cursor-2026-09/blob/a244166544f808f75c6d44a71718cb1ae091b131/tooling/cli/src/mobile/mod.rs#L188-L189) - [`tooling/cli/src/interface/rust.rs#L513-L514`](https://github.com/drape-io/crbench-cursor-2026-09/blob/a244166544f808f75c6d44a71718cb1ae091b131/tooling/cli/src/interface/rust.rs#L513-L514) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmU2ZDMyZWRmLTNjMTYtNDM2MS1hMTVmLWI2ZmQ3OTc5NTY5NyIsImVuY3J5cHRpb25LZXkiOiJTU3hMLXFGMDFkUE5WcHpjS3RzRlZiLXRpekt3eWl6MVFjNm5kMTNBZDN3IiwiYnJhbmNoIjoicHItYTE2NWFhOGFjMyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmU2ZDMyZWRmLTNjMTYtNDM2MS1hMTVmLWI2ZmQ3OTc5NTY5NyIsImVuY3J5cHRpb25LZXkiOiJTU3hMLXFGMDFkUE5WcHpjS3RzRlZiLXRpekt3eWl6MVFjNm5kMTNBZDN3IiwiYnJhbmNoIjoicHItYTE2NWFhOGFjMyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjExOCwiY29tbWl0U2hhIjoiYTI0NDE2NjU0NGY4MDhmNzVjNmQ0NGE3MTcxOGNiMWFlMDkxYjEzMSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a244166544f808f75c6d44a71718cb1ae091b131. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
core/tauri-codegen/src/lib.rs:72
### Codegen loads host platform config **High Severity** <!-- DESCRIPTION START --> `get_config` always calls `read_from` with `Target::current()`, so `generate_context!` merges the host overlay instead of the cargo build target. Cross-compiling or building Android/iOS from a desktop host embeds the wrong platform settings in the app, even though `context_codegen` and `tauri-build` already resolve the target from `TARGET`. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 64f5d5ed-504f-4227-a759-42b5b17f3713 --> <!-- LOCATIONS START core/tauri-codegen/src/lib.rs#L69-L72 core/tauri-macros/src/context.rs#L22-L27 core/tauri-codegen/src/context.rs#L124-L129 LOCATIONS END --> <details> <summary>Additional Locations (2)</summary> - [`core/tauri-macros/src/context.rs#L22-L27`](https://github.com/drape-io/crbench-cursor-2026-09/blob/a244166544f808f75c6d44a71718cb1ae091b131/core/tauri-macros/src/context.rs#L22-L27) - [`core/tauri-codegen/src/context.rs#L124-L129`](https://github.com/drape-io/crbench-cursor-2026-09/blob/a244166544f808f75c6d44a71718cb1ae091b131/core/tauri-codegen/src/context.rs#L124-L129) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmNhY2M3YWE2LTQ4MDItNGE4ZS1hMTZkLTk2ZWU3N2EzZmJkYiIsImVuY3J5cHRpb25LZXkiOiJQN0dpOUlEN0xNWHk4R3VFWlJudDN1Q2pRU3FpaXZtbjhzX202VXc4eFBZIiwiYnJhbmNoIjoicHItYTE2NWFhOGFjMyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmNhY2M3YWE2LTQ4MDItNGE4ZS1hMTZkLTk2ZWU3N2EzZmJkYiIsImVuY3J5cHRpb25LZXkiOiJQN0dpOUlEN0xNWHk4R3VFWlJudDN1Q2pRU3FpaXZtbjhzX202VXc4eFBZIiwiYnJhbmNoIjoicHItYTE2NWFhOGFjMyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjExOCwiY29tbWl0U2hhIjoiYTI0NDE2NjU0NGY4MDhmNzVjNmQ0NGE3MTcxOGNiMWFlMDkxYjEzMSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a244166544f808f75c6d44a71718cb1ae091b131. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
core/tauri-utils/src/platform.rs:52
### Current target misses mobile platforms **Medium Severity** <!-- DESCRIPTION START --> `Target::current` only distinguishes macOS and Windows and otherwise returns `Linux`, so Android and iOS hosts are classified as Linux. The previous codegen fallback handled both mobile `cfg` values. Any caller that relies on `current()` as a fallback, including `get_config`, will look up the Linux overlay on those platforms. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 585ebc41-8fe3-4584-9441-6518ead04e8f --> <!-- LOCATIONS START core/tauri-utils/src/platform.rs#L44-L52 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFkYTNhZDU3LTkxZjktNDExYi04N2UyLTlkYTJlNDFkYWNhYiIsImVuY3J5cHRpb25LZXkiOiJjWV9QLUlMRTJ2eGJEWVBKSGdUeDJuQ0FQbnJSazZfTDkxNnZJNEkxRldrIiwiYnJhbmNoIjoicHItYTE2NWFhOGFjMyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFkYTNhZDU3LTkxZjktNDExYi04N2UyLTlkYTJlNDFkYWNhYiIsImVuY3J5cHRpb25LZXkiOiJjWV9QLUlMRTJ2eGJEWVBKSGdUeDJuQ0FQbnJSazZfTDkxNnZJNEkxRldrIiwiYnJhbmNoIjoicHItYTE2NWFhOGFjMyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjExOCwiY29tbWl0U2hhIjoiYTI0NDE2NjU0NGY4MDhmNzVjNmQ0NGE3MTcxOGNiMWFlMDkxYjEzMSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a244166544f808f75c6d44a71718cb1ae091b131. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PR-level
<!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues. <!-- BUGBOT_FIX_ALL --> <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTozYjdiZWYwNy0xNmNhLTQ2YWMtYWJhNS01NjRlMzgxNTQ2N2MiLCJlbmNyeXB0aW9uS2V5IjoiRzZ3M0lDNzVuTzZVVG1PUTJsekVXTTBycWMtTGxsVjhBalRqdUtfdHBKcyIsImJyYW5jaCI6InByLWExNjVhYThhYzMiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <!-- /BUGBOT_FIX_ALL --> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).</sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a244166544f808f75c6d44a71718cb1ae091b131. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Drape (Deep Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · impact medium
The change threads a target through read_from and makes tauri-build use TARGET, but codegen's get_config hardcodes the host target. The macro computes the real target and never passes it, so cross-compiling (e.g. Android from macOS) merges the host platform config. This is an incomplete change. [grounded: tree core/tauri-codegen/src/lib.rs] [consensus 3/3: valid=3]
valid · impact low
The config target falls back to the host. RustAppSettings (also changed here) resolves the triple from cargo config build.target, so the loaded platform config can disagree with the actual build target and with the watcher's is_configuration_file target. [grounded: tree tooling/cli/src/build.rs] [consensus 3/5: valid=3, invalid=2]
valid · impact low
The new Target::current() has no android/ios cfg branches, while the replaced codegen and parse code mapped those OSes. In practice, callers run on the host (CLI and build scripts), so the impact is small, but the public API misreports when called on a mobile OS. [grounded: tree core/tauri-utils/src/platform.rs] [consensus 3/3: valid=3]
valid · matches d1 · impact high
raw comments (4)
core/tauri-codegen/src/lib.rs:71
**Codegen reads host platform config, not target's** `get_config` always uses `Target::current()` (the host), while tauri-build now uses `TARGET`. Cross-compiling (e.g. `tauri android dev` on macOS), `generate_context!` merges `tauri.macos.conf.json` instead of `tauri.android.conf.json`. Resolve the target from `TARGET`/`TAURI_TARGET_TRIPLE`, as the macro already does, and pass it into `get_config`. ``` core/tauri-codegen/src/lib.rs:70 let mut config = serde_json::from_value(tauri_utils::config::parse::read_from( core/tauri-codegen/src/lib.rs:71 tauri_utils::platform::Target::current(), core/tauri-codegen/src/lib.rs:72 parent.clone(), core/tauri-codegen/src/lib.rs:73 )?)?; core/tauri-build/src/lib.rs:296 let mut config = serde_json::from_value(tauri_utils::config::parse::read_from( core/tauri-build/src/lib.rs:297 tauri_utils::platform::Target::from_triple(&std::env::var("TARGET").unwrap()), core/tauri-build/src/lib.rs:298 std::env::current_dir().unwrap(), core/tauri-build/src/lib.rs:299 )?)?; core/tauri-build/src/codegen/context.rs:95 let (config, config_parent) = tauri_codegen::get_config(&self.config_path)?; tooling/cli/src/helpers/config.rs:147 if let Some(merge_config) = merge_config { ```
tooling/cli/src/build.rs:69
**Config target ignores cargo config build.target** The config target comes only from `--target` or the host, but `RustAppSettings` also honors `.cargo/config` `build.target`. With a cargo-configured cross target, the CLI loads the host's platform config. Derive the config target from the same resolved triple `RustAppSettings` uses. ``` tooling/cli/src/build.rs:69 let target = options tooling/cli/src/build.rs:70 .target tooling/cli/src/build.rs:71 .as_deref() tooling/cli/src/build.rs:72 .map(Target::from_triple) tooling/cli/src/interface/rust.rs:938 let target_triple = target.unwrap_or_else(|| { tooling/cli/src/interface/rust.rs:939 cargo_config tooling/cli/src/interface/rust.rs:940 .build() tooling/cli/src/interface/rust.rs:941 .target() tooling/cli/src/interface/rust.rs:942 .map(|t| t.to_string()) tooling/cli/src/interface/rust.rs:943 .unwrap_or_else(|| { ```
core/tauri-utils/src/platform.rs:45
**`Target::current()` reports Linux on Android/iOS** The new `current` only checks macos and windows and treats everything else as Linux. The code it replaces mapped `target_os = "android"`/`"ios"` to the mobile targets, so the codegen fallback and any caller running on a mobile OS now get Linux. Add `cfg!(target_os = "android")` and `cfg!(target_os = "ios")` branches. ``` core/tauri-utils/src/platform.rs:44 /// Gets the current build target. core/tauri-utils/src/platform.rs:45 pub fn current() -> Self { core/tauri-utils/src/platform.rs:46 if cfg!(target_os = "macos") { core/tauri-utils/src/platform.rs:47 Self::Darwin core/tauri-codegen/src/context.rs:160 (base) Target::Linux core/tauri-codegen/src/context.rs:161 (base) } else if cfg!(windows) { core/tauri-codegen/src/context.rs:162 (base) Target::Windows core/tauri-codegen/src/context.rs:163 (base) } else if cfg!(target_os = "macos") { core/tauri-codegen/src/context.rs:164 (base) Target::Darwin core/tauri-codegen/src/context.rs:165 (base) } else if cfg!(target_os = "android") { ```
tooling/cli/src/helpers/config.rs:208
**Config reload deadlocks the dev watcher** `reload` keeps the mutex locked through the whole `if let` block. Then `get_internal` locks it again to store the new config, and a std `Mutex` hangs when one thread locks it twice. Copy `target` out and drop the guard before calling `get_internal`. ``` tooling/cli/src/helpers/config.rs:207 pub fn reload(merge_config: Option<&str>) -> crate::Result<ConfigHandle> { tooling/cli/src/helpers/config.rs:208 if let Some(conf) = &*config_handle().lock().unwrap() { tooling/cli/src/helpers/config.rs:209 get_internal(merge_config, true, conf.target) tooling/cli/src/helpers/config.rs:210 } else { tooling/cli/src/helpers/config.rs:116 fn config_handle() -> &'static ConfigHandle { tooling/cli/src/helpers/config.rs:117 static CONFING_HANDLE: Lazy<ConfigHandle> = Lazy::new(Default::default); tooling/cli/src/helpers/config.rs:118 &CONFING_HANDLE tooling/cli/src/helpers/config.rs:119 } tooling/cli/src/helpers/config.rs:194 *config_handle().lock().unwrap() = Some(ConfigMetadata { tooling/cli/src/helpers/config.rs:195 target, ```
Drape (Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact medium
tauri-build now uses TARGET when it reads the config, but codegen's get_config always uses the host. When cross-compiling for Android or iOS, the macro/codegen path therefore merges the host's platform config instead of the mobile one. The change made tauri-build target-aware and left codegen's get_config on the host, so it only did half the job. [grounded: tree core/tauri-codegen/src/lib.rs] [consensus 3/3: valid=3]
valid · impact low
Before the change, the lookup used the host-specific platform file name. Now it always looks for the Linux name, so on macOS or Windows a directory identified only by its platform config is no longer recognized. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
The config is loaded for the --target value or the host. RustAppSettings (also changed in this PR) falls back to cargo's build.target, so the target used to load the config and the target the file watcher checks can differ. The config read itself is no worse than before, so the impact is small. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
The new public Target::current() is documented as returning the current build target. Unlike the code it replaced, it returns Linux on Android and iOS. In practice this mostly matters when tauri-utils is compiled for a mobile target. [grounded: tree core/tauri-utils/src/platform.rs] [consensus 3/3: valid=3]
raw comments (5)
tooling/cli/src/helpers/config.rs:208
**Config reload deadlocks while holding the lock** `reload` keeps the mutex guard from `config_handle().lock()` alive for the whole `if let` body. `get_internal` then locks the same mutex again at the end to store the new config, and the second lock never returns. Copy `conf.target` into a local and drop the guard before calling `get_internal`. ``` tooling/cli/src/helpers/config.rs:207 pub fn reload(merge_config: Option<&str>) -> crate::Result<ConfigHandle> { tooling/cli/src/helpers/config.rs:208 if let Some(conf) = &*config_handle().lock().unwrap() { tooling/cli/src/helpers/config.rs:209 get_internal(merge_config, true, conf.target) tooling/cli/src/helpers/config.rs:210 } else { ```
core/tauri-codegen/src/lib.rs:70
**get_config ignores target triple env** `get_config` reads the platform config using `Target::current()`, the host OS. The macro and `context_codegen` derive the target from `TARGET` or `TAURI_TARGET_TRIPLE`. Derive the target from `TARGET`/`TAURI_TARGET_TRIPLE` in `get_config` the same way the macro does, and pass it in. ``` core/tauri-codegen/src/lib.rs:70 let mut config = serde_json::from_value(tauri_utils::config::parse::read_from( core/tauri-codegen/src/lib.rs:71 tauri_utils::platform::Target::current(), core/tauri-codegen/src/lib.rs:72 parent.clone(), core/tauri-codegen/src/lib.rs:73 )?)?; ```
tooling/cli/src/helpers/app_paths.rs:77
**Tauri dir lookup only matches Linux platform config** `get_tauri_dir` passes `Target::Linux` to `folder_has_configuration_file` and `is_configuration_file`. Platform-specific file names are therefore matched only for Linux, not for the host OS as before. Use `Target::current()`. ``` tooling/cli/src/helpers/app_paths.rs:77 lookup(&cwd, |path| folder_has_configuration_file(Target::Linux, path) || is_configuration_file(Target::Linux, path)) ```
tooling/cli/src/build.rs:69
**CLI config target ignores cargo build.target** The CLI picks the config target from `--target` or the host. `RustAppSettings` picks its target from `--target`, then `.cargo/config` `build.target`, then the host. Resolve the target triple, including cargo config, before loading the config. ``` tooling/cli/src/build.rs:69 let target = options tooling/cli/src/build.rs:70 .target tooling/cli/src/build.rs:71 .as_deref() tooling/cli/src/build.rs:72 .map(Target::from_triple) ```
core/tauri-utils/src/platform.rs:47
**Target::current never returns Android or iOS** `Target::current` only checks macos and windows and falls back to Linux. The code it replaced in `context_codegen` also handled android and ios. Add android and ios branches to `Target::current`. ``` core/tauri-utils/src/platform.rs:42 } core/tauri-utils/src/platform.rs:44 /// Gets the current build target. core/tauri-utils/src/platform.rs:45 pub fn current() -> Self { core/tauri-utils/src/platform.rs:46 if cfg!(target_os = "macos") { ```
greptile · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact medium
The PR makes tauri-build, context_codegen and the macro's file-existence check resolve the target from TARGET/TAURI_TARGET_TRIPLE. get_config passes Target::current() instead, and that never returns Android or Ios. So generate_context! reads the host's platform config rather than the mobile one. This is an incomplete change that leaves a peer path inconsistent. [grounded: tree core/tauri-codegen/src/lib.rs] [consensus 3/3: valid=3]
raw comments (3)
tooling/cli/src/helpers/config.rs:209
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Dev startup hangs** `reload` holds the config mutex while calling `get_internal`, which locks the same mutex again when saving the config. Normal `tauri dev` startup calls `reload_config` unless `--no-dev-server` is set, so it hangs before launching the app. Mobile localhost setup and config-file changes hit the same problem. Copy `conf.target` inside a separate scope so the lock is released before calling `get_internal`.
core/tauri-codegen/src/lib.rs:73
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Mobile overrides are ignored** The mobile config fix stops before `get_config`: this read still uses `Target::current()`, which selects the desktop host during cross-compilation. The CLI and `tauri-build` now read the mobile file, but `generate_context!` still reads the host file. `TAURI_CONFIG` carries only the explicit config extension, not the merged mobile file. With no `--config`, mobile `devPath` or `distDir` overrides are ignored when generating the app context. If the base asset directory does not exist, compilation fails. Resolve `TARGET`/`TAURI_TARGET_TRIPLE` here too, as `context_codegen` already does.
PR-level
<!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=76825680"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a>Confidence Score: 3/5</h2> **[High risk]** Refactors platform target handling across build and config systems\. Fix the dev startup hang and finish mobile config loading before merging. <h2>Findings</h2> 1. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top">&nbsp;**Dev startup hangs** <a href="https://github.com/drape-io/crbench-greptile-2026-09/pull/118#discussion_r4214146050">▶</a> 2. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top">&nbsp;**Mobile overrides are ignored** <a href="https://github.com/drape-io/crbench-greptile-2026-09/pull/118#discussion_r4214146061">▶</a> <h3>Summary</h3> The PR passes explicit platform targets into config parsing, updates mobile config filenames, and shares `Target` across build and code generation. - `reload` now locks the same mutex twice, blocking normal dev startup. - Mobile config loading remains incomplete because `get_config` still selects the host platform. <details open><summary>Diagram</summary> ```mermaid %%{init: {'theme': 'neutral'}}%% flowchart TD T[Requested mobile target] --> CLI[CLI reads mobile config] T --> BUILD[tauri-build reads mobile config] HOST[Desktop host] --> CODEGEN[get_config reads host config] CODEGEN --> MACRO[generate_context uses wrong asset paths] DEV[Dev startup] --> RELOAD[reload holds config lock] RELOAD --> SAVE[get_internal tries the same lock] SAVE --> HANG[Startup hangs] ``` </details> <!-- greptile_confidence_score:3 --> <sub>Reviews (1) · Last reviewed commit: ["Update .changes/cli-config-target-mobile..."](https://github.com/drape-io/crbench-greptile-2026-09/commit/9f4cc337d1976a867dc1d9ff1fb3ffcbf7a5e9ee) · [Reviewed by Greptile](https://www.greptile.com/?utm_source=greptile_expert&utm_medium=github&utm_campaign=code_reviews&utm_content=drape-io/crbench-greptile-2026-09)</sub>
Mjolnir (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact medium
The change makes tauri-build read the platform config for the `TARGET` triple, but codegen's `get_config` was given `Target::current()`, which can only return Darwin, Windows or Linux. When cross-compiling for mobile, the embedded context merges the host's desktop config while tauri-build merges the mobile one. This is an incomplete change across two code paths that should match. The citation check flags the config file names only because they are file names mentioned in the comment, not repository files. [grounded: diff] [consensus 3/3: valid=3]
valid · impact medium
Same issue as finding 1. `get_config`, which both `generate_context!` and `CodegenContext` use, passes the host target. `ContextItems::parse` and `context_codegen` resolve `TARGET`/`TAURI_TARGET_TRIPLE` and tauri-build uses `TARGET`, so mobile config files are skipped only in the embedded config. [grounded: diff] [consensus 3/3: valid=3]
raw comments (3)
tooling/cli/src/helpers/config.rs:636
[P1] `reload` deadlocks because it calls `get_internal` while still holding the config mutex In Rust 2021, the guard produced by `config_handle().lock().unwrap()` in the `if let` condition stays alive until the end of the whole `if let`/`else` statement. `get_internal(merge_config, true, conf.target)` therefore runs while the lock is held. With `reload = true` it skips the early `lock()` check, but it then runs `*config_handle().lock().unwrap() = Some(...)` on the same non-reentrant `std::sync::Mutex`. That second lock on the same thread deadlocks or panics. Every reload path hits this: the config-file watcher in `interface/rust.rs`, the built-in dev server path in `dev.rs::setup`, and `mobile::setup_dev_config`, which `tauri android dev` and `tauri ios dev` always go through. Those commands will hang. Copy `target` out and drop the guard before calling `get_internal`.
core/tauri-codegen/src/lib.rs:136
[P2] `get_config` in codegen still merges the host platform's config file instead of the build target's `get_config` passes `Target::current()` to `read_from`. In a proc macro, `Target::current()` is the host OS. When building for Android or iOS from macOS, `generate_context!` therefore merges `tauri.macos.conf.json` and never reads `tauri.android.conf.json` or `tauri.ios.conf.json`. Other code in this same change already resolves the real target: `tauri-build` uses `TARGET`, and `context_codegen` and the macro's `ContextItems::parse` read `TARGET`/`TAURI_TARGET_TRIPLE`, which `tauri-build` exports through `cargo:rustc-env`. So the embedded runtime config ends up out of sync with the config `tauri-build` used. This goes against the stated goal of reading platform-specific config files for mobile targets. `get_config` should use the same `TARGET`/`TAURI_TARGET_TRIPLE` resolution, for example by taking the target as a parameter.
core/tauri-codegen/src/lib.rs:70
[P2] `get_config` ignores the build target and merges the host's platform config instead This change makes `tauri-build`'s `try_build` and `context_codegen` work out the target from `TARGET`/`TAURI_TARGET_TRIPLE`, but `tauri_codegen::get_config` still calls `read_from(Target::current(), …)`. `Target::current()` only returns the host desktop OS. `get_config` is the function that loads the `Config` embedded by `generate_context!` (tauri-macros/src/context.rs:79) and by `tauri_build::CodegenContext` (tauri-build/src/codegen/context.rs:95). So when you cross-compile, for example an Android or iOS build on a macOS host, the embedded context merges `tauri.macos.conf.json` and skips `tauri.android.conf.json`/`tauri.ios.conf.json`. Meanwhile `tauri-build` reads the mobile file, so the two disagree. The macro even computes the correct `target` for `does_supported_file_name_exist` and then doesn't pass it on. That defeats the stated goal of reading platform-specific config files for mobile targets in the runtime context. `get_config` should get its target the same way: from the `TARGET`/`TAURI_TARGET_TRIPLE` env vars, or as a parameter.
Mjolnir (Sonnet 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact medium
This PR makes tauri-build, the macro and context_codegen resolve the target from TARGET/TAURI_TARGET_TRIPLE, but codegen's get_config still uses Target::current(), which only ever returns Darwin, Windows or Linux. Mobile builds therefore merge the host's platform config, not the mobile one. The citation-check misses are config file name strings, not repository paths. Because the PR updated sibling readers and left this one behind, it counts as an incomplete change. [grounded: diff] [consensus 3/3: valid=3]
valid · impact high
In an if-let scrutinee, the MutexGuard temporary lives for the whole if-let body. With reload=true, get_internal skips the first lock (the `!reload &&` check short-circuits) but then runs `*config_handle().lock().unwrap() = ...` on the same std Mutex while the guard is still held. The result is a deadlock or panic on every config reload. [grounded: diff] [consensus 3/3: valid=3]
valid · impact medium
Same issue as finding 1: get_config uses the host target, while tauri-build reads the config for TARGET. On mobile builds the embedded config leaves out the Android/iOS overrides. The PR updated the parallel readers but not this one. [grounded: diff] [consensus 3/3: valid=3]
raw comments (4)
tooling/cli/src/helpers/config.rs:208
[P1] Config reload deadlocks on the mutex it already holds In `reload`, the `MutexGuard` from `config_handle().lock().unwrap()` is a temporary in the `if let` scrutinee. On edition 2021 it stays alive for the whole `if let` body, including the `get_internal(...)` call. `get_internal` with `reload = true` ends by running `*config_handle().lock().unwrap() = Some(...)`. `std::sync::Mutex` isn't reentrant, so this second lock deadlocks (or panics). `reload` is called from the dev watcher in `interface/rust.rs` whenever a Tauri config file changes, so `tauri dev` hangs on any config edit. Copy `conf.target` into a local and drop the guard before calling `get_internal`.
core/tauri-codegen/src/lib.rs:70
[P2] Codegen reads the host platform config while the macro validates the target's config `get_config` hard-codes `Target::current()`, which only distinguishes macOS, Windows and Linux (the host). `tauri-macros` and `context_codegen` now derive the target from `TARGET` / `TAURI_TARGET_TRIPLE`. For Android or iOS builds, `does_supported_file_name_exist` checks for `tauri.android.conf.json` or `tauri.ios.conf.json`, but `get_config` merges `tauri.linux.conf.json` or `tauri.macos.conf.json`. `tauri-build` and the CLI read the mobile file. So the config embedded in the compiled `Context` ignores the mobile platform file, which contradicts the changeset's claim that mobile config files are read properly. The target needs to be resolved the same way, or passed in, before `get_config` runs.
tooling/cli/src/helpers/config.rs:208
[P1] Config reload deadlocks on the config mutex In `reload`, `if let Some(conf) = &*config_handle().lock().unwrap() { get_internal(...) }` keeps the `MutexGuard` temporary alive for the whole `if let` body (edition 2021). `get_internal` with `reload = true` then reaches `*config_handle().lock().unwrap() = Some(ConfigMetadata{..})`, locking the same non-reentrant `std::sync::Mutex` while the guard is still held. The result is a deadlock, or a panic, whenever `reload` is called with a loaded config. That happens every time `tauri dev` detects a change to a Tauri config file (`reload_config` in `interface/rust.rs`). Copy `conf.target` into a local and drop the guard before calling `get_internal`.
core/tauri-codegen/src/lib.rs:70
[P2] Codegen reads config for the host target, so it disagrees with tauri-build on mobile `tauri_build` now reads the platform config for `TARGET` (e.g. `tauri.android.conf.json`). `get_config` here always uses `Target::current()`, which is the host OS, and never returns Android or iOS. The `context!` macro now resolves `TARGET`/`TAURI_TARGET_TRIPLE` for its existence check and for `context_codegen`. On a mobile build, the codegen/`generate_context!` config therefore omits the Android/iOS platform overrides that the build script and CLI applied. The embedded config can then differ from the one used elsewhere, for example in `build.frontendDist`/`devUrl` or the `identifier` overrides. `get_config` should derive the target the same way `context_codegen` does.
qodo · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · impact low
xcode_script computes `macos` from the platform and later picks the macOS target, but the config is always loaded with Target::Ios. Before this change, a macOS host would have selected tauri.macos.conf.json, so macOS builds now merge the iOS overrides instead. [grounded: diff] [consensus 3/3: valid=3]
valid · matches d1 · impact high
valid · impact medium
Target::current() only ever returns a desktop variant for the host, so codegen get_config never reads Android/iOS overrides. Meanwhile the same PR switched tauri-build's read_from to use TARGET. That is an incomplete change: the generated context embeds the host's desktop config while the build script uses the mobile one. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
The old code chose the platform file name from the host via cfg!. The new code hardcodes Linux, so on macOS/Windows a folder that only contains the host's platform config file is no longer detected. The base-file checks still work, which keeps the impact low. [grounded: diff] [consensus 3/3: valid=3]
raw comments (6)
tooling/cli/src/mobile/ios/xcode_script.rs:71
<img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended"> 3\. Macos xcode builds use ios settings <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> The Xcode script now calls <b><i>get_tauri_config</i></b> with <b><i>Target::Ios</i></b> even when <b><i>macos_from_platform</i></b> identifies a macOS build. For that build path, configuration loading merges the iOS platform file instead of the macOS file, while the script subsequently selects a macOS compilation target. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description The Xcode script loads iOS configuration for macOS builds, despite detecting the macOS platform. ## Fix Focus Areas - tooling/cli/src/mobile/ios/xcode_script.rs[68-71] - tooling/cli/src/mobile/ios/xcode_script.rs[118-120] ## Recommended Fix Pass `Target::Darwin` to `get_tauri_config` when `macos` is true and `Target::Ios` otherwise, so configuration selection matches the script’s compilation-target choice. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details> [Dismiss ↗](https://app.qodo.ai/findings/9e062dad-8c95-4238-8ecd-431ef94e8213?action=dismiss&origin=git) | [View ↗](https://app.qodo.ai/findings/9e062dad-8c95-4238-8ecd-431ef94e8213)
tooling/cli/src/helpers/config.rs:212
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 1\. Dev server hangs when a config file changes <code>🐞 Bug</code> <code>☼ Reliability</code> <pre> <b><i>reload</i></b> keeps the configuration mutex guard alive across its call to <b><i>get_internal</i></b>, which tries to lock the same mutex to replace the cached configuration. Once configuration has been loaded, desktop or mobile dev setup and configuration-file watching can reach this path, leaving the reload blocked instead of completing. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ```` ## Issue description `reload` holds the configuration mutex while `get_internal` attempts to acquire it again, preventing reload from completing. ## Fix Focus Areas - tooling/cli/src/helpers/config.rs[194-200] - tooling/cli/src/helpers/config.rs[207-213] ## Recommended Fix Copy the cached `target` into a local variable in a separate statement so the mutex guard is dropped before calling `get_internal`. Preserve the error when no configuration has been loaded: ```rust let target = config_handle().lock().unwrap().as_ref().map(|c| c.target); if let Some(target) = target { get_internal(merge_config, true, target) } else { Err(anyhow::anyhow!("config not loaded")) } ``` ```` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details> [Dismiss ↗](https://app.qodo.ai/findings/9e5ee1e5-3b87-4d88-90a5-12b651dfd589?action=dismiss&origin=git) | [View ↗](https://app.qodo.ai/findings/9e5ee1e5-3b87-4d88-90a5-12b651dfd589)
core/tauri-codegen/src/lib.rs:73
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 2\. Mobile apps embed the desktop platform config <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>tauri_codegen::get_config</i></b> passes <b><i>Target::current()</i></b> to <b><i>read_from</i></b>, so it selects platform overrides for the build host rather than the compilation target. During cross-compilation, both <b><i>generate_context!</i></b> and tauri-build codegen can embed desktop overrides instead of Android or iOS overrides, even though tauri-macros computes the target from <b><i>TARGET</i></b>/<b><i>TAURI_TARGET_TRIPLE</i></b> and <b><i>tauri-build::try_build</i></b> reads the mobile platform file using <b><i>TARGET</i></b>. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description `tauri_codegen::get_config` reads host-platform overrides during cross-compilation, causing macro and build-script code generation to embed the wrong platform configuration. ## Fix Focus Areas - core/tauri-codegen/src/lib.rs[52-73] - core/tauri-macros/src/context.rs[23-27] - core/tauri-macros/src/context.rs[79-79] - core/tauri-build/src/codegen/context.rs[95-95] - core/tauri-utils/src/config/parse.rs[177-195] ## Recommended Fix Make `get_config` select the compilation target before calling `read_from`: either accept a `Target` parameter and pass the target already computed by tauri-macros and a target derived from `TARGET` in tauri-build, or resolve `TARGET`/`TAURI_TARGET_TRIPLE` with `Target::from_triple` inside `get_config`. Fall back to `Target::current()` only when no compilation-target information is available, and apply the selection to both code-generation paths. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details> [Dismiss ↗](https://app.qodo.ai/findings/52247b71-02d2-476b-b085-6942258c9d9d?action=dismiss&origin=git) | [View ↗](https://app.qodo.ai/findings/52247b71-02d2-476b-b085-6942258c9d9d)
tooling/cli/src/helpers/app_paths.rs:77
<img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended"> 4\. Project detection ignores the host's platform config <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>get_tauri_dir</i></b> now always passes <b><i>Target::Linux</i></b> to <b><i>folder_has_configuration_file</i></b> and <b><i>is_configuration_file</i></b>, where the old code chose the file name from the host OS. On macOS or Windows, a project folder is no longer recognised by its <b><i>tauri.macos.conf.json</i></b> / <b><i>tauri.windows.conf.json</i></b> file, and it is recognised by <b><i>tauri.linux.conf.json</i></b> instead. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description Tauri project detection hardcodes `Target::Linux`, so only Linux platform config files are recognised on every OS. ## Fix Focus Areas - tooling/cli/src/helpers/app_paths.rs[77-77] ## Recommended Fix Pass `Target::current()`. A better option is to check every `Target` variant, so a folder that contains any platform-specific config file is detected. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details> [Dismiss ↗](https://app.qodo.ai/findings/3274af12-d644-495e-a007-7a8a033473c5?action=dismiss&origin=git) | [View ↗](https://app.qodo.ai/findings/3274af12-d644-495e-a007-7a8a033473c5)
PR-level
<h3>PR Summary by Qodo</h3> Load platform configuration for the selected build target <code>🐞 Bug fix</code> <code>✨ Enhancement</code> <code>🕐 40+ Minutes</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <details> <summary>AI Description</summary> <dl> <dd> <br/> ><pre> >• Select platform configuration using the build target instead of the host operating system. >• Share target detection across configuration parsing, code generation, and CLI workflows. >• Align mobile JSON5 and TOML filenames with desktop conventions; document the breaking parser API. ></pre> </dd> </dl> </details> <details> <summary>Diagram</summary> <dl> <dd> <br/> ```mermaid graph TD CLI["CLI commands"] --> TARGET["Shared target"] --> PARSER["Config parser"] --> FILES[("Platform files")] --> CONFIG["Merged config"] --> BUILD["Build and codegen"] CONFIG --> WATCH["Dev watcher"] ``` </dd> </dl> </details> <details> <summary>High-Level Assessment</summary> <dl> <dd> <br/> >The following are alternative approaches to this PR: <details> <summary><b>1. Use a target-scoped configuration context</b></summary> <dl> <dd> - ➕ Could bind target and cached configuration together, reducing repeated target arguments and mismatched cache reads. - ➖ Requires a broader CLI state-management change than the explicit-target fix. </dd> </dl> </details> >**Recommendation:** Explicit target arguments are the better scoped fix: mobile commands know their target before loading configuration, and the shared parser can select the right file without relying on the host OS. Before merging, verify that the global cache cannot return a configuration loaded for another target and that reload releases its mutex guard before calling back into configuration loading. </dd> </dl> </details> <details> <summary> Files changed (27) <code> +269 / -165 </code> </summary> <dl> <dd> <br/> <details> <summary>Enhancement (3) <code> +67 / -2 </code></summary> <dl> <dd> <details> <summary>lib.rs<code>Supply a target when codegen reads configuration</code> <code>+4/-1</code></summary> <br/> >Supply a target when codegen reads configuration > ><pre> >• Updates configuration loading to the target-aware parser API, passing the current platform. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-e5541cdbd2f4849ceef009e6b71da8c392df97e7b17fc4647d5b4d2c05f21b4e'>core/tauri-codegen/src/lib.rs</a> </details> <details> <summary>platform.rs<code>Introduce a shared platform Target type</code> <code>+53/-0</code></summary> <br/> >Introduce a shared platform Target type > ><pre> >• Adds desktop and mobile target variants, target-triple classification, current-platform detection, and mobile/desktop predicates for use across crates. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-a104b19f4fce98c31daa94ae6858a3b95f04d1e01fbc8d0bca638b3880bd89ce'>core/tauri-utils/src/platform.rs</a> </details> <details> <summary>mod.rs<code>Bridge mobile targets to shared platform targets</code> <code>+10/-1</code></summary> <br/> >Bridge mobile targets to shared platform targets > ><pre> >• Maps CLI mobile targets to tauri-utils targets and passes the result into development configuration setup. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-68f157df87816d2d50d456232c6c9bf47032e4f07d339846c6f85f68cc950772'>tooling/cli/src/mobile/mod.rs</a> </details> </dd> </dl> </details> <details> <summary>Bug fix (16) <code> +157 / -101 </code></summary> <dl> <dd> <details> <summary>lib.rs<code>Read build configuration for Cargo&#x27;s target</code> <code>+1/-0</code></summary> <br/> >Read build configuration for Cargo&#x27;s target > ><pre> >• Passes the TARGET triple to configuration loading so build-time platform overrides follow the compiled target. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-32d56f6cc8f62ffb1503c020b8f82caaec9bb4c3c86d0a93f590895b0fb6a67d'>core/tauri-build/src/lib.rs</a> </details> <details> <summary>context.rs<code>Validate macro configuration against the target</code> <code>+8/-2</code></summary> <br/> >Validate macro configuration against the target > ><pre> >• Resolves the build target from TARGET or TAURI_TARGET_TRIPLE, with a current-platform fallback. Uses it when checking for supported configuration filenames. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-efb96bd2af0ae0e7e2440c73b82b9f996d8bda018f64e238acf0469b1cb80266'>core/tauri-macros/src/context.rs</a> </details> <details> <summary>parse.rs<code>Make configuration discovery target-aware</code> <code>+58/-66</code></summary> <br/> >Make configuration discovery target-aware > ><pre> >• Adds explicit Target arguments throughout file detection, parsing, and platform-override loading. Selects platform filenames from that target and standardizes Android and iOS JSON5 and TOML names. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-861f1335e52eff04df092efb0a456a4e7fca1bc99623d89c3145eb8549e4bf98'>core/tauri-utils/src/config/parse.rs</a> </details> <details> <summary>build.rs<code>Propagate the selected build target into setup</code> <code>+11/-4</code></summary> <br/> >Propagate the selected build target into setup > ><pre> >• Derives a platform target from --target or the current platform and passes it through build setup and configuration loading. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-3d73fdb9f4378a263c3ddeaa700ef6064fa049e2fb724e267f5284a3a1477aa8'>tooling/cli/src/build.rs</a> </details> <details> <summary>dev.rs<code>Propagate the selected development target</code> <code>+9/-3</code></summary> <br/> >Propagate the selected development target > ><pre> >• Derives the platform target from development options and supplies it to setup and configuration loading. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-f7b8f57f62dee5aeec39772f0d7e8aaac416587d1c940aea79f8615f433cfb65'>tooling/cli/src/dev.rs</a> </details> <details> <summary>config.rs<code>Load and retain the CLI configuration target</code> <code>+18/-7</code></summary> <br/> >Load and retain the CLI configuration target > ><pre> >• Passes the requested target to base and platform configuration parsing and stores it in cached metadata. Reload uses the stored target and returns an error if no configuration has been loaded. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-8041bae140e72174511a3a95a0f245295653d5136ce819ca6d076823432fd3cd'>tooling/cli/src/helpers/config.rs</a> </details> <details> <summary>rust.rs<code>Track the Rust build target for config watching</code> <code>+7/-4</code></summary> <br/> >Track the Rust build target for config watching > ><pre> >• Stores the platform derived from the Rust target triple and uses it to recognize relevant configuration changes. Renames the separate rustup target record to RustupTarget. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-51403e5aaa4a768c008928cd2323cf62aafe9258b4879273879a205729cf2bed'>tooling/cli/src/interface/rust.rs</a> </details> <details> <summary>android_studio_script.rs<code>Load Android configuration in the Studio script</code> <code>+1/-1</code></summary> <br/> >Load Android configuration in the Studio script > ><pre> >• Passes the Android platform target when retrieving configuration for the Android Studio script. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-5521b91fa7cb93f36eebc063e65957cd78e44712d15d9a3e3cccb959d1063e77'>tooling/cli/src/mobile/android/android_studio_script.rs</a> </details> <details> <summary>build.rs<code>Use Android configuration throughout builds</code> <code>+9/-2</code></summary> <br/> >Use Android configuration throughout builds > ><pre> >• Selects Android configuration for the build command and passes the Android target into shared build setup. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-f43275e0e94cd0eaa9fb18e76e663483938169e60a75e19c3d957483c865046b'>tooling/cli/src/mobile/android/build.rs</a> </details> <details> <summary>dev.rs<code>Use Android configuration throughout development</code> <code>+14/-3</code></summary> <br/> >Use Android configuration throughout development > ><pre> >• Selects Android configuration for command startup, development overrides, and shared dev setup. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-e1c397f13fd816515ccd576328dfff4b5641954943474daefd6327866bd9a74a'>tooling/cli/src/mobile/android/dev.rs</a> </details> <details> <summary>open.rs<code>Load Android configuration when opening a project</code> <code>+1/-1</code></summary> <br/> >Load Android configuration when opening a project > ><pre> >• Passes the Android target to configuration loading before opening the native project. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-e6720e4372ab627b0624a3ea641bd31fb6dc8e70a6a176036eb7174df0b05138'>tooling/cli/src/mobile/android/open.rs</a> </details> <details> <summary>init.rs<code>Load target-specific configuration during mobile init</code> <code>+1/-1</code></summary> <br/> >Load target-specific configuration during mobile init > ><pre> >• Converts the selected mobile target to a platform target before retrieving initialization configuration. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-e8e0ed66658344bfa653c1029a3fefbf4977c914474209c60eec375510f45d1a'>tooling/cli/src/mobile/init.rs</a> </details> <details> <summary>build.rs<code>Use iOS configuration throughout builds</code> <code>+6/-2</code></summary> <br/> >Use iOS configuration throughout builds > ><pre> >• Selects iOS configuration for the build command and passes the iOS target into shared build setup. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-3618f0843a3e92a6d8354625987884652ed89c935e3ed7ba400e7149b489511d'>tooling/cli/src/mobile/ios/build.rs</a> </details> <details> <summary>dev.rs<code>Use iOS configuration throughout development</code> <code>+11/-3</code></summary> <br/> >Use iOS configuration throughout development > ><pre> >• Selects iOS configuration for command startup, development overrides, and shared dev setup. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-472d9001e8d9b033f1dc9b44d39e4020921234df4fc21839eb0067bfefd94e26'>tooling/cli/src/mobile/ios/dev.rs</a> </details> <details> <summary>open.rs<code>Load iOS configuration when opening a project</code> <code>+1/-1</code></summary> <br/> >Load iOS configuration when opening a project > ><pre> >• Passes the iOS target to configuration loading before opening the native project. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-7a70587051ea8359af460d1c344576caec6efaa6a0465992c656575428b23a65'>tooling/cli/src/mobile/ios/open.rs</a> </details> <details> <summary>xcode_script.rs<code>Load iOS configuration in the Xcode script</code> <code>+1/-1</code></summary> <br/> >Load iOS configuration in the Xcode script > ><pre> >• Passes the iOS platform target when retrieving configuration for the Xcode script. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-b463c6fb8f9d78fcb90535562863f0a2cb207aaeb435c7789ec1abfe4a02c355'>tooling/cli/src/mobile/ios/xcode_script.rs</a> </details> </dd> </dl> </details> <details> <summary>Refactor (5) <code> +28 / -62 </code></summary> <dl> <dd> <details> <summary>context.rs<code>Replace codegen&#x27;s private target detection</code> <code>+6/-48</code></summary> <br/> >Replace codegen&#x27;s private target detection > ><pre> >• Removes the local Target enum and detection logic. Code generation now uses tauri-utils to resolve an environment-provided triple or fall back to the current platform. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-45b0f313a4e403c382fbd52d97cb3cc15d75f09a30a9cca633c4c6d29a24590e'>core/tauri-codegen/src/context.rs</a> </details> <details> <summary>app_paths.rs<code>Adapt project discovery to target-aware helpers</code> <code>+4/-3</code></summary> <br/> >Adapt project discovery to target-aware helpers > ><pre> >• Updates configuration-file and folder checks to the new parser signatures, using Linux for this project-discovery lookup. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-ce1c81e7e03b6f8e35b6499396634f6dde47a87e42fe44933205c019fae03b9a'>tooling/cli/src/helpers/app_paths.rs</a> </details> <details> <summary>icon.rs<code>Supply a target for icon configuration loading</code> <code>+2/-1</code></summary> <br/> >Supply a target for icon configuration loading > ><pre> >• Updates the icon command&#x27;s configuration lookup to use the current platform. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-00f7bd0f31f0ef67b8289ac8a2bd80bc1afefed3cf5afce3d37c7ada23e0f6af'>tooling/cli/src/icon.rs</a> </details> <details> <summary>app.rs<code>Supply a target for application information</code> <code>+2/-1</code></summary> <br/> >Supply a target for application information > ><pre> >• Updates the app-information configuration lookup to use the current platform. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-3da33e51f40fec2ab46c72bc1ae6c40b6a208c37fbe5e4a7542ad66d3face4be'>tooling/cli/src/info/app.rs</a> </details> <details> <summary>desktop.rs<code>Rename desktop rustup target references</code> <code>+14/-9</code></summary> <br/> >Rename desktop rustup target references > ><pre> >• Uses RustupTarget for installed-target discovery, validation, and desktop build function signatures, distinguishing it from the new shared platform Target. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-76c59f9e0c294c7577e0030425050dee41aca14242845c78f9ad959911790c78'>tooling/cli/src/interface/rust/desktop.rs</a> </details> </dd> </dl> </details> <details> <summary>Documentation (3) <code> +17 / -0 </code></summary> <dl> <dd> <details> <summary>cli-config-target-mobile.md<code>Record the mobile CLI configuration fix</code> <code>+6/-0</code></summary> <br/> >Record the mobile CLI configuration fix > ><pre> >• Adds patch bug-fix entries for the Rust and JavaScript CLIs, describing target-specific mobile configuration loading. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-68a0ec9b255119afd10b3a9722faa06a11d93482be40c4890e7dc861d350ee25'>.changes/cli-config-target-mobile.md</a> </details> <details> <summary>codegen-target-from-utils.md<code>Record shared target use in code generation</code> <code>+6/-0</code></summary> <br/> >Record shared target use in code generation > ><pre> >• Adds patch enhancement entries for codegen and macros adopting the tauri-utils target type. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-509f1ca84c4c2d4f24a1f77d3d42ec3cea242f36d9456084ebfe4bb1cb6a65db'>.changes/codegen-target-from-utils.md</a> </details> <details> <summary>mobile-config-naming-conventions.md<code>Record breaking configuration parser changes</code> <code>+5/-0</code></summary> <br/> >Record breaking configuration parser changes > ><pre> >• Documents mobile filename alignment and the new target arguments on tauri-utils parsing methods. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-f89c6b81a259543d83b7d938d35716f157da10a738268c52d33a6de4dca36f2b'>.changes/mobile-config-naming-conventions.md</a> </details> </dd> </dl> </details> </dd> </dl> </details>
PR-level
<h3>Code Review by Qodo</h3> <code>🐞 Bugs (4)</code> <code>📘 Rule violations (0)</code> <code>📜 Skill insights (0)</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <br/> <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> <details> <summary> 1. Dev server hangs when a config file changes <code>🐞 Bug</code> <code>☼ Reliability</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>reload</i></b> keeps the configuration mutex guard alive across its call to <b><i>get_internal</i></b>, which tries to >lock the same mutex to replace the cached configuration. Once configuration has been loaded, desktop >or mobile dev setup and configuration-file watching can reach this path, leaving the reload blocked >instead of completing. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[tooling/cli/src/helpers/config.rs[R207-212]](https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-8041bae140e72174511a3a95a0f245295653d5136ce819ca6d076823432fd3cdR207-R212)</code> > >```diff > pub fn reload(merge_config: Option<&str>) -> crate::Result<ConfigHandle> { >- get_internal(merge_config, true) >+ if let Some(conf) = &*config_handle().lock().unwrap() { >+ get_internal(merge_config, true, conf.target) >+ } else { >+ Err(anyhow::anyhow!("config not loaded")) >+ } >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >The <b><i>if let</i></b> in <b><i>reload</i></b> borrows cached metadata through a mutex guard that remains held while it >calls <b><i>get_internal</i></b>. With <b><i>reload = true</i></b>, <b><i>get_internal</i></b> skips its first lock but acquires the >same mutex to store the new <b><i>ConfigMetadata</i></b>; the file watcher calls <b><i>reload</i></b> when ><b><i>is_configuration_file</i></b> matches, and dev setup can also invoke it after configuration has loaded. ></pre> > > <code>[tooling/cli/src/helpers/config.rs\[194-198\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/helpers/config.rs/#L194-L198)</code> > <code>[tooling/cli/src/helpers/config.rs\[207-212\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/helpers/config.rs/#L207-L212)</code> > <code>[tooling/cli/src/interface/rust.rs\[513-515\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/interface/rust.rs/#L513-L515)</code> > <code>[tooling/cli/src/helpers/config.rs\[207-213\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/helpers/config.rs/#L207-L213)</code> > <code>[tooling/cli/src/helpers/config.rs\[194-200\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/helpers/config.rs/#L194-L200)</code> > <code>[tooling/cli/src/mobile/mod.rs\[160-189\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/mobile/mod.rs/#L160-L189)</code> > <code>[tooling/cli/src/interface/rust.rs\[509-517\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/interface/rust.rs/#L509-L517)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >```` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >`reload` holds the configuration mutex while `get_internal` attempts to acquire it again, preventing reload from completing. > >## Fix Focus Areas >- tooling/cli/src/helpers/config.rs[194-200] >- tooling/cli/src/helpers/config.rs[207-213] > >## Recommended Fix >Copy the cached `target` into a local variable in a separate statement so the mutex guard is dropped before calling `get_internal`. Preserve the error when no configuration has been loaded: >```rust >let target = config_handle().lock().unwrap().as_ref().map(|c| c.target); >if let Some(target) = target { > get_internal(merge_config, true, target) >} else { > Err(anyhow::anyhow!("config not loaded")) >} >``` >```` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> [Dismiss ↗](https://app.qodo.ai/findings/9e5ee1e5-3b87-4d88-90a5-12b651dfd589?action=dismiss&origin=git) | [View ↗](https://app.qodo.ai/findings/9e5ee1e5-3b87-4d88-90a5-12b651dfd589) <hr/> </details> <details> <summary> 2. Mobile apps embed the desktop platform config <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>tauri_codegen::get_config</i></b> passes <b><i>Target::current()</i></b> to <b><i>read_from</i></b>, so it selects platform >overrides for the build host rather than the compilation target. During cross-compilation, both ><b><i>generate_context!</i></b> and tauri-build codegen can embed desktop overrides instead of Android or iOS >overrides, even though tauri-macros computes the target from <b><i>TARGET</i></b>/<b><i>TAURI_TARGET_TRIPLE</i></b> and ><b><i>tauri-build::try_build</i></b> reads the mobile platform file using <b><i>TARGET</i></b>. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[core/tauri-codegen/src/lib.rs[R70-73]](https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-e5541cdbd2f4849ceef009e6b71da8c392df97e7b17fc4647d5b4d2c05f21b4eR70-R73)</code> > >```diff >+ let mut config = serde_json::from_value(tauri_utils::config::parse::read_from( >+ tauri_utils::platform::Target::current(), >+ parent.clone(), >+ )?)?; >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> ><b><i>read_from</i></b> selects the platform override from its target argument, but <b><i>Target::current()</i></b> only >identifies the host OS and never returns Android or Ios. Both the macro and build-script >code-generation paths call <b><i>get_config</i></b>; the target computed by tauri-macros is used for a >file-existence check but is not passed to that function, while <b><i>try_build</i></b> uses <b><i>TARGET</i></b> to read the >mobile platform file. ></pre> > > <code>[core/tauri-utils/src/platform.rs\[45-53\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-utils/src/platform.rs/#L45-L53)</code> > <code>[core/tauri-macros/src/context.rs\[23-27\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-macros/src/context.rs/#L23-L27)</code> > <code>[core/tauri-macros/src/context.rs\[79-79\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-macros/src/context.rs/#L79-L79)</code> > <code>[core/tauri-build/src/codegen/context.rs\[95-95\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-build/src/codegen/context.rs/#L95-L95)</code> > <code>[core/tauri-build/src/lib.rs\[296-298\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-build/src/lib.rs/#L296-L298)</code> > <code>[core/tauri-codegen/src/lib.rs\[70-78\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-codegen/src/lib.rs/#L70-L78)</code> > <code>[core/tauri-utils/src/config/parse.rs\[177-195\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-utils/src/config/parse.rs/#L177-L195)</code> > <code>[core/tauri-build/src/codegen/context.rs\[88-90\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-build/src/codegen/context.rs/#L88-L90)</code> > <code>[core/tauri-macros/src/context.rs\[72-86\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-macros/src/context.rs/#L72-L86)</code> > <code>[core/tauri-codegen/src/context.rs\[124-130\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-codegen/src/context.rs/#L124-L130)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >`tauri_codegen::get_config` reads host-platform overrides during cross-compilation, causing macro and build-script code generation to embed the wrong platform configuration. > >## Fix Focus Areas >- core/tauri-codegen/src/lib.rs[52-73] >- core/tauri-macros/src/context.rs[23-27] >- core/tauri-macros/src/context.rs[79-79] >- core/tauri-build/src/codegen/context.rs[95-95] >- core/tauri-utils/src/config/parse.rs[177-195] > >## Recommended Fix >Make `get_config` select the compilation target before calling `read_from`: either accept a `Target` parameter and pass the target already computed by tauri-macros and a target derived from `TARGET` in tauri-build, or resolve `TARGET`/`TAURI_TARGET_TRIPLE` with `Target::from_triple` inside `get_config`. Fall back to `Target::current()` only when no compilation-target information is available, and apply the selection to both code-generation paths. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> [Dismiss ↗](https://app.qodo.ai/findings/52247b71-02d2-476b-b085-6942258c9d9d?action=dismiss&origin=git) | [View ↗](https://app.qodo.ai/findings/52247b71-02d2-476b-b085-6942258c9d9d) <hr/> </details> <br/> <img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended"> <details> <summary> 3. macOS Xcode builds use iOS settings <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> >The Xcode script now calls <b><i>get_tauri_config</i></b> with <b><i>Target::Ios</i></b> even when <b><i>macos_from_platform</i></b> >identifies a macOS build. For that build path, configuration loading merges the iOS platform file >instead of the macOS file, while the script subsequently selects a macOS compilation target. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[tooling/cli/src/mobile/ios/xcode_script.rs[71]](https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-b463c6fb8f9d78fcb90535562863f0a2cb207aaeb435c7789ec1abfe4a02c355R71-R71)</code> > >```diff >+ let tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, None)?; >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >The script detects macOS from the Xcode platform and selects a macOS target later, but the changed >configuration call always selects iOS. Platform file lookup uses the supplied target. ></pre> > > <code>[tooling/cli/src/mobile/ios/xcode_script.rs\[46-71\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/mobile/ios/xcode_script.rs/#L46-L71)</code> > <code>[tooling/cli/src/mobile/ios/xcode_script.rs\[118-120\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/mobile/ios/xcode_script.rs/#L118-L120)</code> > <code>[core/tauri-utils/src/config/parse.rs\[53-59\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-utils/src/config/parse.rs/#L53-L59)</code> > <code>[core/tauri-utils/src/config/parse.rs\[188-195\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-utils/src/config/parse.rs/#L188-L195)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >The Xcode script loads iOS configuration for macOS builds, despite detecting the macOS platform. > >## Fix Focus Areas >- tooling/cli/src/mobile/ios/xcode_script.rs[68-71] >- tooling/cli/src/mobile/ios/xcode_script.rs[118-120] > >## Recommended Fix >Pass `Target::Darwin` to `get_tauri_config` when `macos` is true and `Target::Ios` otherwise, so configuration selection matches the script’s compilation-target choice. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> [Dismiss ↗](https://app.qodo.ai/findings/9e062dad-8c95-4238-8ecd-431ef94e8213?action=dismiss&origin=git) | [View ↗](https://app.qodo.ai/findings/9e062dad-8c95-4238-8ecd-431ef94e8213) <hr/> </details> <details> <summary> 4. Project detection ignores the host&#x27;s platform config <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>get_tauri_dir</i></b> now always passes <b><i>Target::Linux</i></b> to <b><i>folder_has_configuration_file</i></b> and ><b><i>is_configuration_file</i></b>, where the old code chose the file name from the host OS. On macOS or >Windows, a project folder is no longer recognised by its <b><i>tauri.macos.conf.json</i></b> / ><b><i>tauri.windows.conf.json</i></b> file, and it is recognised by <b><i>tauri.linux.conf.json</i></b> instead. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[tooling/cli/src/helpers/app_paths.rs[77]](https://github.com/drape-io/crbench-qodo-2026-09/pull/118/files#diff-ce1c81e7e03b6f8e35b6499396634f6dde47a87e42fe44933205c019fae03b9aR77-R77)</code> > >```diff >+ lookup(&cwd, |path| folder_has_configuration_file(Target::Linux, path) || is_configuration_file(Target::Linux, path)) >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >Before this PR, <b><i>into_platform_file_name</i></b> picked the name with <b><i>cfg!(target_os)</i></b> for the host. The >new call site hardcodes Linux, so only the Linux platform file names are checked on every OS. ></pre> > > <code>[tooling/cli/src/helpers/app_paths.rs\[77-77\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/tooling/cli/src/helpers/app_paths.rs/#L77-L77)</code> > <code>[core/tauri-utils/src/config/parse.rs\[140-148\]](https://github.com/drape-io/crbench-qodo-2026-09/blob/c7ca84d7d2d62774f3201193547576aa3969a844/core/tauri-utils/src/config/parse.rs/#L140-L148)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >Tauri project detection hardcodes `Target::Linux`, so only Linux platform config files are recognised on every OS. > >## Fix Focus Areas >- tooling/cli/src/helpers/app_paths.rs[77-77] > >## Recommended Fix >Pass `Target::current()`. A better option is to check every `Target` variant, so a folder that contains any platform-specific config file is detected. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> [Dismiss ↗](https://app.qodo.ai/findings/3274af12-d644-495e-a007-7a8a033473c5?action=dismiss&origin=git) | [View ↗](https://app.qodo.ai/findings/3274af12-d644-495e-a007-7a8a033473c5) <hr/> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-context:start --> <details><summary><strong>Context sources</strong></summary> <div>Review mode: <code>Auto: 🧠 Deep</code>: Cross-cutting target-aware configuration changes span many independent, subtle code paths.</div> <!-- qodo-context:end --> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:start --> <details> <summary><strong>Tip of the day</strong></summary> <br/> <pre>💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link</pre> <a href="https://docs.qodo.ai/tips-and-tricks">More tips ↗</a> | <a href="https://app.qodo.ai/configurations?tab=display-preferences">Customize Qodo ↗</a> | <a href="https://docs.qodo.ai">Qodo docs ↗</a> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:end --> <!-- https://github.com/drape-io/crbench-qodo-2026-09/commit/c7ca84d7d2d62774f3201193547576aa3969a844 --> <a href="https://www.qodo.ai"><img src="https://www.qodo.ai/wp-content/uploads/2025/03/qodo-logo.svg" width="80" alt="Qodo Logo"></a>