Open Kyle-Ye opened 6 months ago
Is this an expected unimplemented feature or a bug we should fix? Checking the repository's Git history, I believe @MaxDesiatov would have some insights on this scope. Could you help give a look at this? Thanks
Based on a similar discussion i just had with another developer, it looks like the underlying issue is that xcframework
dependencies are being passed to swift-symbolgraph-extract
with -I
paths, rather than -F
paths. If those flags are changed in that command, it should be able to generate symbol graphs successfully.
Based on a similar discussion i just had with another developer, it looks like the underlying issue is that
xcframework
dependencies are being passed toswift-symbolgraph-extract
with-I
paths, rather than-F
paths. If those flags are changed in that command, it should be able to generate symbol graphs successfully.
~I have tried to add the framework manually via -F/-I/-L ${MMKV_framework_path} but none of them will work.~
~eg. Run swift package generate-documentation --target DemoKit
for DemoKit I attached above. It will fail and give us the full command of swift-symbolgraph-extract
.~
~Change -I
to -F
still does not work for me here.~
xcrun \
swift-symbolgraph-extract \
-sdk \
/Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk \
-F \
/Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks \
-I \
/Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib \
-L \
/Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib \
- -I \
+ -F \
/Users/kyle/Downloads/DemoKit/.build/artifacts/demokit/MMKV/MMKV.xcframework/macos-arm64_x86_64 \
-Xcc \
- -I \
+ -F \
-Xcc \
/Users/kyle/Downloads/DemoKit/.build/artifacts/demokit/MMKV/MMKV.xcframework/macos-arm64_x86_64 \
-I \
/Users/kyle/Downloads/DemoKit/.build/arm64-apple-macosx/debug/Modules \
-module-name \
DemoKit \
-target \
arm64-apple-macosx10.13 \
-module-cache-path \
/Users/kyle/Downloads/DemoKit/.build/arm64-apple-macosx/debug/ModuleCache \
-minimum-access-level \
public \
-skip-inherited-docs \
-emit-extension-block-symbols \
-output-dir \
/Users/kyle/Downloads/DemoKit/.build/arm64-apple-macosx/extracted-symbols/demokit/DemoKit
<unknown>:0: error: missing required module 'MMKV'
Error: Failed to load the module 'DemoKit'. Are you missing build dependencies or include/framework directories?
See the previous error messages for details. Aborting.
Maybe some cache issue, after adding both -I and -F, it will work for me now. And delete -I
with only -F
will also work.
-I ${MMKV_framework_path}
is produced by SwiftModuleBuildDescription.additionalFlags
. Trying to debug it and prepare a PR for it.
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?Description
If a target has a dependency on binaryTarget. Then the call of
PackageManager.getSymbolGraph
to that target will get a directory contains no symbol graph.It will break
PackageManager.getSymbolGraph
's client such as swift-docc-plugin.The downstream user can generate doc using
swift build
and calldocc convert
to generate documentation. But if they migrate to swift-docc-plugin or swift-docc-plugin based service like SwiftPackageIndex, the documentation build will fail.Expected behavior
Produce SymbolGraph normally.
Actual behavior
Call swift-symbolgraph-extract with the arguments manually in terminal or adding the following patch to SymbolGraphExtract.swift
And you will get the following error message.
I have tried to add the framework manually via
-F
/-I
/-L ${MMKV_framework_path}
but none of them will work.Steps to reproduce
For user side reproduce steps:
swift package generate-documentation --target DemoKit --verbose
and no documentation will be created.For swiftpm developer reproduce steps:
swift-package
targetDemoKit
and the corresponding arguments on launch in Xcode 4.(Optional) Apply the diff mentioned above.DemoKit.zip
Swift Package Manager version/commit hash
5.10
Swift & OS version (output of
swift --version ; uname -a
)5.10 & macOS 14.4.1