we used to be able to generate the symbolgraph for the standard library with:
swift symbolgraph-extract \
-target x86_64-unknown-linux-gnu \
-output-dir . \
-module-name Swift
which worked fine all through the winter, spring, and summer.
but now it just crashes the toolchain:
$ swift symbolgraph-extract -target x86_64-unknown-linux-gnu -output-dir . -module-name Swift
swift-symbolgraph-extract: /home/build-user/llvm-project/llvm/include/llvm/ADT/SmallVector.h:291: llvm::SmallVectorTemplateCommon::reference llvm::SmallVectorTemplateCommon<const swift::ProtocolCompositionType *, void>::back() [T = const swift::ProtocolCompositionType *]: Assertion `!empty()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/ec2-user/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-10-03-a/usr/bin/swift-symbolgraph-extract -target x86_64-unknown-linux-gnu -output-dir . -module-name Swift
1. Swift version 5.8-dev (LLVM c3aebe50177cd03, Swift 3f020375e568042)
what is the correct way to generate a standard library symbolgraph for a modern toolchain?
(in the chance that this is a bug, i filed an issue at: swift-symbolgraph-extract crashes when trying to emit the 'Swift' module · Issue #61531 · apple/swift · GitHub)
this has regressed once more in swift 5.10, as we are no longer able to dump the symbol graphs for the Foundation or _StringProcessing modules with -emit-extension-block-symbols enabled.
i wish to underscore that fixing this cannot be deferred until after the 5.10 release, as the compiler currently does not have the ability to generate the symbol graph for any version of swift other than its own. therefore, if swift 5.10 ships with a broken symbol graph generator, it will never be possible to generate documentation (that includes cross-module extensions) for the 5.10 standard library, or packages that link against the 5.10 standard library.