From 6abe1397b0de822597aa45d0be6d5155670aa7f5 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Tue, 25 Mar 2025 14:57:55 -0400 Subject: [PATCH 1/2] Add swift version file to record the Swift toolchain to use while working with SwiftPM --- .swift-version | 1 + CONTRIBUTING.md | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 .swift-version diff --git a/.swift-version b/.swift-version new file mode 100644 index 00000000000..39c5d6a6b7a --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +6.0.3 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 896ff612cf3..c5b4a690153 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,7 +88,7 @@ $> swift --version Apple Swift version 5.3 ``` -Note: Alternatively use tools like [swiftenv](https://github.com/kylef/swiftenv) that help manage toolchains versions. +Note: Alternatively, there are tools like [swiftly](https://github.com/swiftlang/swiftly) that can instll and manage toolchains automatically. This repository has a file called `.swift-version` that will keep swiftly at the current recommended version of the toolchain for best results. ## Local Development @@ -322,14 +322,15 @@ Note there are several Linux and Swift versions options to choose from, e.g.: 2. Clone a working copy of your fork 3. Create a new branch 4. Make your code changes -5. Try to keep your changes (when possible) below 200 lines of code. -6. We use [SwiftFormat](https://www.github.com/nicklockwood/SwiftFormat) to enforce code style. Please install and run SwiftFormat before submitting your PR, ideally isolating formatting changes only to code changed for the original goal of the PR. This will keep the PR diff smaller. -7. Commit (include the Radar link or GitHub issue id in the commit message if possible and a description your changes). Try to have only 1 commit in your PR (but, of course, if you add changes that can be helpful to be kept aside from the previous commit, make a new commit for them). -8. Push the commit / branch to your fork -9. Make a PR from your fork / branch to `apple: main` -10. While creating your PR, make sure to follow the PR Template providing information about the motivation and highlighting the changes. -11. Reviewers are going to be automatically added to your PR -12. Pull requests will be merged by the maintainers after it passes CI testing and receives approval from one or more reviewers. Merge timing may be impacted by release schedule considerations. +5. If a particular version of the Swift toolchain is needed then update the `.swift-version` file to that version (or use `swiftly use` to update it). +6. Try to keep your changes (when possible) below 200 lines of code. +7. We use [SwiftFormat](https://www.github.com/nicklockwood/SwiftFormat) to enforce code style. Please install and run SwiftFormat before submitting your PR, ideally isolating formatting changes only to code changed for the original goal of the PR. This will keep the PR diff smaller. +8. Commit (include the Radar link or GitHub issue id in the commit message if possible and a description your changes). Try to have only 1 commit in your PR (but, of course, if you add changes that can be helpful to be kept aside from the previous commit, make a new commit for them). +9. Push the commit / branch to your fork +10. Make a PR from your fork / branch to `apple: main` +11. While creating your PR, make sure to follow the PR Template providing information about the motivation and highlighting the changes. +12. Reviewers are going to be automatically added to your PR +13. Pull requests will be merged by the maintainers after it passes CI testing and receives approval from one or more reviewers. Merge timing may be impacted by release schedule considerations. By submitting a pull request, you represent that you have the right to license your contribution to Apple and the community, and agree by submitting the patch From c177d8200c4fb05a73ed2d9c75c73478273a9305 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Tue, 25 Mar 2025 15:11:40 -0400 Subject: [PATCH 2/2] Reveal more details of the swiftly workflow with SwiftPM --- CONTRIBUTING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5b4a690153..3f4f7765816 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,7 +88,13 @@ $> swift --version Apple Swift version 5.3 ``` -Note: Alternatively, there are tools like [swiftly](https://github.com/swiftlang/swiftly) that can instll and manage toolchains automatically. This repository has a file called `.swift-version` that will keep swiftly at the current recommended version of the toolchain for best results. +Alternatively, there are tools like [swiftly](https://github.com/swiftlang/swiftly) that can install and manage toolchains automatically. This repository has a file called `.swift-version` that will keep swiftly at the current recommended version of the toolchain for best results. The `swiftly install` command ensures that SwiftPM's in-use toolchain is installed on your system and ready for you to do your development work with the usual swift commands. + +``` bash +swiftly install +swift build +swift test +``` ## Local Development