-
Notifications
You must be signed in to change notification settings - Fork 130
more Sendable conformances & Sendable Context #381
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 please test |
We don't promise a stable API at this point, so API breakage is acceptable. We'd need to adopt any potential clients in the toolchain, of course. |
Yes, I'd tag it as |
24264ef
to
48bcea1
Compare
@swift-ci please test |
} | ||
|
||
@available(*, deprecated, message: "Values should be Sendable") | ||
@_disfavoredOverload |
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.
one of my favorite tricks :)
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.
@jakepetroules at some point we'll need @_overloadFavouriteness(10)
if we have need more than one level ;)
Sources/TSCUtility/Tracing.swift
Outdated
@@ -135,8 +135,24 @@ public struct TracingEvent: TracingEventProtocol, Codable { | |||
#endif | |||
} | |||
|
|||
public class TracingCollection: TracingCollectionProtocol { | |||
public var events: [TracingEventProtocol] = [] | |||
public final class TracingCollection: TracingCollectionProtocol, @unchecked Sendable { |
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.
@unchecked because of NSLock? (if so, can add a comment?) Do we have a Lock implementation in TSC which is sendable, that we could use 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.
It's unchecked because it's manually synchronised with the lock. Even if the lock itself is sendable, the compiler can't check that you've used it correctly.
The only way to get that is to use something like NIOLockedValueBox<[TracingEventProtocol>]
but that's not available here.
Looks like the macOS failures are all about the changes? |
48bcea1
to
e28cadb
Compare
@swift-ci please test |
@neonichu Yes, that's an old Foundation SDK which doesn't have enough Sendable annotations. Which SDK is this using? |
@weissi I believe the Xcode installed on Swift CI is still 13A5201i, so that would mean macOS 12.0 (21A5294d). @shahmishal to double check. |
e28cadb
to
2687983
Compare
@neonichu thanks, yeah, that's old. I removed the Sendables that are currently problematic because that Xcode also doesn't understand |
@swift-ci please test |
@neonichu / @jakepetroules Could we upgrade the CI? It seems ridiculously old:
it doesn't know about |
So far I've used |
Sure, but So yes, I know I could put in hacks to work around this, this really shouldn't be necessary, right? |
AFAIR we're keeping SwiftPM compatible with older Swift versions on purpose, since Thanks for linking to that proposal, based on that |
Yes, we can definitely not target 5.8 only. It's also not just about There's also the practical issue that Swift CI has 13A5201i installed, so we have to stay compatible with that for the time being. If that gets upgraded to a 14.x era Xcode, we could discuss requiring 5.7 |
Based on @neonichu's comments just above, can you add |
2687983
to
df024d4
Compare
@swift-ci please test |
@neonichu I'm hitting this linker error (CC @jakepetroules / @MaxDesiatov )
which is
a bug in either Swift or SwiftPM not managing to link |
28b332b
to
fddc6ab
Compare
@swift-ci please test |
fddc6ab
to
94f785d
Compare
@swift-ci please test |
0f6e796
to
5d52087
Compare
@swift-ci please test |
5d52087
to
48bcda3
Compare
@swift-ci please test |
48bcda3
to
61f074b
Compare
@swift-ci please test |
61f074b
to
b4b4ed5
Compare
@swift-ci please test |
b4b4ed5
to
faa5880
Compare
@swift-ci please test |
faa5880
to
f5beeba
Compare
@swift-ci please test |
@swift-ci please test |
1 similar comment
@swift-ci please test |
f5beeba
to
bba2979
Compare
@swift-ci please test |
bba2979
to
c9785f8
Compare
@swift-ci please test |
Technically API breaking:
public typealias Context = Dictionary<...>
forpublic struct Context
HashingAlgorithm
andTracingEvent(Collection)
to beSendable