ReviewOS

home-lang/home

Native feature flags: honor Bake opt-in and libdeflate opt-out

#696
Closed chris opened this 9 days ago ·
9 days ago

Parent: #66. Discovered while running the optimized full Zig aggregate for #693.

home.zig exposes FeatureFlags from core/feature_flags.zig. That maintained port still documents two temporary static fallbacks:

  • bake() returns only Environment.isDebug, omitting upstream is_canary and BUN_FEATURE_FLAG_EXPERIMENTAL_BAKE.get().
  • isLibdeflateEnabled() returns only the platform support constant, ignoring BUN_FEATURE_FLAG_NO_LIBDEFLATE.get().

The typed environment-variable surface now exists at home.feature_flag, and bun_core/feature_flags.zig already contains the complete reference semantics. Port those semantics into the shared Home surface, preserving platform restrictions, real opt-in/opt-out behavior, and cache/initialization ownership. Do not hardcode experimental Bake enabled or disable compression unconditionally.

Observed integration context: zig build test --summary all -j2 -Doptimize=ReleaseFast builds a home-debug entry point with ReleaseFast shared runtime modules. The existing Bake scripts assume debug-enabled Bake. The development framework fixture exits with Bun.serve() needs either ... routes ... or a fetch handler; a separately retained production reproduction rejects build --app with the canary-upgrade message. This is not a claim that the default Debug aggregate fails for the same reason. BUN_DEV_SERVER_TEST_RUNNER=1 alone is not the experimental Bake opt-in.

Validate a real explicit BUN_FEATURE_FLAG_EXPERIMENTAL_BAKE=1 production build and development framework server in an optimized Home process, the disabled/default behavior, invalid application diagnostics, and actual enabled/disabled libdeflate paths. If the integration scripts must run across optimization modes, configure their documented experimental feature explicitly without changing assertions, routes, fixture content, or deadlines.

Keep this separate from the TypeScript rest-binding failure (#695) and intermittent Chrome startup (#694).

A direct reproduction with the final optimized Home executable and BUN_FEATURE_FLAG_EXPERIMENTAL_BAKE=1 BUN_DEV_SERVER_TEST_RUNNER=1 home build --app ./app.ts --outdir ./dist also exits 1 with the same canary-upgrade message. This confirms that the documented opt-in is ignored, beyond the optimized aggregate's default-disabled Bake configuration.

9 days ago

Published e148e06c1 to origin/main as Chris Breuer, without coauthors. This paired batch fixes #695 and #696; whole-suite parity remains incomplete under #66.

  • Nested array-rest flow now preserves the remaining array or tuple slice instead of a single element. The strengthened existing regression requires zero diagnostics; new negative tests reject incorrect element types and tuple order. Focused checker 4/4; complete TypeScript conformance 1,419/1,419; the standalone original reproduction exits zero without diagnostics.
  • The shared runtime now honors typed Bake opt-in and libdeflate opt-out, retaining canary/debug defaults and the separate Bake debugging predicate. Optimized native build 46/46 steps. Feature-flag units 6/6 with defaults and 6/6 in each fresh process with both flags set to 0 and 1; unit build 23/23 steps.
  • Both complete Bake production and development/HMR integration scripts pass. These Home integration scripts explicitly enable the experimental feature, matching the upstream harness; their assertions are unchanged. The previous binary still fails the production script with opt-in. The final optimized binary rejects Bake with the flag absent, 0 or false, and creates no output.
  • Unchanged pinned gzip/fetch file: 24/24 / 43 assertions with libdeflate enabled, and 24/24 / 43 assertions with it disabled, using strict-native fresh processes. No upstream test bytes, assertions, workloads or deadlines changed.
  • The post-test pinned corpus audit still finds 12,996 paths present: 12,990 identical regular files, five identical symlinks, one differing expectations.txt, zero missing. Formatting, script syntax, documentation Pickier and whitespace checks pass; no new repository-wide lint pass is claimed.

The prior optimized full aggregate was interrupted and remains incomplete; these targeted repairs do not turn it into a full pass. #694 (intermittent Chrome first-navigation timeout), #697 (bootstrap Request stress memory growth), #202 (remaining adapters), external native build ownership and other full-suite gaps remain open.

Sign in to comment on this issue.