Skip to content

drift/03: StrandAnalytics builds and tests on Linux - #19

Merged
bhelm merged 3 commits into
drift/metafrom
drift/03-linux-enablement
Aug 18, 2026
Merged

bhelm merged 3 commits into
drift/metafrom
drift/03-linux-enablement

Conversation

@bhelm

@bhelm bhelm commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Plan step 3 of #17: with a snapshot-enabled SQLite, Packages/StrandAnalytics builds and runs its full test suite on Linux. This opens the differential-harness path (#17 step 4) and lets Linux contributors run swift test on the analytics package at all.

What's in here (three commits, one concern each)

  1. Gates — behavior-neutral on Darwin by construction: RawOutbox.swift entirely behind #if canImport(Compression) (self-contained file, zero package-internal references); BackupSettings.isBoolean keeps the CF type check on Darwin and uses the objCType "c" encoding elsewhere (the code corelibs' own JSONSerialization boxes booleans with — the theoretical Int8 ambiguity is documented at the site and unreachable from JSON input); the XCTExpectFailure-wrapped [hrv] classifyCoverage has a ceiling and no floor, so an under-covered night reads as plausible ryanbr/noop#977 contract test skips via XCTSkip on corelibs-XCTest. Plus two unused WhoopStore imports dropped in test files.
  2. docs/LINUX.md — toolchain, system packages, and the checksum-verified SQLite amalgamation built with SQLITE_ENABLE_SNAPSHOT into a private directory, selected per build via -Xlinker -L and LD_LIBRARY_PATH. Explicit warning against installing it into a system library path (it would override the distribution SQLite for every process on the host — learned the hard way).
  3. CI — one ubuntu-24.04 job in swift-packages.yml: SHA-256-verified amalgamation build (cached, recipe revision in the key), then swift build + swift test for StrandAnalytics. Actions SHA-pinned like the existing jobs; macOS jobs untouched.

Verification

Known limits

  • The standalone WhoopStore test target references the gated raw-outbox API and does not compile on Linux (its library build is unaffected; StrandAnalytics' suite — including the GRDB-backed integration tests — is what runs). Gating those three test files is a possible follow-up.
  • The sqlite.org download URL in CI could not be exercised offline; if the year path is wrong the job fails loudly on the download step.

Review

Codex review (read-only, independent): verdict yellow, four findings — all addressed or consciously kept: Int8/bool ambiguity documented at the site (unreachable from JSON); cache key now carries a build-recipe revision; LINUX.md gained the concrete checksum-verified 3.53.4 recipe; the two import drops are kept and declared as cleanup in the commit message. Confirmed clean: Darwin neutrality of all gates, no production references to the gated raw-outbox API, CI job isolation.

Part of the drift-control plan in #17.

🤖 Generated with Claude Code

bhelm and others added 3 commits August 18, 2026 01:45
Three gates, behavior-neutral on Darwin by construction:
- RawOutbox.swift compiles only where Compression exists (the file is
  self-contained; nothing else in WhoopStore references it);
- BackupSettings.isBoolean uses the CF type check on Darwin and the
  objCType encoding ("c") elsewhere — the code the corelibs
  JSONSerialization itself boxes booleans with; the Int8 ambiguity of
  that code is documented at the site and unreachable from JSON input;
- the XCTExpectFailure-wrapped ryanbr#977 contract test skips via XCTSkip on
  corelibs-XCTest, which does not provide XCTExpectFailure.

Also drops two unused WhoopStore imports in StrandAnalytics tests
(cleanup while touching the suite; behavior-neutral).

With a snapshot-enabled SQLite, Packages/StrandAnalytics now builds and
tests on Linux: 1424 tests, 1 skipped, 0 failures. Known limit: the
standalone WhoopStore test target still references the gated raw-outbox
API and does not compile on Linux (its library build is unaffected).

Part of the drift-control plan in #17 (step 3).

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Toolchain, system packages, and the snapshot-enabled SQLite built into a
private directory and selected per build via -Xlinker -L and
LD_LIBRARY_PATH — never installed into a system library path, which
would override the distribution SQLite for every host process. Includes
the concrete, checksum-verified 3.53.4 recipe matching the CI job.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
One additional job: build a SHA-256-verified SQLite amalgamation with
SQLITE_ENABLE_SNAPSHOT into a workspace directory (cached, with a build
recipe revision in the cache key), then swift build + swift test for
Packages/StrandAnalytics. Actions are SHA-pinned like the existing
jobs; the macOS jobs are untouched.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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