client-core: gate the host-process modules behind native #205

Merged
natsukium merged 2 commits from fix/portable-core-build-195 into main 2026-09-07 22:52:35 +09:00
Owner

Fixes #195.

env_base, shader_clock, and pipe were declared unconditionally while
reaching for native-only items (connector::Carrier, config::ShaderAnimation)
and cfg(unix|windows) helpers, so felis-client-core with
default-features = false — the documented reuse path for a browser client —
failed to compile on wasm32 and on the host alike. All three are host-process
concerns and their only consumers build with default features, so they are now
gated behind native.

The regression survived three weeks because no gate ever built that
configuration: every CI job runs --all-features. pr.yml and the new
just check-portable recipe (wired into just check) now lint
-p felis-client-core --no-default-features --target wasm32-unknown-unknown.
Clippy rather than check, so -D warnings also catches the dead cfg
leftovers a feature split strands.

Doc cascade: docs/reference/testing.md records the new gate in the check
tables, and CONTRIBUTING.md follows the same list.

Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed
by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high

Deferred

  • Extend the wasm32 guard to felis-grid and felis-protocol, the other crates the
    portable core pulls in — they compile clean for wasm32 today as a transitive
    consequence of the felis-client-core guard, so a separate step would add CI
    time without adding coverage.
  • Document the portable module set in docs/reference/workspace.md's reuse table
    — the table names the crates reused per client kind, not their modules; the
    module-level invariant now lives in the crate doc comment, which is where a
    contributor editing lib.rs will see it.
Fixes #195. `env_base`, `shader_clock`, and `pipe` were declared unconditionally while reaching for `native`-only items (`connector::Carrier`, `config::ShaderAnimation`) and `cfg(unix|windows)` helpers, so `felis-client-core` with `default-features = false` — the documented reuse path for a browser client — failed to compile on wasm32 and on the host alike. All three are host-process concerns and their only consumers build with default features, so they are now gated behind `native`. The regression survived three weeks because no gate ever built that configuration: every CI job runs `--all-features`. `pr.yml` and the new `just check-portable` recipe (wired into `just check`) now lint `-p felis-client-core --no-default-features --target wasm32-unknown-unknown`. Clippy rather than `check`, so `-D warnings` also catches the dead `cfg` leftovers a feature split strands. Doc cascade: `docs/reference/testing.md` records the new gate in the check tables, and `CONTRIBUTING.md` follows the same list. Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high ## Deferred - Extend the wasm32 guard to felis-grid and felis-protocol, the other crates the portable core pulls in — they compile clean for wasm32 today as a transitive consequence of the felis-client-core guard, so a separate step would add CI time without adding coverage. - Document the portable module set in `docs/reference/workspace.md`'s reuse table — the table names the crates reused per client kind, not their modules; the module-level invariant now lives in the crate doc comment, which is where a contributor editing `lib.rs` will see it.
`env_base`, `shader_clock`, and `pipe` were declared unconditionally
while reaching for `native`-only items (`connector::Carrier`,
`config::ShaderAnimation`) and `cfg(unix|windows)`-only helpers, so
`default-features = false` failed to compile on wasm32 and on the host
alike. That build is the documented reuse path for a browser client, and
felis-web-component cannot build against felis at all while it is broken.

All three are host-process concerns; their only consumers (felis-cli,
felis-client, and this crate's own `dial`) build with default features.
Splitting `pipe` into a portable half was rejected: `Origin` and
`StagedRegion` describe a spawn on this machine, and no portable
consumer exists for them.

Refs #195
ci: guard felis-client-core's portable core on wasm32
All checks were successful
darwin / darwin docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 50s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m17s
pr / nix flake check (pull_request) Successful in 40s
pr / cargo build / clippy / test / deny (pull_request) Successful in 2m15s
pr / wire schema is compatible with the base (pull_request) Successful in 8s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 1m8s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 3s
windows / windows docs-only no-op (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
windows / cargo nextest (Windows) (pull_request) Successful in 6m26s
windows / frontend smoke (Windows) (pull_request) Successful in 1m52s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (push) Has been skipped
darwin / detect relevant changes (push) Successful in 3s
darwin / darwin docs-only no-op (push) Has been skipped
darwin / build felis (aarch64-darwin) (push) Successful in 13s
fuzz / cargo fuzz smoke (per target) (push) Successful in 1m11s
pr / nix flake check (push) Successful in 8s
pr / cargo build / clippy / test / deny (push) Successful in 2m12s
pr / wire schema is compatible with the base (push) Successful in 16s
pr / frontend smoke (x86_64-linux) (push) Successful in 6s
windows / detect relevant changes (push) Successful in 3s
windows / windows docs-only no-op (push) Has been skipped
pr / publish felis (x86_64-linux) (push) Successful in 11s
windows / cargo clippy (Windows cross) (push) Successful in 21s
windows / cargo nextest (Windows) (push) Successful in 5m46s
windows / frontend smoke (Windows) (push) Successful in 1m55s
windows / package felis (x86_64-pc-windows-msvc) (push) Successful in 2m52s
d1b9510a16
The wasm32 target has been on the toolchain since the feature split, with
`dev/flake-module.nix` claiming CI guards the portable core against
bitrot, but nothing ever built that configuration: every gate runs
`--all-features`. Three separate regressions landed in three weeks
before a downstream reported the crate no longer compiled.

Clippy rather than check, so `-D warnings` also catches the dead `cfg`
leftovers a feature split strands, which `cargo check` accepts silently.

Refs #195
natsukium deleted branch fix/portable-core-build-195 2026-09-07 22:52:35 +09:00
Sign in to join this conversation.
No description provided.