[SR-7704] swiftc -emit-module -c, driver documentation and diagnostics #50244
Labels
compiler
The Swift compiler in itself
improvement
legacy driver
Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Additional Detail from JIRA
md5: 30fc405eb81f191e2424636662e06943
relates to:
-c -o
correctly when doing multiple frontend invocationsIssue Description:
Here is the likely story of someone trying to use the swiftc driver for the first time. Maybe they need to troubleshooot their build or provide a reduced test case.
`swiftc -help` lists a set of options. It doesn't explain which modes are supported by the driver: building an exe, building a dylib, building a swiftmodule, building a set of .o files, or whatever.
Since that isn't helpful, the next step is to look at the Swift package manager's output when they build their project. `swift build` output shows them something like:
followed by
That obviously implies that running swiftc on a set of swift files with "-emit-module -c" will produce a bunch of object files. So they try this:
The command runs with no diagnostics whatsoever, but fails to produce
any .o files, which is utterly baffling and gives no hint as to what to try next.
We obviously need to explain how to use the driver in `swiftc -help` or directly link to a documentation section.
We also need to print some diagnostics when someone tries to use the driver the same way that swiftpm does, explaining, in brief, how to correctly form a command line for what they are obviously trying to do.
I'm leaving it to @belkadan to make more specific suggestions and possibly split this up.
The text was updated successfully, but these errors were encountered: