-
Notifications
You must be signed in to change notification settings - Fork 23
Fix Concurrency Warnings in Swift 6 #310
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
# Conflicts: # Source/AwsCommonRuntimeKit/auth/credentials/CredentialsProvider.swift # Test/AwsCommonRuntimeKitTests/XCBaseTestCase.swift # aws-common-runtime/aws-c-common
| //extension Dictionary where Key == String, Value == EndpointProperty { | ||
| // /// Converts EndpointProperty to a dictionary of `String`: `AnyHashable` | ||
| // /// - Returns: Dictionary of `String`: `AnyHashable` | ||
| // func toStringHashableDictionary() -> [String: AnyHashable] { |
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.
The function seems not used. Is it safe to remove it?
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, removed.
| ]) | ||
| ])] | ||
| XCTAssertEqual(expectedProperties, properties) | ||
| // let expectedProperties = [ |
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.
Need clean up?
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, removed.
.github/workflows/ci.yml
Outdated
| sed -i '' 's/swift-tools-version:5\.7/swift-tools-version:6\.0/' Package.swift | ||
| cat Package.swift | head -3 |
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.
if Package.swift doesn't have the exact string swift-tools-version:5.7, this step will just fail silently, which will make it hard to debug and probably leave the CI doesn't do the expected thing for us.
GenAI suggested something like:
Solution 1: Combined sed command with conditional exit
Bash
Copy code
sed -i '' '/swift-tools-version:5\.7/{s/swift-tools-version:5\.7/swift-tools-version:6\.0/;b};q1' Package.swift
This will:
Search for the pattern
If found, make the substitution and branch to end of script (with b)
If not found, exit with code 1 (with q1)
Also, using the exact version seems less future proven. I am not sure if we will ever change the version in the package.swift, but in general, maybe just match all version instead.
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, I have made it more generic so that it works with any 5.xx version and also fails if it can't replace it.
Fixes #185
Description of changes:
This PR fixes a bunch of Swift 6 errors (warnings for pre-Swift 6).
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.