-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Tests: Update isAmazonLinux2() logic #8932
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
Conversation
@swift-ci test |
f8ac291
to
1319817
Compare
I pushed a change that update the tests to add coverage with difference scenarios. @swift-ci test |
@swift-ci test windows |
let id = line.replacingOccurrences(of: "ID=", with: "").trimmingCharacters(in: .whitespacesAndNewlines) | ||
if id == "amzn" { // ID for Amazon Linux is "amzn" | ||
do { | ||
let nameRegex = try Regex("PRETTY_NAME=\"?Amazon Linux 2.*\"?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you just do an exact match without the regex -- as is, this will incorrectly match Amazon Linux 2023 (due to the greedy match), which is the next version of Amazon Linux that the Swift project will later switch to, and notably does not have the posix_spawn issues that cause us to special case AL2 in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather have this merged now and edge cases dealt with later in separate PRs. This PR is blocking toolchain builds and AL2 failures is one of the reasons we don't have published toolchains since 22nd of June.
This PR is blocking development snapshot toolchain builds
HOME_URL="https://amazonlinux.com/" | ||
SUPPORT_END="2026-06-30" | ||
""", | ||
expected: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is AL2023:
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023.6.20250107"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/amazon-linux-2023/"
DOCUMENTATION_URL="https://docs.aws.amazon.com/linux/"
SUPPORT_URL="https://aws.amazon.com/premiumsupport/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
VENDOR_NAME="AWS"
VENDOR_URL="https://aws.amazon.com/"
SUPPORT_END="2028-03-15"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkhouri the cross-repo job is still failing: https://ci.swift.org/job/swift-PR-toolchain-amazonlinux2/79/console
18:46:28 ✘ Test run with 499 tests in 91 suites failed after 1168.385 seconds with 99 issues (including 88 known issues).
Removing requested changes marker in case there's a need to force merge
1319817
to
0afa319
Compare
@swift-ci test |
0afa319
to
9ed71f0
Compare
@swift-ci test |
I ran cross-repository testing |
@swift-ci test windows |
The ProcessInfo extension to determine if a host is running on Amazon Linux 2 was slightly flawed as it did not take into account the double-quote (") surrounding the values. Update the logic to look at "PRETTY_NAME" since the ID can be used in multiple Amazon Linux OS'es, and use exact logic match. issue: rdar://155612963
9ed71f0
to
263e883
Compare
I ran cross-repository testing
@swift-ci test |
@swift-ci test windows |
@swift-ci test self hosted windows |
@swift-ci test self hosted windows |
1 similar comment
@swift-ci test self hosted windows |
@swift-ci test windows self hosted |
@swift-ci test self hosted windows |
Merging to unblock toolchain builds |
The ProcessInfo extension to determine if a host is running on Amazon Linux 2 was slightly flawed as it did not take into account the double-quote (") surrounding the values.
Update the logic to look at "PRETTY_NAME" since the ID can be used in multiple Amazon Linux OS'es, and use exact logic match.
issue: rdar://155612963