Failed to emit precompiled module in Xcode 26b1

I'm trying to bring up an existing macOS app workspace to build against the macOS 26 SDK, however Xcode 26b1 is producing the following error, and I'm unable to proceed:

/Users/tonyarnold/Documents/Reveal/<unknown>:1:1: error reading '/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/module.modulemap': No such file or directory

/Users/tonyarnold/Documents/Reveal/<unknown>:1:1: failed to emit precompiled module '/Users/tonyarnold/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/_Builtin_stdbool-LVR359SH1U4537HG9T3JOGN.pcm' for module map '/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/module.modulemap'

I've checked and the module map that it claims is missing is there on the filesystem.

Is this a known issue with this beta?

After turning on SWIFT_ENABLE_EXPLICIT_MODULES, it gets a little further, and then spits out a very similar error:


Showing Recent Issues
/Users/tonyarnold/Documents/Reveal/<unknown>:1:1: error reading '/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/module.modulemap': No such file or directory

/Users/tonyarnold/Documents/Reveal/<unknown>:1:1: failed to emit precompiled module '/Users/tonyarnold/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/ptrcheck-4LS9E3I68COI6XN5HHO8H5O7N.pcm' for module map '/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/module.modulemap'

Can you please share a small reproducer for this issue?

To me it looks like "XcodeDefault.xctoolchain/usr/lib/clang/17/include/module.modulemap" sometimes is present and sometimes is absent. When it is present, Xcode decides to build modules "_Builtin_stdbool", "ptrcheck". But later when actually building those modules it cannot find the module map. I would expect such behavior when Xcode-beta.app is on external hard drive and that drive not working reliably.

Still, a small reproducer would help us to understand the issue better and to be able to help you.

I'll do my best to create a small reproducer, but this is part of a very large, somewhat complex workspace.

Turning off the new Compilation Caching option in Workspace Settings gets me past this error.

@tonyarnold a reproducer would be ideal, but in the meantime a build log where this failed might be helpful to get us started figuring out what went wrong. We wouldn't expect this kind of error to happen when using compilation caching; in that mode the modulemap should only be read during dependency scanning/planning and not when emitting a precompiled module, which is what seems to have happened here. If you can share a full build log (possibly attached to a Feedback) we may be able to figure it out or at least narrow it down.

Failed to emit precompiled module in Xcode 26b1
 
 
Q