Skip to content

[codex] Remove Chary dependency - #27

Merged
hainayanda merged 1 commit into
mainfrom
codex/remove-chary-dependency
Jun 13, 2026
Merged

[codex] Remove Chary dependency#27
hainayanda merged 1 commit into
mainfrom
codex/remove-chary-dependency

Conversation

@hainayanda

Copy link
Copy Markdown
Owner

Problem

Chary is deprecated and its safeSync helper is no longer a suitable dependency for SwiftEnvironment.

Solution

  • Remove Chary from the SwiftPM manifest and library target.
  • Add an internal DispatchQueueExecutor that uses queue-specific context to avoid nested synchronous dispatch deadlocks.
  • Update global environment access and instance resolvers to use the internal executor.
  • Handle main-thread execution directly in GlobalEnvironment.
  • Add a regression test covering nested synchronization on the configured queue.

Impact

Consumers no longer transitively depend on Chary. Existing resolver queue behavior remains intact while nested queue access stays deadlock-safe.

Validation

  • xcrun swift build
  • xcrun swift test (20 tests, 0 failures)
  • git diff --check
  • Confirmed swift package show-dependencies only lists swift-syntax

@hainayanda
hainayanda marked this pull request as ready for review June 13, 2026 09:19
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 3 duplication

Metric Results
Complexity 0
Duplication 3

View in Codacy

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.

@hainayanda
hainayanda merged commit 001a253 into main Jun 13, 2026
3 checks passed
@hainayanda
hainayanda deleted the codex/remove-chary-dependency branch June 13, 2026 09:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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: ())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant