-
Notifications
You must be signed in to change notification settings - Fork 232
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
Feature: Generate command line for linux and Mac and even for windows, and publish it on release TAG #427
Comments
@dabrahams any thoughts about that? |
I don't, but I bet @lucteo has useful input. |
Hi I'm not an expert on swift build system, so I'm not sure if I can provide the best help here. But, regardless if this helps, I'm happy to share my experience. The first problem we wanted to solve was how to build swift-format, especially since we needed a feature on main that was not yet released. We didn't want to directly use main, as we were afraid of changes in swift-format that would break our workflow. But even without that problem, building swift-format was not always successful (especially on CI). To solve this, we forked swift-format and committed `Package.resolved. See https://github.com/val-lang/swift-format. We always have a controlled version of swift-format, and that always builds. We depend on swift-format in our The second major hurdle we had to jump is executing swift-format for our code. We tried using the two build plugins provided in swift-format repo, but they were too slow to run. With a debug build, running them on all the targets could take almost a minute on my machine. Not a great experience :) We wrote a shell script that would execute swift-format by directories, not by target. In this, we had a shortcut to search for the swift-format executable in known locations. If that fails, we just run swift-format through We never tested this for windows builds (we had many problems with our CI Windows build, until we disabled it -- way too unstable). The CI job runs on Ubuntu, and some of us run the tool on Mac. Hope that helps Best regards, |
Possible pipeline: |
Any updates on it? |
Tracked in Apple’s issue tracker as rdar://126948314 |
Any updates on it? Would be super nice to get it in a short time. I think swift-format could grow in audience if this distribution were added. |
|
@ahoppen thanks for your comment. Things that maybe I didn't catch, because as far I can see, docs don't point to your observation -> https://github.com/apple/swift-format?tab=readme-ov-file#getting-swift-format
|
@jesus-mg-ios I was able to run it by selecting the beta CLI toolchain in |
If you have Xcode 16 selected using On Linux and macOS, swift-format is part of the open source toolchain releases.
That is true. If you would like to open a PR to fix the README, that would be a very welcome contribution to the project. |
Hi community:
Thanks for read me.
I don't know if it's possible to compile and generate the cli-tool and attach it to the version tag like, for example, https://github.com/nicklockwood/SwiftFormat has,
I think lots of people do not use the official swift format because is a pain to use it in CIs and teammates computers.
You have to build it and then save it on a cache ... Or rebuild all times in new computers. The use of SPM is not straight forward in all cases.
Thanks in advance
CC: @allevato
The text was updated successfully, but these errors were encountered: