[REGRESSION] Xcode 9 PrecompileSwiftBridgingHeader failed with a nonzero exit code
| Originator: | nicholas.helke | ||
| Number: | rdar://32810754 | Date Originated: | 2017-06-16 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Fails with Xcode 9 beta (9M136h) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
Project compiles fine on Xcode 8, fails on Xcode 9 beta (9M136h) with:
Bridge.h:11:9: error: module 'TheModule' not found
@import TheModule;
^
1 error generated.
<unknown>:0: error: failed to emit precompiled header '/var/folders/xx/xxxxxx/T/Bridge-812a0f.pch' for bridging header 'Bridge.h'
Command PrecompileSwiftBridgingHeader failed with a nonzero exit code
The project links with theModule.a and has the following module.modulemap file:
module TheModule {
header "module.h"
export *
}
Both new and old build systems fail.
Attached is example project which works with Xcode 8 but fails with Xcode 9.
Steps to Reproduce:
Swift Xcode project with a bridging header importing a module defined in a modulemap file from a header for a ObjC based static library.
Expected Results:
Should build, as it does with Xcode 8
Observed Results:
Fails with "Command PrecompileSwiftBridgingHeader failed with a nonzero exit code"
Version:
Fails with Xcode 9 beta (9M136h)
Succeeds with any version of Xcode 8
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Thank you for the well-reduced test case! When precompiling a bridging header, the Swift compiler will no longer automatically read a module map file that's in the same directory as the bridging header. If reading a module map from this directory is important, you can add it as an explicit search path under the "User Header Search Paths" build setting.