Repository navigation
test: Bun.isStandaloneExecutable is false under BUN_BE_BUN=1 - #32606
Conversation
Extends the compile/BunBeBunEnvVar test to cover Bun.isStandaloneExecutable: - the bundled entrypoint reports true when run normally - running the compiled binary with BUN_BE_BUN=1 and '-e <script>' reports false, since the standalone module graph is skipped and the binary acts as the plain bun CLI
|
Updated 4:53 PM PT - Jun 22nd, 2026
✅ @robobun, your commit 1ff03dcac684a418b55efd157c1a15ad36021fa8 passed in 🧪 To try this PR locally: bunx bun-pr 32606That installs a local version of the PR into your bun-32606 --bun |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe ChangesBunBeBunEnvVar test: isStandaloneExecutable assertions
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
LGTM — straightforward test-only extension pinning Bun.isStandaloneExecutable behavior under BUN_BE_BUN=1.
Extended reasoning...
Overview
This PR extends the existing compile/BunBeBunEnvVar test in test/bundler/bundler_compile.test.ts. It adds one console.log line to the compiled entrypoint, updates the first run's expected stdout accordingly, and appends a third run entry that invokes the compiled executable with BUN_BE_BUN=1 + -e <script> to assert Bun.isStandaloneExecutable === false. No production/runtime code is touched.
Security risks
None. This is a test-only change with no impact on shipped binaries, auth, crypto, permissions, or external inputs.
Level of scrutiny
Low. The change is small, mechanical, and follows the established pattern already used by the surrounding test (the second run entry already exercises BUN_BE_BUN=1 against the compiled output). I verified the expectBundled harness supports args on run entries (appended after the compiled executable path) and that env is already proven to work by the existing second run entry.
Other factors
- The file is not covered by CODEOWNERS.
- The bug-hunting system found no issues.
- The PR description shows the test was run locally and passes.
- The assertions mirror the existing standalone
Bun.isStandaloneExecutable is false when not compiledtest in the same file, so the expected JSON shape is consistent.
There was a problem hiding this comment.
LGTM — straightforward test-only extension of the existing BunBeBunEnvVar case.
Extended reasoning...
Overview
This PR touches a single file, test/bundler/bundler_compile.test.ts, and only modifies the existing compile/BunBeBunEnvVar test. It adds one console.log line to the compiled entry script, updates the expected stdout for the normal run accordingly, and adds a third run entry that invokes the compiled binary with BUN_BE_BUN=1 plus -e <script> to assert Bun.isStandaloneExecutable === false (and that its type is boolean). No production/runtime code is changed.
Security risks
None. This is purely additive test coverage; it executes a compiled hello-world binary in the test sandbox using the existing itBundled harness. No new dependencies, network access, file-system mutation outside the test temp dir, or auth/crypto surfaces are involved.
Level of scrutiny
Low. Test-only, ~13 lines added, follows patterns already present in the same file (the adjacent Bun.isStandaloneExecutable is false when not compiled test uses the identical JSON.stringify({ value, type }) shape, and other run array entries in this file already use env, args, and stdout). I confirmed the harness supports args on run entries (expectBundled.ts:376).
Other factors
- No CODEOWNERS entry covers this file.
- The bug-hunting system found no issues.
- The one CI failure (
grpc-js/test-server.test.tsSIGTRAP on macOS x64) is unrelated to this change. - The PR description states the test was run locally and passes.
- No prior reviewer comments are outstanding.
Extends the existing
compile/BunBeBunEnvVartest to lock in howBun.isStandaloneExecutableinteracts withBUN_BE_BUN.What this covers
A compiled (
bun build --compile) executable:Bun.isStandaloneExecutable === trueBUN_BE_BUN=1and-e <script>: the binary behaves like the plainbunCLI, the embedded standalone module graph is never loaded, andBun.isStandaloneExecutable === falseWhy
BUN_BE_BUN=1short-circuits theGraph::from_executable()probe insrc/runtime/cli/mod.rs, so the VM is created with no standalone module graph andBun.isStandaloneExecutable(which is justvm.standalone_module_graph.is_some(), seeBunObject.rs) reportsfalse. This test pins that behavior so it can't silently change.Verification