Add watchOS support via a MultiSessionLogging package trait#8
Closed
leogdion wants to merge 1 commit into
Closed
Conversation
Declare watchOS/tvOS/visionOS platform floors (matching Synchronization.Mutex) and gate MultiSessionLogger + its Boutique backing behind a new `MultiSessionLogging` package trait (default OFF): - Package@swift-6.1.swift declares the trait and gates the Boutique product with `.when(traits:)`; swiftLanguageModes: [.v5] keeps Swift 5 semantics so the manifest only adds the trait. - Package.swift (tools-5.10 fallback) drops the Boutique dependency. - MultiSessionLogger.swift and its test are wrapped in `#if MultiSessionLogging`; the suite/tests carry a `.requiresMultiSessionLogging` condition trait. With the trait off, SwiftPM prunes Boutique (Bodega/SQLite/swift-collections), so the watch build never compiles Bodega. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
24645bc to
f294a28
Compare
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.
Summary
Makes Broadcast build cleanly on watchOS (and tvOS/visionOS) by declaring those platforms and isolating the Boutique-backed
MultiSessionLoggerbehind a package trait, so it never burdens the default build.Changes
Platform support
watchOS 11.0,tvOS 18.0,visionOS 2.0floors (matching the floor required bySynchronization.Mutex).MultiSessionLoggingpackage traitBoutique's dependency chain (Bodega / SQLite / swift-collections) does not declare watchOS, and Bodega's
URL.documentsDirectory/.cachesDirectoryusage fails to compile when a build assigns those targets a watchOS floor below 9.0. To keep the watch build clean:MultiSessionLoggerand its tests are guarded by#if MultiSessionLogging.Package@swift-6.1.swiftmanifest declares aMultiSessionLoggingtrait (default OFF), gating the Boutique product with.when(traits:). With the trait off, SwiftPM prunes Boutique from the dependency graph entirely, so Bodega never compiles and Boutique stays out ofPackage.resolved. Consumers who want cross-launch persistence opt in by enabling the trait.swiftLanguageModes: [.v5]keeps the 6.1 manifest in Swift 5 language mode, so it only adds the trait rather than also flipping the package into Swift 6 mode (which would turn the existingstatic varglobals into hard concurrency errors).swift-tools-version:5.10Package.swiftis the fallback for older toolchains (traits require 6.1+): it carries no Boutique dependency, andMultiSessionLoggercompiles to nothing there because the trait flag is never set.MultiSessionLoggertests stay declared so they appear in reports, and carry a.requiresMultiSessionLoggingcondition trait that disables them when the trait is off.Notes
This is one half of a split of #6. The companion PR (#7) makes
ConsoleLoggerApple-only; both together reproduce #6's state.🤖 Generated with Claude Code