-
Notifications
You must be signed in to change notification settings - Fork 114
Work around SwiftSyntax-related warning in CI. #183
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
Merged
Merged
+2
−2
Conversation
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
@swift-ci please test |
1 similar comment
@swift-ci please test |
We are getting a new warning in CI: ``` .../swift-testing/Sources/TestingMacros/ConditionMacro.swift:46:13: warning: let '_sourceLocationLabel' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6 private let _sourceLocationLabel = TokenSyntax.identifier("sourceLocation") ^ ``` Work around it by using `private var ... {}` instead of `private let`. I'm assuming that creating a `TokenSyntax` is not prohibitively expensive, so the change should be safe. We're also getting new errors on macOS: ``` While building module 'std' imported from .../swift-testing/Sources/TestingInternals/WillThrow.cpp:13: In file included from <module-includes>:34: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/complex.h:27: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/ccomplex:21: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/complex:243: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/sstream:191: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/istream:165: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/ostream:168: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/shared_ptr.h:31: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/unique_ptr.h:17: /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__functional/hash.h:154:41: error: reference to unresolved using declaration 154 | (static_cast<uint32_t>(__b) << 8); | ^ /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/cstdint:169:1: note: using declaration annotated with 'using_if_exists' here 169 | using ::uint32_t _LIBCPP_USING_IF_EXISTS; | ^ ``` (And related.) This looks like a toolchain regression; we should be able to work around it by explicitly including C's stdint.h before the C++ headers that use the C types.
e7f050d
to
3f9bbff
Compare
stmontgomery
approved these changes
Jan 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
concurrency
🔀 Swift concurrency/sendability issues
workaround
Workaround for an issue in another component (may need to revert later)
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.
We are getting a new warning in CI:
Work around it by using
private var ... {}
instead ofprivate let
. I'm assuming that creating aTokenSyntax
is not prohibitively expensive, so the change should be safe.@ahoppen confirms that this operation is reasonably cheap and that syntax nodes are not safely sendable in the 5.9 tag of swift-syntax, so the warning is technically valid. Although our code does not access these constants across concurrency domains, the compiler is (in theory) free to invoke our macro expansion code on multiple tasks concurrently.
Concurrency safety in swift-syntax is tracked with swiftlang/swift-syntax#2425.
Checklist: