Skip to content

Fixing WatchOS Support and Non-Apple Builds#6

Closed
leogdion wants to merge 9 commits into
mergesort:mainfrom
brightdigit:atleast-beta.6
Closed

Fixing WatchOS Support and Non-Apple Builds#6
leogdion wants to merge 9 commits into
mergesort:mainfrom
brightdigit:atleast-beta.6

Conversation

@leogdion

@leogdion leogdion commented Jun 23, 2026

Copy link
Copy Markdown

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 / tvOS / visionOS added to the platform list (watchOS 11.0, tvOS 18.0, visionOS 2.0), matching the floor required by Synchronization.Mutex.
  • ConsoleLogger is 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.

MultiSessionLogging package trait

Boutique's dependency chain (Bodega / SQLite / swift-collections) does not declare watchOS, and Bodega's URL.documentsDirectory / .cachesDirectory usage fails to compile when a build assigns those targets a watchOS floor below 9.0. To keep the watch build clean:

  • MultiSessionLogger and its tests are now guarded by #if MultiSessionLogging.
  • A new Package@swift-6.1.swift manifest declares a MultiSessionLogging trait (default OFF). With the trait off, SwiftPM prunes Boutique from the dependency graph entirely, so Bodega never compiles and Boutique stays out of Package.resolved. Consumers who want cross-launch persistence opt in by enabling the trait.
  • The swift-tools-version:5.10 Package.swift is the fallback for older toolchains (traits require 6.1+): it carries no Boutique dependency, and MultiSessionLogger compiles 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 existing static var globals into hard concurrency errors).

Documentation

  • Restored the swift-docc-plugin dependency 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 the Broadcast product, so it does not reintroduce the watchOS graph concern.
  • Removed WATCHOS_SUPPORT.md; the relevant guidance has been migrated into the manifest comments and the broader docs.

Build matrix

  • Default build (trait off): dependency-free aside from the docc build-tool plugin — clean on watchOS and non-Apple platforms.
  • Trait on: full MultiSessionLogger with Boutique-backed persistence on Apple platforms.

mergesort and others added 7 commits June 16, 2026 21:25
…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>
@leogdion leogdion changed the title Fixing WatchOS Support Fixing WatchOS Support and Non-Apple Builds Jun 24, 2026
leogdion and others added 2 commits June 24, 2026 10:23
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>
@leogdion

Copy link
Copy Markdown
Author

Closing as superseded. This combined PR has been split into two focused, rebased PRs from the re-forked brightdigit/Broadcast: #9 (watchOS support via the MultiSessionLogging package trait) and #10 (ConsoleLogger Apple-only). Together they reproduce this PR's state on top of current main.

@leogdion leogdion closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants