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

Add Xcode 14.3 / Swift 5.8 #2306

Closed
36 tasks done
finestructure opened this issue Mar 22, 2023 · 6 comments
Closed
36 tasks done

Add Xcode 14.3 / Swift 5.8 #2306

finestructure opened this issue Mar 22, 2023 · 6 comments
Assignees

Comments

@finestructure
Copy link
Member

finestructure commented Mar 22, 2023

Add a new Swift version (major or minor)

This guide assumes that an older Swift version is removed when adding a new one. This makes the process less cumbersome, because updating the test expectations in the Server package (of which there are a number) is easier if one just shuffles Swift version numbers around without having to add and remove versions separately.

Update SPIManifest

Preconditions: None.

This can be done at any time. It only takes effect once the adopting packages (Server and Builder) update to this version.

Example change: https://github.com/SwiftPackageIndex/SPIManifest/pull/28/files

Update setup-swift GH action

Preconditions: Swift 5.8 available (Xcode and Ubuntu release)

Example change: https://github.com/SwiftPackageIndex/setup-swift/pull/1/files

Update PackageList

Preconditions:

Example change: https://github.com/SwiftPackageIndex/PackageList/pull/3797/files

Update PackageList-Validator

Preconditions:

  • new Swift docker image available (automatically ensured by package CI)
  • setp Update setup-swift GH action

This ensures via the CI build that the validator binary which is built in the PackageList repository can be built successfully with the latest Swift version.

Example change: https://github.com/SwiftPackageIndex/PackageList-Validator/pull/41/files

Update spi-images

Preconditions: new Swift docker image available (automatically ensured by package CI)

The images don't need to be tagged, as they are automatically picked up via their .../spi-images:basic-5.8-latest tag.

Example change: https://gitlab.com/finestructure/spi-images/-/merge_requests/3/diffs

Update builder machines

Preconditions: new Xcode version available

  • Install the Xcode version on all macOS builders
  • Set a runner tag for the new version swift-x.y in builder CI/DC

Update Builder

Preconditions:

  • step Update builder machines

  • step Update spi-images

  • Update to new SPIManifest version and address all issues arising from non-exhaustive switch statements.

  • Update Makefile to build and test with new Xcode version

  • Update .gitlab-ci-builder.yml: add/remove build <platform> <swift-version> blocks.

  • Update .gitlab-ci-testmatrix.yml: add/remove new test <platform> <swift-version> jobs

  • Merge https://gitlab.com/finestructure/swiftpackageindex-builder/-/merge_requests/196

Example change: https://gitlab.com/finestructure/swiftpackageindex-builder/-/merge_requests/196/diffs

Update spi-base

Preconditions: new Swift docker image available (automatically ensured by package CI)

Example change: https://gitlab.com/finestructure/spi-base/-/merge_requests/12/diffs

Update Server

Preconditions:

  • step Update Builder

  • step Update spi-base

  • Update SPIManifest dependency

  • Update spi-base to newly tagged version

  • Update SwiftVersion+Build.swift and adjust to changes

  • Update PackageShow.Model.SwiftVersionResults and adjust to changes

  • Ensure any new SupportedPlatform keys are added to our matching Manifest.Platform.Name enum so we don’t fail to decode package manifests that use them. (See issue 1441 for details.)

  • Merge Swift 5.8 #2313

  • set BUILD_TRIGGER_LATEST_SWIFT_VERSION_DOWNSCALING to 0.2

  • Deploy

Example change: https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/pull/2313/files

Delete old Swift version builds

Preconditions: New server (one that doesn't trigger the Swift version to be deleted) has been deployed

Nothing needs to be done with respect to database content when adding a new version.

When removing Swift versions, it's important to remove its builds from the builds table, because the total count of builds per version is used as a trigger signal. (See #1267 (comment) for details.)

  • Delete outdated builds
    • dev
    • prod

Example SQL:

delete
from builds
where
swift_version->'major' = '5'
and swift_version->'minor' = '4'

This should be run once the new Server has been deployed. Running it too early will lead to the deleted versions being triggered again. It's harmless but wastes build resources.

Deleting the records too long after deployment will inhibit triggering of the new Swift versions, because the presence of the old records will make the build result set appear to be complete. This is also harmless, as these will then be triggered once the deletion has happened.

Post deployment

Preconditions: all the above steps have been completed, not time critical

@daveverwer
Copy link
Member

Either as part of this or as a separate stage afterwards, we can remove Swift 5.4, which would free up mb3 to become a Ventura build machine and mean we only have to maintain two different macOS versions rather than three.

@finestructure
Copy link
Member Author

We should do this while adding 5.8. It makes adjusting all the test expectations easier when we're just shuffling them around. Otherwise we'll have to do considerable structural changes twice.

@ahmdyasser
Copy link

@finestructure Can I work on that?

@finestructure
Copy link
Member Author

Thanks for your offer to help out with this one, @ahmdyasser!

This is probably one of the fiddliest things we do twice a year and it has to be me who does it, I'm afraid 😅

However, we do still have a couple of good first issues that might be a great way to contribute. Would one of those interest you?

@finestructure finestructure self-assigned this Mar 29, 2023
@finestructure
Copy link
Member Author

All the prep work is done. We're ready when Xcode-14.3 and swift:5.8-focal drop.

@finestructure
Copy link
Member Author

Swift 5.8 processing is under way. Remaining todos tracked here: #2323

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