Darwin miguels-mac-pro.lan 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
I took the new swift-api-extract for a ride, and found that while it can dump the API for .swiftmodules, if this swiftmodule depends on a native library, the program crashes with the following assertion:
<unknown>:0: error: missing required module 'NativeDep'
Assertion failed: (!Files.empty() && "No files added yet"), function getMainFile, file /Users/buildnode/jenkins/workspace/oss-swift-package-macos/swift/include/swift/AST/FileUnit.h, line 423.
I have provided a self-contained test case that shows the problem.
If you checkout this git repo. or use the attached sample you can see it.
And run "make", this will build, and then attempt to use swift-api-extract, which will crash with the above message. It seems to want a .swiftmodule for the NativeDep library, but since it is a C library, there is no swiftmodule available for it.