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

New --include-extended-types changes seems to break --additional-symbol-graph-dir #60

Open
1 of 2 tasks
NachoSoto opened this issue May 31, 2023 · 4 comments
Open
1 of 2 tasks
Labels
bug Something isn't working

Comments

@NachoSoto
Copy link

Prior to version 1.2, we were generating our docs using additional-symbol-graph-dir.
This is how we built the symbol graph:

sh("swift",
    "build",
    "--target", "RevenueCat",
    "--configuration", "debug", # Necessary for debug-only symbols
    # Build for iOS instead of the default macOS. This ensures that iOS-only symbols are included in the docs.
    "-Xswiftc", "-sdk", "-Xswiftc", sh("xcrun", "--sdk", "iphonesimulator", "--show-sdk-path").strip!,
    "-Xswiftc", "-target", "-Xswiftc", "x86_64-apple-ios#{ios_version}-simulator",
    "-Xswiftc", "-emit-symbol-graph",
    "-Xswiftc", "-emit-symbol-graph-dir",
    "-Xswiftc", ".build")

I updated the plugin to 1.2 to be able to use --include-extended-types now so that we can document our extensions. However, generating symbols fails now:

[207/229] Emitting module RevenueCat
<unknown>:0: error: error opening '.build/RevenueCat.symbols.json' for output: No such file or directory
<unknown>:0: error: error opening '.build/[email protected]' for output: No such file or directory
<unknown>:0: error: error opening '.build/[email protected]' for output: No such file or directory

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

I expected our swift build command to continue working

Actual behavior

Build fails.

Swift-DocC Plugin Version Information

Swift-DocC plugin version: 1.2.0
Swift Compiler version:

swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0
@NachoSoto NachoSoto added the bug Something isn't working label May 31, 2023
@NachoSoto
Copy link
Author

NachoSoto commented May 31, 2023

Actually it appears that was happening because of an invalid reference to SwiftUI in the target. I removed that, and now it seems like I'm close to getting this working.
However it seems like I'm missing something in how I'm creating the symbol graph, since this is what I get when calling swift package preview-documentation:

Error: Mixing symbol graph files with and without extension declarations is not supported.

I couldn't find any documentation on this. Do I need a new argument to the swift build call to add extension declarations?
I tried -emit-extension-block-symbols (which I found in swiftlang/swift#59047), but that produces the same error again:

[115/229] Emitting module RevenueCat
<unknown>:0: error: error opening '.build/RevenueCat.symbols.json' for output: No such file or directory
<unknown>:0: error: error opening '.build/[email protected]' for output: No such file or directory
<unknown>:0: error: error opening '.build/[email protected]' for output: No such file or directory

@abegehr
Copy link

abegehr commented Nov 17, 2023

Did you get any further on this, @NachoSoto? For me it's failing on building documentation for my vapor backend using fluent-kit.

@NachoSoto
Copy link
Author

Nope, and no word from Apple

@yujingaya
Copy link

yujingaya commented Nov 20, 2023

This seems to be relevant?: swiftlang/swift-docc#715

In the mean time until Swift 5.10, Setting DOCC_EXTRACT_EXTENSION_SYMBOLS to NO worked fine for my project. I don't know about Vapor though.

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

3 participants