Skip to content

Fix simulator build on Xcode 26 / macOS 26#154

Open
Kyome22 wants to merge 1 commit intofinnvoor:mainfrom
Kyome22:xcode26
Open

Fix simulator build on Xcode 26 / macOS 26#154
Kyome22 wants to merge 1 commit intofinnvoor:mainfrom
Kyome22:xcode26

Conversation

@Kyome22
Copy link

@Kyome22 Kyome22 commented Jan 17, 2026

Fix #148

Xcode 26's macOS 26 SDK automatically imports _DarwinFoundation modules, which are incompatible with Embedded Swift mode. This causes build failures with errors like:

error: module '_DarwinFoundation1' cannot be imported in embedded Swift mode

This fix explicitly sets the target to arm64-apple-macos14 in the simulator toolset, which avoids the macOS 26 SDK's implicit Foundation imports while still producing a working simulator binary.

Changes:

  • Add swiftCompiler section with explicit target and flags to disable implicit module imports
  • Add explicit target to cCompiler section

Xcode 26's macOS 26 SDK automatically imports _DarwinFoundation modules,
which are incompatible with Embedded Swift mode. This causes build
failures with errors like:

  error: module '_DarwinFoundation1' cannot be imported in embedded Swift mode

This fix explicitly sets the target to arm64-apple-macos14 in the
simulator toolset, which avoids the macOS 26 SDK's implicit Foundation
imports while still producing a working simulator binary.

Changes:
- Add swiftCompiler section with explicit target and flags to disable
  implicit module imports
- Add explicit target to cCompiler section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@alicerunsonfedora
Copy link
Contributor

I tested the patch on my end, but I cannot seem to build either way. I don't believe this PR fixes #148, as the set of errors is different from what this PR proposes to fix.

For reference:

  • Xcode Version: 26.2 (17C52)
  • macOS Version: 26.2 (25C56)
  • Swift Toolchain Version: 6.2.3
Xcode 2026-01-28 21 27 27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No longer builds on latest xcode

2 participants