Skip to content

Support installing docc plugin via env var - #845

Merged
ktoso merged 2 commits into
swiftlang:mainfrom
ktoso:wip-env-enable-plugin
Jul 14, 2026
Merged

ktoso merged 2 commits into
swiftlang:mainfrom
ktoso:wip-env-enable-plugin

Conversation

@ktoso

@ktoso ktoso commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

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

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
@ktoso

ktoso commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Related swiftpm issue swiftlang/swift-package-manager#10294

@ktoso

ktoso commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Verified in earlier run

@ktoso
ktoso merged commit ffc1580 into swiftlang:main Jul 14, 2026
42 checks passed
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
jakepetroules added a commit to swiftlang/swift-package-manager that referenced this pull request Sep 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
Teemperor pushed a commit to Teemperor/swift-mono that referenced this pull request Sep 14, 2026
=== swift-testing ========================================
Adjust `CustomTestStringConvertible` and `CustomIssueRepresentable` for Embedded Swift. (Issue/PR 1899)
Adjusts the implementations of these two protocols to work in Embedded
Swift. The former needs to explicitly access `description` instead of
calling `String(describing:)` because that's implemented generically in
Embedded Swift (and you can't open an existential there nor cast between
generic types). The latter needs to hard-code the list of conforming
types, but only for Embedded Swift.

`CustomTestReflectable` is already unavailable in Embedded Swift.
`CustomTestArgumentEncodable` will be hidden from Embedded Swift in its
entirety in a future PR as it's not possible to implement it there.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.

=== swiftpm ==============================================
Remove explicit swift-docc-plugin dependency
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant