Fix Xcode 27 build and runtime failures - #547
Merged
Merged
Conversation
Swift 6.3 adds the NoUseUnstructuredThrowingTask diagnostic and rejects retroactive Sendable conformances. Combined with the package's -warnings-as-errors flag, these broke the build in several places: - AsyncButton, VaultItemOnTapDecoratorViewGenerator and VaultItemFeedView discarded throwing unstructured Tasks. Errors were already deliberately swallowed at these sites, so the discard is now explicit via `try?`. - IntervalTimerTests and PendingValueTests did the same. The timer tests now record an Issue so a throw fails the test; PendingValue's task is cancelled by the test itself, so its throw stays ignored. - VaultItemPreviewViewGeneratorMock's VaultItemCopyActionHandler conformance required a retroactive Sendable conformance. It had no callers — every site passes VaultItemCopyActionHandlerMock — so the extension is removed. - VaultDetailEncryptionEditView assigned through the @State wrappedValue setter before self was fully initialized. Now uses State(initialValue:). Data.asType also crashed at runtime. UnsafeRawBufferPointer.load(as:) requires T-aligned memory and Data makes no alignment guarantee for its backing buffer, which the Swift 6.3 runtime now traps on. This took out the HOTP and TOTP suites entirely. Switched to loadUnaligned(as:). Co-Authored-By: Claude Opus 5 (1M context) <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.
Makes the package build and pass its full test suite under Xcode 27 (Swift 6.3). CI is deliberately left on
macos-26/ Xcode 26.6 / iOS 26.5 — every change here is valid Swift 6.0 and compiles on both toolchains.Build failures
Swift 6.3 adds the
NoUseUnstructuredThrowingTaskdiagnostic and rejects retroactiveSendableconformances. Against the package's-warnings-as-errorsflag, those became hard errors:AsyncButton,VaultItemOnTapDecoratorViewGenerator,VaultItemFeedViewdiscarded throwing unstructuredTasks. Errors were already deliberately swallowed at these sites, so the discard is now explicit viatry?with a comment recording why.IntervalTimerTests,PendingValueTestsdid the same. The timer tests nowIssue.record(error)so a throw actually fails the test;PendingValue's task is cancelled by the test itself, so its throw stays ignored.VaultItemPreviewViewGeneratorMock'sVaultItemCopyActionHandlerconformance required a retroactiveSendableconformance. It had no callers — every site passesVaultItemCopyActionHandlerMock— so the extension is removed rather than reaching for@unchecked Sendable, which.swiftlint.ymlbans.VaultDetailEncryptionEditViewassigned through the@StatewrappedValue setter beforeselfwas fully initialized. Now usesState(initialValue:).Runtime crash
Data.asTypeusedUnsafeRawBufferPointer.load(as:), which requiresT-aligned memory.Datamakes no alignment guarantee for its backing buffer — a slice can start at any byte offset — and the Swift 6.3 runtime traps on it. This crashedOTPAuthCodeTestsandDataHelpersTestsoutright and took 7 HOTP/TOTP tests with them. Switched toloadUnaligned(as:).Worth landing independently of the Xcode 27 question: this was live undefined behaviour on 26.6 too, it just happened not to trap.
Verification
Run locally on Xcode 27.0 RC1 (
27A266a), iPhone 17 Pro / iOS 26.5 perVault/README.md:xcodebuild build-for-testing—TEST BUILD SUCCEEDED-parallel-testing-enabled NO—TEST EXECUTE SUCCEEDED, 13 bundles across both Default and TSAN configurations, 0 failuresVaultAppwrapper —BUILD SUCCEEDEDmake format+make lint— cleanFollow-up
Bumping CI to Xcode 27 is blocked on runner availability:
macos-26tops out at 26.6, and the only image carrying Xcode 27 is the betaxcode-27(pinned to beta 6, iOS 27.0 runtime only). Moving there would force the snapshot simulator to iOS 27.0 — bumping the guard constant inAssertSnapshotWithDeviceCheck.swift:9, updating the README, and regenerating 248 reference images. Left for when Xcode 27 reaches the GA runner image.🤖 Generated with Claude Code