hylo-lang / hylo

The Hylo programming language
https://www.hylo-lang.org
Apache License 2.0
1.24k stars 59 forks source link

Making the project depend on `swift-format` hurts development velocity #1318

Open dabrahams opened 10 months ago

dabrahams commented 10 months ago

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 of docGenerationDependency 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.

dabrahams commented 10 months ago

/cc @lucteo

lucteo commented 10 months ago

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?

dabrahams commented 10 months ago

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.

dabrahams commented 8 months ago

SInce there's been no counterargument, I'm probably going to remove this dependency soon unless someone raises an objection here.

dabrahams commented 5 months ago

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