You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
Thanks for testing driving the new option. I kind of aware of this can happen when I write the current implementation (along with other issues, like you cannot request api-extract on a non swift modules). I will keep improving on the current implementation, and at the same time, don't develop serious dependency on the current JSON output format and expect that will be stable.
I took a quick look at this bug. This is not actually what I thought it was. This is likely because of either using the wrong underlying compiler from swift PM (which you need to overwrite with a just built toolchain):
<unknown>:0: error: module compiled with Swift 5.4 cannot be imported by the Swift 5.5 compiler: /@input/ApiDemo.swiftmodule
or (which you need to give clang importer a search path to locate NativeDep, which the option doesn't exist yet):
Attachment: Download
Environment
MacOS 11.2.1
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
Using swift-DEVELOPMENT-SNAPSHOT-2021-03-02-a
Additional Detail from JIRA
md5: ae9232800ffe2a585e4686566d492101
Issue Description:
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.
https://github.com/migueldeicaza/SwiftApiExtractIssue
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.
The text was updated successfully, but these errors were encountered: