Skip to content

Make ConsoleLogger Apple-only for non-Apple builds#10

Open
leogdion wants to merge 2 commits into
mergesort:mainfrom
brightdigit:fix/non-apple-build
Open

Make ConsoleLogger Apple-only for non-Apple builds#10
leogdion wants to merge 2 commits into
mergesort:mainfrom
brightdigit:fix/non-apple-build

Conversation

@leogdion

Copy link
Copy Markdown

Summary

ConsoleLogger imported OSLog unconditionally, which breaks non-Apple builds with no such module 'OSLog' (e.g. Linux). This wraps the whole type — the import, the Logger-backed implementation, and the OSLogType mapping — in #if canImport(OSLog).

The result: ConsoleLogger stays backed by Apple's unified logging system (Console.app / Xcode / OSLog tools) on Apple platforms, and is simply unavailable on platforms without OSLog — no separate code path to maintain.

Notes

Supersedes #7 (recreated from a fresh fork after the prior brightdigit/Broadcast repo was detached from the fork network).

🤖 Generated with Claude Code

ConsoleLogger imported OSLog unconditionally, breaking non-Apple builds
(`no such module 'OSLog'`). Wrap the whole type in `#if canImport(OSLog)`
so it stays OSLog-backed on Apple platforms and is simply unavailable
where OSLog can't be imported (e.g. Linux).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Boutique (Bodega/SQLite/swift-collections) imports CryptoKit, which is
unavailable off Apple platforms. Gate its target dependency to Apple via
`.when(platforms:)` so SwiftPM never compiles it on Linux, and wrap
`MultiSessionLogger` + its test in `#if canImport(Boutique)`. `Log.default`
drops the OSLog-only `ConsoleLogger` where OSLog is absent.

Bump swift-tools to 6.0 (with swiftLanguageModes [.v5]): the library uses
`Synchronization.Mutex` and `Foundation.FormatStyle`, both of which only exist
in the Swift 6.0 toolchain on Linux. The iOS 18 / macOS 15 floor already
requires Swift 6 on Apple, so 5.10 toolchains now get a clean tools-version
error instead of failing deep in the FormatStyle layer.

Verified: `swift build` is green on Linux (swift:6.3) and macOS (6.3.2);
5.10 fails fast with a clear "requires Swift tools 6.0" message.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@leogdion leogdion force-pushed the fix/non-apple-build branch from 3572819 to 012a3a6 Compare June 26, 2026 17:38
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.

1 participant