Repository: electron/electron
Pull request: fix: restore `sdk_inputs` cross-toolchain deps for macOS

#### Description of Change

Refs CL:7652975

The change in CL:7652975 restricted sdk_inputs public_deps to iOS only, to avoid setting up Xcode symlinks for the Linux toolchain when cross-building chrome/linux on Mac. However, this also broke cross-arch macOS builds (e.g. ffmpeg with target_cpu=x64) where the mig target in the clang_arm64 toolchain depends on sdk_inputs from the default clang_x64 toolchain.

Add target_os == \"mac\" alongside the existing iOS check to preserve the original intent while restoring the cross-toolchain dependency for macOS builds.

<details><summary>Failure</summary>
<p>

```
src on git:d39569110cdaa ❯ e d gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true use_siso=true $GN_EXTRA_ARGS"
Running "gn gen out/ffmpeg --args=import("//electron/build/args/ffmpeg.gn") use_remoteexec=true use_siso=true  target_cpu="x64" v8_snapshot_toolchain="//build/toolchain/mac:clang_x64""
ERROR Input to target not generated by a dependency.
The file:
  //out/ffmpeg/sdk/xcode_links/MacOSX26.2.sdk/usr/include/mach/exc.defs
is listed as an input or source for the target:
  //third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64)
but this file was not generated by any dependencies of the target. The target
that generates the file is:
  //build/config/mac:sdk_inputs(//build/toolchain/mac:clang_x64)

ERROR Input to target not generated by a dependency.
The file:
  //out/ffmpeg/sdk/xcode_links/MacOSX26.2.sdk/usr/include/mach/mach_exc.defs
is listed as an input or source for the target:
  //third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64)
but this file was not generated by any dependencies of the target. The target
that generates the file is:
  //build/config/mac:sdk_inputs(//build/toolchain/mac:clang_x64)

ERROR Input to target not generated by a dependency.
The file:
  //out/ffmpeg/sdk/xcode_links/MacOSX26.2.sdk/usr/include/mach/notify.defs
is listed as an input or source for the target:
  //third_party/crashpad/crashpad/util:mig(//build/toolchain/mac:clang_arm64)
but this file was not generated by any dependencies of the target. The target
that generates the file is:
  //build/config/mac:sdk_inputs(//build/toolchain/mac:clang_x64)

If you have generated inputs, there needs to be a dependency path between the
two targets in addition to just listing the files. For indirect dependencies,
the intermediate ones must be public_deps. data_deps don't count since they're
only runtime dependencies. If you think a dependency chain exists, it might be
because the chain is private. Try "gn path" to analyze.

3 generated input errors found.
ERROR Failed to run command:
 Exit Code: "1"
```

</p>
</details> 
#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none

Changed files:
filename: patches/chromium/.patches
patch: @@ -149,3 +149,4 @@ fix_set_correct_app_id_on_linux.patch
 fix_pass_trigger_for_global_shortcuts_on_wayland.patch
 feat_plumb_node_integration_in_worker_through_workersettings.patch
 feat_restore_macos_child_plugin_process.patch
+fix_restore_sdk_inputs_cross-toolchain_deps_for_macos.patch

filename: patches/chromium/fix_restore_sdk_inputs_cross-toolchain_deps_for_macos.patch
patch: @@ -0,0 +1,32 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <shelley.vohr@gmail.com>
+Date: Mon, 16 Mar 2026 18:57:00 +0100
+Subject: fix: restore sdk_inputs cross-toolchain deps for macOS
+
+The change in CL:7652975 restricted sdk_inputs public_deps
+to iOS only, to avoid setting up Xcode symlinks for the Linux
+toolchain when cross-building chrome/linux on Mac. However, this
+also broke cross-arch macOS builds (e.g. ffmpeg with target_cpu=x64)
+where the mig target in the clang_arm64 toolchain depends on
+sdk_inputs from the default clang_x64 toolchain.
+
+Add target_os == \"mac\" alongside the existing iOS check to preserve
+the original intent while restoring the cross-toolchain dependency
+for macOS builds.
+
+We should try to upstream this.
+
+diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn
+index 56238a14ae8fb0a8fc9bba6553b99c199080e7af..22c628c3b4a3d1072b382ffc0fd0ce5bb85de9b5 100644
+--- a/build/config/mac/BUILD.gn
++++ b/build/config/mac/BUILD.gn
+@@ -120,7 +120,8 @@ if (mac_use_xcode_symlinks && current_toolchain == default_toolchain) {
+   }
+ } else {
+   group("sdk_inputs") {
+-    if (current_toolchain != default_toolchain && target_os == "ios") {
++    if (current_toolchain != default_toolchain &&
++        (target_os == "ios" || target_os == "mac")) {
+       public_deps = [ ":sdk_inputs($default_toolchain)" ]
+     }
+   }