Fixing WatchOS Support and Non-Apple Builds#6
Closed
leogdion wants to merge 9 commits into
Closed
Conversation
…se local path Switch the Broadcast dependency from the remote URL to the vendored subrepo at Packages/Broadcast (brightdigit/Broadcast @ atleast-beta.6), eliminating the branch-based remote clone that xcodebuild could not resolve. Trim the fork to be dependency-free: remove MultiSessionLogger (and its test), which is the only consumer of Boutique. Boutique's chain (Bodega / SQLite.swift / swift-collections) declares no watchOS platform, so Tuist generated those targets with WATCHOS_DEPLOYMENT_TARGET=8.0 and the watchOS build failed. AtLeast uses ConsoleLogger + SessionLogger only, so dropping the persistence layer is free. Declare watchOS/tvOS/visionOS platforms (Synchronization.Mutex floors) so Broadcast builds on the watch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…adcast [skip ci] Move the reusable docs out of AtLeast's private .claude/docs into the libraries that own the code (subrepo-pushed upstream) so the knowledge travels with it: - WATCH_COMMS_RELIABILITY.md → Packages/SundialKitStream/ (now framed around SnapshotSync; folds in the connectivity glossary terms). - DEVICE_DEBUGGING.md generic recipes (devicectl/LLDB/tunnel flakes) → Packages/SundialKitStream/DEBUGGING.md; AtLeast keeps make-logs/AppLog, the test-toolchain note, and device IDs + a pointer to the generic doc. - BROADCAST_WATCHOS_SUPPORT.md → Packages/Broadcast/WATCHOS_SUPPORT.md. - GLOSSARY.md Connectivity Terms → pointer to the migrated doc. - STARTING_ON_WATCH_BUG.md deleted (resolved in PR #190; durable lessons live in the migrated reliability + debugging docs). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ConsoleLogger imported OSLog unconditionally, breaking the Linux CI build (`no such module 'OSLog'`). Wrap the import, the Logger-backed storage, and the OSLogType mapping in `#if canImport(OSLog)`; on platforms without OSLog, fall back to printing the same recordFormatter output to stdout. The type stays public everywhere, so Log.consoleLogger / Log.default and the test reference keep compiling. Verified on swift:6.1 Ubuntu (build + 57 tests pass). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Revert the earlier trim (4f0dc17). The watchOS build failure that motivated dropping MultiSessionLogger — Boutique's chain (Bodega/SQLite/swift-collections) generating WATCHOS_DEPLOYMENT_TARGET=8.0 — was an Xcode 27 beta artifact; under beta 2 those targets build at watchOS 9.0 and the watch app builds cleanly, so the persistence layer can come back. - Restore Sources/Broadcast/Loggers/MultiSessionLogger.swift and its test - Re-add the Boutique dependency (package + product on Broadcast/BroadcastTests) - Keep the watchOS/tvOS/visionOS platform floors; note the beta-only override path in the header in case the deployment-target bug resurfaces Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
MultiSessionLogger is the only Boutique consumer, and Boutique's chain (Bodega/SQLite/swift-collections) declares no watchOS platform. When a build assigns those platform-less targets a watchOS floor below 9.0 (Xcode-version dependent — CI's Xcode 26.6 picks 4.0), Bodega's URL.documentsDirectory usage fails to compile, breaking the watchOS AtLeastKit-Package build; on Linux the added boutique dependency also broke --force-resolved-versions. Put MultiSessionLogger + Boutique behind a new `MultiSessionLogging` trait, default OFF, so the dependency is pruned from the graph unless opted in: - Package.swift stays at tools-5.10 and is now dependency-free (fallback for toolchains < 6.1; MultiSessionLogger compiles to nothing there). - New Package@swift-6.1.swift declares the trait and gates the Boutique product with `.when(traits:)`. swiftLanguageModes: [.v5] keeps Swift 5 semantics so the 6.1 manifest only adds the trait (otherwise Log.swift's static globals become hard concurrency errors). - MultiSessionLogger.swift and its test are wrapped in `#if MultiSessionLogging`. Verified: watchOS Simulator build/test (Xcode 26.6) and Linux build/test (swift:6.3-noble) both green with Boutique/Bodega pruned. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The CI "Validate documentation" step runs `swift package generate-documentation`, which failed with "Unknown subcommand or plugin name 'generate-documentation'" after the fork dropped all package dependencies. Restore swift-docc-plugin in both manifests; it is a build-tool plugin that never links into the Broadcast product, so it does not reintroduce the Boutique/watchOS graph concern. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wrap the entire ConsoleLogger in `#if canImport(OSLog)` so it is simply unavailable on platforms without OSLog, rather than carrying a separate standard-output code path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep the suite and tests always declared so they appear in test reports, and attach a `.requiresMultiSessionLogging` condition trait that disables them when the package trait is off (the Boutique-backed `MultiSessionLogger` is not compiled in that build). The trait-only code is guarded with `#if MultiSessionLogging` inside each test, and the `#else` branch records an issue so a run without the trait can't pass silently. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 25, 2026
This was referenced Jun 26, 2026
Author
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 non-Apple platforms, and isolates the Boutique-backed multi-session logger behind a package trait so it never burdens the default build.
Changes
Platform support
watchOS 11.0,tvOS 18.0,visionOS 2.0), matching the floor required bySynchronization.Mutex.ConsoleLoggeris Apple-only. The whole type is wrapped in#if canImport(OSLog), so it stays backed by the unified logging system (Console.app / Xcode / OSLog tools) on Apple platforms and is simply unavailable on platforms without OSLog (e.g. Linux) — no separate code path to maintain.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 now guarded by#if MultiSessionLogging.Package@swift-6.1.swiftmanifest declares aMultiSessionLoggingtrait (default OFF). 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.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.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).Documentation
swift-docc-plugindependency in both manifests so the CI "Validate documentation" step (swift package generate-documentation) keeps working. It is a build-tool plugin and never links into theBroadcastproduct, so it does not reintroduce the watchOS graph concern.WATCHOS_SUPPORT.md; the relevant guidance has been migrated into the manifest comments and the broader docs.Build matrix
MultiSessionLoggerwith Boutique-backed persistence on Apple platforms.