[Ubuntu] Pre-install Static Swift Linux SDK#14164
Open
SimplyDanny wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds installation, verification, and reporting of the Swift Static Linux SDK on Ubuntu images, and refactors the Swift install script to use the swift.org releases API instead of the GitHub releases API.
Changes:
- Refactored
install-swift.shto source Swift version, tag, and Static SDK metadata fromswift.org/api/v1/install/releases.json, install the Static Linux SDK, and exportSWIFT_VERSION/SWIFT_STATIC_SDK_VERSION. - Added software report generation and Pester tests for the Swift Static Linux SDK.
- Updated Ubuntu 22.04 / 24.04 readmes to list the new Swift Static Linux SDK entry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| images/ubuntu/scripts/build/install-swift.sh | Switch to swift.org API, install Static SDK, export new env vars |
| images/ubuntu/scripts/docs-gen/SoftwareReport.Common.psm1 | New Get-SwiftStaticSDKVersion function |
| images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 | Report Static SDK version |
| images/ubuntu/scripts/tests/Common.Tests.ps1 | New tests for swift sdk list and registered SDK |
| images/ubuntu/Ubuntu2204-Readme.md | Added Static SDK entry |
| images/ubuntu/Ubuntu2404-Readme.md | Added Static SDK entry |
Comment on lines
+16
to
+34
| swift_version=$(echo "$swift_releases" | jq -r '.[-1].name') | ||
| if [[ -z "$swift_version" || "$swift_version" == "null" ]]; then | ||
| echo "Unable to determine Swift version" | ||
| exit 1 | ||
| fi | ||
|
|
||
| swift_tag=$(echo "$swift_releases" | jq -r '.[-1].tag') | ||
| if [[ -z "$swift_tag" || "$swift_tag" == "null" ]]; then | ||
| echo "Unable to determine Swift tag" | ||
| exit 1 | ||
| fi | ||
|
|
||
| swift_static_sdk_version=$(echo "$swift_releases" | jq -r '.[-1].platforms[] | select(.platform == "static-sdk") | .version') | ||
| if [[ -z "$swift_static_sdk_version" || "$swift_static_sdk_version" == "null" ]]; then | ||
| echo "Unable to determine Swift Static SDK version" | ||
| exit 1 | ||
| fi | ||
|
|
||
| swift_static_sdk_checksum=$(echo "$swift_releases" | jq -r '.[-1].platforms[] | select(.platform == "static-sdk") | .checksum') |
Author
There was a problem hiding this comment.
I asked about this in the Swift project. I'd like to avoid the complicated sorting if order can just be guaranteed from their end.
3e09bd4 to
06a61b1
Compare
|
I'm not sure what to actually comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Static Swift Linux SDK allows users to compile statically-linked Linux binaries. Consumers can directly run them without runtime dependencies. It's pretty common that command-line tools are (additionally) distributed like that.
Action users need to install the SDK as one of their first build steps as of now. That's normally pretty fast. However, the difficulty is to install the right SDK version for the pre-installed Swift version. Which version to use is not obvious without checking the image documentation and therefore requires some effort.
The unpacked SDK is 1.1 GB in size at the moment.
As a preparation for the SDK installation, I also refactored the script so that it uses the official swift.org API to retrieve the latest release. That's a separate commit.
Check list