Add explicit swift-nio dependency for Xcode 26 transitive dylib bug#18
Merged
mattt merged 2 commits intomattt:mainfrom Mar 2, 2026
Merged
Conversation
Owner
|
Gosh, this again? Looks like I'd do well to go through every project I have using But seriously, thank you for reporting huggingface/swift-xet#6 and opening this PR. I really appreciate it! |
Owner
|
@stovak Looks like this is failing the lint check. I tried applying a fix to your PR branch but got a 403. Can you please run |
Contributor
Author
|
@mattt done. Thank my intern, Claude. 😉 |
Owner
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Xcode 26 introduced a regression in Swift Package Manager builds where packages built as dynamic frameworks don't properly propagate transitive framework dependencies during the link phase.
Symptoms
When EventSource is built with the AsyncHTTPClient trait enabled, the build fails with:
Root Cause
*.framework)NIOCore(via inlined code fromAsyncHTTPClient)Package.swiftdoesn't declareswift-nioas a direct dependencyasync-http-client, which itself depends onswift-nioNIOCore.frameworkintoAsyncHTTPClient.frameworkEventSource.frameworkEventSource.oreferences NIOCore symbols but the framework doesn't link against itSolution
Add explicit package-level and target-level dependencies for
swift-nioto ensure Xcode 26 can link the framework correctly.Changes
.package(url: "https://github.com/apple/swift-nio.git", from: "2.81.0")to package dependencies.product(name: "NIOCore", package: "swift-nio")toEventSourcetarget dependenciesImpact
NIOCorewas already available transitively throughAsyncHTTPClientTesting
Verified that this fixes builds for projects using EventSource with the AsyncHTTPClient trait as a transitive dependency under Xcode 26.
Previously failed with undefined symbols, now builds and links correctly.
Notes
Related Issue: This is a workaround for an Xcode 26 regression. Ideally Apple would fix the SPM dylib linking behavior, but adding explicit dependencies is a reasonable defensive practice regardless.