1#!/usr/bin/env bash
Build native and keep a copy of it where launch.sh looks. See ./README.md.
3set -euo pipefail
The library path the copy will run with is the DEVSHELL's: read it here, inside the shell, and write it down for launch.sh, which runs outside one.
A copy, never a symlink into buck-out: buck-out is wiped (2026-09-21) and rewritten mid-build, and either would take the proxy away from the client. The rename is atomic, so a launch racing this sees the old copy or the new.
24cp "$built" "$BIN_DIR/native.new"
The hot-patch build keeps every symbol and all debug info (285 MB, measured 2026-09-21). The proxy is never patched - patch.sh reads the WINDOW's own /proc/PID/exe - so its copy drops the debug info; C: is the scarce thing.
The copy names store paths - its ELF interpreter and every library it links
- that nothing else keeps alive outside the devshell. Root the ones ldd resolves, so a garbage collection cannot leave a binary that will not start.
44echo "install.sh: $BIN_DIR/native from $built ($i store paths rooted)" >&2