Skip to content

[Ubuntu] Pre-install Static Swift Linux SDK#14164

Open
SimplyDanny wants to merge 2 commits into
actions:mainfrom
SimplyDanny:swift-linux-sdk
Open

[Ubuntu] Pre-install Static Swift Linux SDK#14164
SimplyDanny wants to merge 2 commits into
actions:mainfrom
SimplyDanny:swift-linux-sdk

Conversation

@SimplyDanny

Copy link
Copy Markdown

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

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

Copilot AI review requested due to automatic review settings May 26, 2026 23:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh to source Swift version, tag, and Static SDK metadata from swift.org/api/v1/install/releases.json, install the Static Linux SDK, and export SWIFT_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 thread images/ubuntu/scripts/tests/Common.Tests.ps1 Outdated
Comment thread images/ubuntu/scripts/docs-gen/SoftwareReport.Common.psm1 Outdated
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')

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nsabedra27-glitch

Copy link
Copy Markdown

I'm not sure what to actually comment

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

Successfully merging this pull request may close these issues.

3 participants