THRIFT-5655: Fix Swift library build on Swift 6.x and re-enable Swift CI#3586
Closed
Jens-G wants to merge 1 commit into
Closed
THRIFT-5655: Fix Swift library build on Swift 6.x and re-enable Swift CI#3586Jens-G wants to merge 1 commit into
Jens-G wants to merge 1 commit into
Conversation
Client: swift TFileTransport declared fileHandle as an optional UnsafeMutablePointer<FILE> even though it is always non-nil after init. Swift 6's Glibc/Darwin overlays annotate fclose/fread/fwrite as taking a non-optional FILE*, which broke the build on the Swift 6.x toolchain shipped by the ubuntu-24.04 CI runner. - Make TFileTransport.fileHandle a non-optional let (builds clean on Swift 5.7 and 6.1.3) - Re-enable the lib-swift job and add swift back to the cross-test matrix - LANGUAGES.md: Swift tested level 5.7 -> 5.7/6.1 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
THRIFT-5655: Fix Swift library build on Swift 6.x and re-enable Swift CI
The Swift cross-test CI (
lib-swift) was disabled in May 2025 (THRIFT-5864) when theubuntu-24.04runner's bundled Swift toolchain moved to 6.x and the library stopped compiling.Root cause
TFileTransportdeclaredfileHandleas an optionalUnsafeMutablePointer<FILE>?although it is always non-nil after init. Swift 6'sGlibc/Darwinoverlays annotatefclose/fread/fwriteas taking a non-optionalFILE*, so the three call sites failed to compile. (TheCFSocketErrorsymbol named in the original ticket is not an issue on Swift 6.1.3.)Changes
TFileTransport: makefileHandlea non-optionallet— fixes all three call sites at the root, with no platform conditional (correct on both Darwin and Linux).lib-swiftjob and addswiftback to thecross-testmatrix (server + client).LANGUAGES.md: Swift tested level5.7→5.7 / 6.1.Testing
Verified in Docker (Linux):
lib/swiftbuilds clean on Swift 5.7 (37/37) and Swift 6.1.3 (39/39).precross) buildsTestServer+TestClienton 6.1.3.ThriftTestround-trips pass for binary/compact × buffered/framed × ip/domain (client_exit=0).Real Apple-platform (macOS/Xcode) coverage is not part of this PR; the fix is platform-agnostic by construction.
🤖 Generated with Claude Code