fix: pass BUN_INSTALL to chroot to prevent Bun core dump#546
Conversation
Bun crashes with a core dump when installed inside the chroot due to restricted /proc access (/proc/self only). Instead, Bun should be pre-installed on the host (via setup-bun action) and its install path passed through to the chroot via AWF_BUN_INSTALL, following the same pattern as GOROOT, CARGO_HOME, and JAVA_HOME. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Chroot tests failed Smoke Chroot failed - See logs for details. |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Build Test: Rust - FAILED ❌Error: Rust toolchain not available in test environment. The Rust compiler ( Required: Add Rust installation step to workflow (e.g.,
|
|
Smoke Test Results (Run #21734652937) ✅ GitHub MCP: Last 2 merged PRs: #541, #537 Status: PASS
|
Deno Build Test Results
Overall: ✅ PASS All Deno tests completed successfully.
|
C++ Build Test Results
Overall: PASS ✅ All C++ projects built successfully.
|
|
Smoke Test Results for Claude Last 2 Merged PRs:
Test Results: Overall: PASS
|
Go Build Test Results
Overall: PASS ✅ All Go projects built and tested successfully.
|
Build Test: Node.js - Results
Overall: ✅ PASS All Node.js build tests completed successfully.
|
Build Test: Java - FAILED ❌Status: ENVIRONMENT ERROR Unable to execute Java build tests due to broken Java/Maven installation in the CI environment. Issues Found:
Test Results:
Overall: FAIL Required Actions:
The test repository was successfully cloned, but cannot proceed with build/test execution.
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a Bun core dump issue in chroot mode by passing the BUN_INSTALL environment variable from the host to the agent container. Bun crashes when installed inside chroot due to restricted /proc access, so it must be pre-installed on the host. The implementation follows the same established pattern as GOROOT, CARGO_HOME, and JAVA_HOME.
Changes:
- Passes
BUN_INSTALLasAWF_BUN_INSTALLto the agent container in chroot mode - Adds
BUN_INSTALL/binto PATH in the chroot script, following the same pattern as other language toolchains - Includes comprehensive test coverage for the new functionality
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/docker-manager.ts | Adds conditional logic to pass BUN_INSTALL as AWF_BUN_INSTALL when chroot mode is enabled |
| src/docker-manager.test.ts | Updates existing test to include BUN_INSTALL verification and adds new negative test case |
| containers/agent/entrypoint.sh | Adds BUN_INSTALL/bin to PATH and exports BUN_INSTALL variable in chroot script when AWF_HOST_PATH is provided |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Bun: Pass BUN_INSTALL so entrypoint can add $BUN_INSTALL/bin to PATH | ||
| // Bun crashes with core dump when installed inside chroot (restricted /proc access), | ||
| // so it must be pre-installed on the host via setup-bun action |
There was a problem hiding this comment.
Consider adding documentation for BUN_INSTALL similar to the GOROOT section in docs/chroot-mode.md. Since Bun has special requirements (crashes inside chroot due to restricted /proc access), users would benefit from documentation showing how to properly set up Bun in GitHub Actions workflows with chroot mode, similar to the existing GOROOT documentation at lines 114-133 in docs/chroot-mode.md.
| // Bun: Pass BUN_INSTALL so entrypoint can add $BUN_INSTALL/bin to PATH | |
| // Bun crashes with core dump when installed inside chroot (restricted /proc access), | |
| // so it must be pre-installed on the host via setup-bun action | |
| // Bun: | |
| // - Bun crashes with a core dump when installed inside the chroot (restricted /proc access). | |
| // - Bun must therefore be installed on the host (e.g. via oven-sh/setup-bun in a GitHub Actions | |
| // workflow), which sets BUN_INSTALL to the host install directory. | |
| // - We pass BUN_INSTALL through as AWF_BUN_INSTALL so entrypoint.sh can, in the chroot script, | |
| // add "$BUN_INSTALL/bin" to PATH and make the host-installed Bun available inside the chroot. |
Build Test: Bun - FAIL ❌Environment Issue Detected: Bun test execution failed due to containerized environment incompatibility. Test Results
Overall: FAIL ❌ Error DetailsRoot Cause: Bun runtime crashes with "Aborted (core dumped)" when attempting to run tests in the current execution environment. Technical Details:
Impact: Cannot verify Bun compatibility in this environment. The tests require access to CPU information (/proc/cpuinfo) which is not mounted in the containerized execution environment. Recommendation: This test needs to run in a full VM environment or with proper /proc filesystem mounts to support Bun's runtime requirements.
|
Summary
/procaccess is restricted to/proc/selfonlyBUN_INSTALLfrom the host environment asAWF_BUN_INSTALLto the agent container, following the same pattern asGOROOT,CARGO_HOME, andJAVA_HOMEentrypoint.sh, add$BUN_INSTALL/binto PATH and exportBUN_INSTALLin the chroot scriptoven-sh/setup-bunaction, not installed inside the chrootChanges
src/docker-manager.ts— Passprocess.env.BUN_INSTALLasAWF_BUN_INSTALLenv varcontainers/agent/entrypoint.sh— AddBUN_INSTALL/binto PATH in chroot script (same pattern as Cargo/Java/Go)src/docker-manager.test.ts— Add tests forAWF_BUN_INSTALLpassthroughTest plan
npm run buildcompilesnpm test— 729 unit tests pass (including 2 new tests)npm run lint— no errorsbun --versionworks in chroot whenBUN_INSTALLis set on host🤖 Generated with Claude Code