Skip to content
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

Output of swift format --version is confusing #834

Open
jkmathew opened this issue Oct 4, 2024 · 3 comments
Open

Output of swift format --version is confusing #834

jkmathew opened this issue Oct 4, 2024 · 3 comments

Comments

@jkmathew
Copy link

jkmathew commented Oct 4, 2024

I am using Xcode 16 which comes with a bundled swift format. When I run swift format --version, it prints main.
Does this mean the swift format bundled with Xcode will always be updated with the latest main branch? Or the bundled version is the latest from the main branch at the time of Xcode release is created?

I tried installing swift-format with homebrew and swift-format --version prints the version correctly.

@jkmathew jkmathew changed the title Output of swift-format --version is confusing Output of swift format --version is confusing Oct 4, 2024
@ahoppen
Copy link
Member

ahoppen commented Oct 4, 2024

Synced to Apple’s issue tracker as rdar://137309661

@allevato
Copy link
Member

allevato commented Oct 7, 2024

Unfortunately we've had to manually update the version number when cutting a release, and that can get overlooked easily. I know I've done it in the past.

IIRC, a recent change in SwiftPM has added a package API to query Git repository information and generate constants that we could reference from the --version handler instead. I would need to look further into it to see if that works as intended when a release is tagged and built.

cc @ahoppen who is in charge of releases.

@jkmathew
Copy link
Author

jkmathew commented Oct 7, 2024

I see there is already an automation implemented here
Tags containing proper versions like

print("601.0.0-prerelease-2024-10-01")

I hope Xcode 16.1 release will have the proper version 🙂

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

No branches or pull requests

3 participants