Problem
The watchOS CI job timed out (6h) on PR #207, and android had a SIGSEGV crash. Both are likely caused by nix cache invalidation.
Root cause
In nix/watchos.nix (and ios.nix, android.nix):
This passes the entire repo as the source. When ANY tracked file changes (e.g. watchos/Hatter/HaskellBridge.swift), the nix source hash changes, which invalidates ALL derivations that depend on hatterSrc — including the GHC cross-compilation step.
On master, the derivation hashes match the community cache, so everything downloads pre-built. On a PR branch with even a one-line Swift change, the entire GHC cross-compile must run from scratch on the CI runner.
Impact
- watchOS: 6-hour timeout — the macOS runner couldn't finish the full cross-compile in time
- android: The SIGSEGV may be related to a cache-miss rebuild producing a subtly different binary (different optimization, linking order, etc), or it may be genuinely flaky
- iOS: Passed because its runner was fast enough (30 min)
Possible fix
Split hatterSrc so the GHC build derivation only depends on src/, cbits/, include/, and the cabal file — not Swift files, project.yml, or other platform files. The Swift files could be passed as a separate input to the installPhase. This way, changing a Swift file wouldn't invalidate the expensive GHC cross-compilation cache.
Context
🤖 Generated with Claude Code
Problem
The watchOS CI job timed out (6h) on PR #207, and android had a SIGSEGV crash. Both are likely caused by nix cache invalidation.
Root cause
In
nix/watchos.nix(andios.nix,android.nix):This passes the entire repo as the source. When ANY tracked file changes (e.g.
watchos/Hatter/HaskellBridge.swift), the nix source hash changes, which invalidates ALL derivations that depend onhatterSrc— including the GHC cross-compilation step.On master, the derivation hashes match the community cache, so everything downloads pre-built. On a PR branch with even a one-line Swift change, the entire GHC cross-compile must run from scratch on the CI runner.
Impact
Possible fix
Split
hatterSrcso the GHC build derivation only depends onsrc/,cbits/,include/, and the cabal file — not Swift files, project.yml, or other platform files. The Swift files could be passed as a separate input to the installPhase. This way, changing a Swift file wouldn't invalidate the expensive GHC cross-compilation cache.Context
ios/Hatter/HaskellBridge.swiftandwatchos/Hatter/HaskellBridge.swift🤖 Generated with Claude Code