Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with target which have binaryTarget dependency #80

Open
2 tasks done
Kyle-Ye opened this issue May 18, 2024 · 0 comments
Open
2 tasks done

Issue with target which have binaryTarget dependency #80

Kyle-Ye opened this issue May 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented May 18, 2024

Due to an upstream SwiftPM issue.

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 call docc 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.

// ✅ Build Package Documentation via Xcode GUI

// ✅ Build Package Documentation manually
swift build --target DemoKit \
  -Xswiftc -emit-symbol-graph \
  -Xswiftc -emit-symbol-graph-dir -Xswiftc "./symbol-graph"

docc convert --additional-symbol-graph-dir ./symbol-graph ...

// ❌ Build Package Documentation via swift-docc-plugin
swift package generate-documentation --target DemoKit

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected behavior

Success

Actual behavior

"<unknown>:0: error: missing required module \'MMKV\'\nError: Failed to load the module \'DemoKit\'. Are you missing build dependencies or include/framework directories?\nSee the previous error messages for details. Aborting.\n"

Steps to Reproduce

  1. Download the following DemoKit.zip package
  2. Run swift package generate-documentation --target DemoKit --verbose and no documentation will be created.

DemoKit.zip

Note: Here I use MMKV.xcframework as an example but any binary framework would have the same issue. The binary framework have nothing special here.

Swift-DocC Plugin Version Information

Swift-DocC plugin version: 1.3.0
Swift Compiler version: 5.10

@Kyle-Ye Kyle-Ye added the bug Something isn't working label May 18, 2024
@Kyle-Ye Kyle-Ye changed the title Support issue with target which have binaryTarget dependency Issue with target which have binaryTarget dependency May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant