swift
c6745e6d - Fix Swift Compiler Modules support in Debug mode (#73506)

Commit
1 year ago
Fix Swift Compiler Modules support in Debug mode (#73506) The new `swift-driver` seems to enqueue a `wrapmodule` job which uses the given `module-name` to form the output file name when not doing optmizations (seems to happen only for `-Onone` in my testing). Since the CMake functions macros are using the module name also as the explicit output name, this clashes and ends up in an unhelpful error message from the driver. ``` SwiftDriverExecution/MultiJobExecutor.swift:207: Fatal error: multiple producers for output ... SwiftCompilerSources/Basic.o: Wrapping Swift module Basic & Compiling Basic SourceLoc.swift ``` This was reported in https://forums.swift.org/t/debug-swift-build-fails/71380 The changes use a different output object name (by using `.object.o` suffix) which does not clash with what the `swift-driver` does automatically. The code around the output objects and the static libraries have to change slightly to handle this case. Additionally, the resulting library when in `Debug` is now declaring its dependency on `swiftSwiftOnoneSupport`, to avoid linking errors when the libraries are used in the final binaries. Debug mode seems to enable PURE_BRIDGING_MODE, which seems to skip transitively including some C headers that files like `Utilities/Test.swift` depend on. To avoid errors building, add the missing include in a new `#else` branch. I think CI will not test the `Debug` mode, so the only thing that it can prove is that these changes do not break the `Release` mode.
Author
Parents
Loading