[codex] Remove Chary dependency - #27
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 3 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c3fc4a3c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| init(_ queue: DispatchQueue) { | ||
| self.queue = queue | ||
| queue.setSpecific(key: specificKey, value: ()) |
There was a problem hiding this comment.
Clear queue-specific data before releasing the key
When a resolver is replaced or deallocated while its supplied queue remains alive, this executor releases specificKey without removing the queue's associated value. DispatchSpecificKey identities can then be reused by a later executor, causing getSpecific to find the stale value while running on the old queue and incorrectly execute work inline instead of synchronously on the newly configured queue. This can violate resolveOn: isolation, including running main-queue work off-main; clear the specific value from queue before the key is destroyed.
Useful? React with 👍 / 👎.
Problem
Chary is deprecated and its
safeSynchelper is no longer a suitable dependency for SwiftEnvironment.Solution
DispatchQueueExecutorthat uses queue-specific context to avoid nested synchronous dispatch deadlocks.GlobalEnvironment.Impact
Consumers no longer transitively depend on Chary. Existing resolver queue behavior remains intact while nested queue access stays deadlock-safe.
Validation
xcrun swift buildxcrun swift test(20 tests, 0 failures)git diff --checkswift package show-dependenciesonly listsswift-syntax