Repository navigation
tests: forward CELLO_ESBUILD through the hermetic harness - #89
Conversation
- apply_hermetic_env passes CELLO_ESBUILD through when set, so a wrapper-script esbuild on PATH (mise shim) no longer breaks bundling conformance targets. - Nothing else ambient is forwarded; the CELLD_HERMETIC_CANARY tripwire stays cleared. - announced/forward_announce gain the same allow(dead_code) the other helpers carry (new unit-test binary uses only cello_command). - New hermetic_esbuild_env unit test: fails before the fix, passes after. - CONTRIBUTING.md documents the hermetic allowlist and the knob.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
The hermetic test harness (
crates/cello/tests/common/mod.rs) runscommand.env_clear()and only forwardsPATH,TMPDIR, and afixture-scoped
HOME. ACELLO_ESBUILDset by the developer or CI neverreached the
cello devchild, so on any box whoseesbuildonPATHisa wrapper script (mise shim), the bundling conformance targets failed with
run esbuild /usr/bin/mise: Permission denied.apply_hermetic_envnow forwardsCELLO_ESBUILDwhen it is set — andnothing else ambient. Hermeticity is unchanged: the
CELLD_HERMETIC_CANARYtripwire stays cleared, so a spawn that leaked the ambient environment
would still make
cellorefuse to start (CI runs the suite withCELLD_HERMETIC_CANARY=1for exactly this reason), and per-testextra_envstill wins because it is applied last.Changes
crates/cello/tests/common/mod.rs: forwardCELLO_ESBUILDwhen set;doc comment updated.
crates/cello/tests/hermetic_esbuild_env.rs(new): unit test assertingCELLO_ESBUILDreaches the built child command,CELLD_HERMETIC_CANARY/
RUST_LOGdo not, and an unsetCELLO_ESBUILDleaves no key behind.Fails before the fix (
left: None), passes after.CONTRIBUTING.md: "Testing locally" section documenting the hermeticallowlist and the
CELLO_ESBUILDknob.Docker/CI
No change needed: the
Dockerfiletest stage installs the real esbuild at/usr/local/bin/esbuild(found viaPATH, as before) withCELLO_ESBUILDunset;.github/workflows/ci.ymljust builds the image.Gates
cargo clippy --profile release --locked --all-targets -- -D warnings: clean.cargo test --profile release --locked --no-fail-fastwith ashim-first
PATH(brokenesbuildfirst) andCELLO_ESBUILDpointingat the real binary: green.
hermetic_esbuild_envtest: fails with the fix reverted, passeswith it.
Summary by CodeRabbit
esbuildbinary when running local tests, including troubleshooting permission errors.esbuildpath is forwarded when set, while unrelated environment variables remain excluded.