Support installing docc plugin via env var#845
Merged
Conversation
This is a workaround for `swift package add-dependency` not working due to swift-subprocess pulling it in explicitly: ``` [swift-java] -> % swift package add-dependency https://github.com/swiftlang/swift-docc-plugin --from 1.1.0 error: unable to add dependency 'https://github.com/swiftlang/swift-docc-plugin' because it already exists in the list of dependencies ``` even though ``` -> % swift package generate-documentation error: Unknown subcommand or plugin name 'generate-documentation' Usage: swift package <options> <subcommand> ``` So this is a workaround to enable the plugin in this package
5f8f84c to
0e7f56b
Compare
Collaborator
Author
|
Related swiftpm issue swiftlang/swift-package-manager#10294 |
Collaborator
Author
|
Verified in earlier run |
iCharlesHu
pushed a commit
to swiftlang/swift-subprocess
that referenced
this pull request
Jul 14, 2026
Nowadays (as weird as it is) projects are not expected to have the dependency declared explicitly. It must be added ad-hoc or by the swift package index. Otherwise all kinds of tools break, including swiftlang/docs. It would be ideal that all projects can just add the plugin, but that's not the state of the world nowadays. Meanwhile I did workarounds in adopter projects to unbreak swiftlang/docs building with those added, more details here swiftlang/swift-java#845 cc @heckj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a workaround for
swift package add-dependencynot working due to swift-subprocess pulling it in explicitly:even though
So this is a workaround to enable the plugin in this package