Skip to content

Commit f8d98f7

Browse files
committed
Restore amazon linux 2 as the release build platform
1 parent 4c5911a commit f8d98f7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/pull_request.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
name: Test
2424
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
2525
with:
26-
# Amazon Linux 2 won't work with GH infrastructure
27-
linux_os_versions: "[\"jammy\", \"focal\", \"rhel-ubi9\", \"noble\", \"bookworm\", \"fedora39\"]"
26+
linux_os_versions: "[\"jammy\", \"focal\", \"rhel-ubi9\", \"noble\", \"bookworm\", \"fedora39\", \"amazonlinux2\"]"
2827
# We only care about the current stable release, because that's where we make our swiftly releases
2928
linux_exclude_swift_versions: "[{\"swift_version\": \"nightly-main\"},{\"swift_version\": \"nightly-6.0\"},{\"swift_version\": \"5.8\"},{\"swift_version\": \"5.9\"},{\"swift_version\": \"5.10\"}]"
3029
linux_pre_build_command: ./scripts/prep-gh-action.sh && ./scripts/install-libarchive.sh
@@ -34,7 +33,7 @@ jobs:
3433
name: Release Build Check
3534
runs-on: ubuntu-latest
3635
container:
37-
image: "swift:6.0-rhel-ubi9"
36+
image: "swift:6.0-amazonlinux2"
3837
steps:
3938
- name: Checkout repository
4039
uses: actions/checkout@v4

Tools/build-swiftly-release/BuildSwiftlyRelease.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public func getShell() async throws -> String {
126126
}
127127
#endif
128128

129-
public func isRHEL9() -> Bool {
129+
public func isAmazonLinux2() -> Bool {
130130
let osReleaseFiles = ["/etc/os-release", "/usr/lib/os-release"]
131131
var releaseFile: String?
132132
for file in osReleaseFiles {
@@ -165,7 +165,7 @@ public func isRHEL9() -> Bool {
165165
return false
166166
}
167167

168-
guard let versionID, versionID.hasPrefix("9"), (id + idlike).contains("rhel") else {
168+
guard let versionID = versionID, versionID == "2", (id + idlike).contains("amzn") else {
169169
return false
170170
}
171171

@@ -287,7 +287,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
287287

288288
func buildLinuxRelease() async throws {
289289
// Check system requirements
290-
guard isRHEL9() else {
290+
guard isAmazonLinux2() else {
291291
// TODO: see if docker can be used to spawn an Amazon Linux 2 container to continue the release building process
292292
throw Error(message: "Linux releases must be made from Amazon Linux 2 because it has the oldest version of glibc for maximum compatibility with other versions of Linux")
293293
}

0 commit comments

Comments
 (0)