Vendored swift-transformers: add Sendable to Hub.Repo / Hub.RepoType (Swift 6 build fix) - #94
Conversation
b31a20c to
92a6b40
Compare
|
Upstream PR approved |
b90f9a4 to
8b020c8
Compare
Under Swift 6 strict concurrency, `Hub.RepoType` and `Hub.Repo` need `Sendable` to cross actor/task boundaries; without it, builds that touch these types from concurrent contexts fail. Both are trivially sendable — a `String`-raw enum and an all-`let` struct of `Sendable` fields. Adds the conformance to the vendored copy so vmlx-swift builds clean under Swift 6 without waiting on an upstream swift-transformers release + vendor bump. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8b020c8 to
958167a
Compare
|
Thanks — the conformance itself is correct ( 1. We don't vendor from 2. The stated symptom doesn't reproduce on If you're hitting this from a downstream package, could you paste the actual compiler error and the context it fires in? If it's real for consumers we should fix it in the fork and re-vendor, which helps everyone rather than just this tree. No objection to the change on its merits — it's the delivery mechanism that needs to move. |
|
Agreed — closing this. Patching the vendored copy is the wrong delivery (a vendor sync would erase it), and on our side it turns out not to be a live break at all: |
Summary
Under Swift 6 strict concurrency,
Hub.RepoTypeandHub.Repo(in the vendoredswift-transformerscopy under
Vendors/) needSendableto cross actor/task boundaries; without it, builds that touchthese types from concurrent contexts fail.
Both are trivially sendable (a
String-raw enum and an all-letstruct ofSendablefields). Thisadds the conformance to the vendored copy so vmlx-swift builds clean under Swift 6 now, without
waiting on an upstream
swift-transformersrelease + a vendor bump.The same fix is now merged upstream at huggingface/swift-transformers#374 (merged 2026-06-28) — so
this vendored stopgap matches the accepted upstream change, and can be dropped on the next vendor sync
that picks it up. No behavior change.