Open dabrahams opened 10 months ago
/cc @lucteo
The main difference I see between swift-format
and docGenerationDependency
is that we DO require contributors to run swift-format for every PR.
Is there a way to clean just the "hc" target instead of cleaning everything?
we DO require contributors to run swift-format for every PR.
Yes. You also require them to run the swift compiler, but you don't make them download the sources and rebuild it for every clean build. Just like the swift compiler, the behavior of swift-format is sufficiently stable that trying to enforce the exact version developers use is a very bad trade-off.
It's not justhc
that needs cleaning when cleaning is needed. SPM/swift-llbuild is not great about tracking dependencies and when you need to start fresh, you often don't know which targets are at issue. Every dependency we have to download and rebuild affects CI energy use and turnaround time as well. It would be better to use homebrew to install swift-format for CI, because that will download cached binaries.
SInce there's been no counterargument, I'm probably going to remove this dependency soon unless someone raises an objection here.
This will become a non-issue to the extent that we stop using SPM. However, the documentation will still need to be updated. See #1300
Every clean build, causes a re-fetch of the repository and a build of all the sources for
swift-format
. Making sure everyone is using exactly the same version is not worth the the cost and there should at least be a way to bypass it.I think this tool really doesn't belong in
Package.swift
but if there's no better alternative,Package.swift
contains a use ofdocGenerationDependency
that could serve as a template. In that case, it is necessary because there appears no good way to do documentation extraction without injecting this dependency.