fix(build): read CARGO_MANIFEST_DIR at run time in build scripts
Two build scripts read their own crate folder with the compile-time env!("CARGO_MANIFEST_DIR"). When a build cache reuses a build script binary compiled in another checkout, that path points into the old checkout:
cmux-browser-host/build.rspanics reading ajs/manifest.jsonthat no longer exists. This broke a chat-open benchmark build on a fleet worker: the step read…/steps/<old step>/src/cmux-tui/crates/cmux-browser-host/js/manifest.jsonwhile the source was in another slot.cmux-tailnet/build.rsreadspatches/withunwrap_or_default, so it silently builds with no patches.
Both now read CARGO_MANIFEST_DIR at run time; Cargo sets it for every build script run. No other build.rs uses env!("CARGO_MANIFEST_DIR").
Small change: two lines of logic in two build scripts. Risk: none beyond the build itself; the variable is always set when Cargo runs a build script.
Agent session: agent session
🤖 Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes build script caching failures by reading CARGO_MANIFEST_DIR at run time instead of compile time in two build scripts. When a cached build script binary is reused from a different checkout, env! keeps the old checkout's path; cmux-browser-host then panics on a missing js/manifest.json, and cmux-tailnet silently builds without its patches.