Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1w465qoyco is past its budget: trevato/forge: "prefillInstallCache (#7543) > bun installs from a filled cache that is read-only, copying, with no regi… #12774

Closed opened this
Closed without merging

The test bun installs from a filled cache that is read-only, copying, with no registry no longer depends on the machine. test/check-install.test.ts now passes in full (26 tests) and tsc is clean. I did not run gate.ts or any other suite.

Notes

stopped closed without shipping deploy b915150

opened this

The test bun installs from a filled cache that is read-only, copying, with no registry no longer depends on the machine. test/check-install.test.ts now passes in full (26 tests) and tsc is clean. I did not run gate.ts or any other suite.

What was wrong: the test filled the cache against the fixture registry, then ran bun install with BUN_CONFIG_REGISTRY=http://127.0.0.1:1/. Bun puts the registry's host and port into the cache key. So that install missed the cache it had just filled and tried to download. Against a read-only cache, bun then failed with EACCES accessing temporary directory. I reproduced it here, and setting BUN_TMPDIR/TMPDIR made no difference. Without the read-only step the same miss shows as ConnectionRefused downloading tarball.

What I changed: the test, which was wrong. The install now uses the registry URL the lockfile pins, so it hits the cache and writes no temp directory. The fixture server is already stopped by then, so nothing can be fetched.

What I did not do: I did not change prefillInstallCache or any source. I did not confirm why the old URL passes on main's check but failed on those five pulls. I did not touch the root-skips-the-read-only-assertion carve-out either.

To try it: run bun test test/check-install.test.ts.

Closes #12765

4 earlier comments
commented

The test bun installs from a filled cache that is read-only, copying, with no registry no longer depends on the machine. test/check-install.test.ts now passes in full (26 tests) and tsc is clean. I did not run gate.ts or any other suite.

What was wrong: the test filled the cache against the fixture registry, then ran bun install with BUN_CONFIG_REGISTRY=http://127.0.0.1:1/. Bun puts the registry's host and port into the cache key. So that install missed the cache it had just filled and tried to download. Against a read-only cache, bun then failed with EACCES accessing temporary directory. I reproduced it here, and setting BUN_TMPDIR/TMPDIR made no difference. Without the read-only step the same miss shows as ConnectionRefused downloading tarball.

What I changed: the test, which was wrong. The install now uses the registry URL the lockfile pins, so it hits the cache and writes no temp directory. The fixture server is already stopped by then, so nothing can be fetched.

What I did not do: I did not change prefillInstallCache or any source. I did not confirm why the old URL passes on main's check but failed on those five pulls. I did not touch the root-skips-the-read-only-assertion carve-out either.

To try it: run bun test test/check-install.test.ts.

commented

The preview deploy didn't fail. Its log says "running at https://lab--12774--forge-trevato-apps.open-platform.sh · no tests declared, none run". That line is informational, not an error.

I checked the preview directly: / answers 200 in about 0.47 s. The tests are declared under check in forge.json and run on the push as the check, not as part of the preview deploy. Locally bun test test/check-install.test.ts passes all 26 tests, and tsc is clean.

The log you pasted is only the deploy's periodic forge status lines, with no error in it. I changed nothing and pushed nothing for this message. If the forge's check run on #12774 is red, send me that log and I'll work from it.

commented

This fixes the test "prefillInstallCache (#7543) > bun installs from a filled cache that is read-only, copying, with no registry" in test/check-install.test.ts. The test was wrong, and only the test changes; prefillInstallCache and the rest of the source are unchanged.

Cause: the test filled the cache from the fixture registry, then ran bun install --frozen-lockfile --backend=copyfile with BUN_CONFIG_REGISTRY=http://127.0.0.1:1/. Bun puts the registry's host and port into the cache key ([email protected]@@127.0.0.1__<hash>@@@1), so that install missed the cache it had just filled and tried to download. With the cache read-only, bun could not write its temp directory and exited with EACCES accessing temporary directory. Setting BUN_TMPDIR or TMPDIR made no difference. With a writable cache the same miss shows as ConnectionRefused downloading tarball, which confirms it is a cache miss and not a temp-directory problem. I have not found out why this passes on main's check but failed on #12712, #12600, #12605 and #12498.

Fix: the final install now uses the registry URL the lockfile pins (reg.url). The fixture server is already stopped by then, so the install still has no registry. What the test proves is unchanged: install from a filled, read-only cache, copying, with nothing fetched.

Not done: I left the root-skips-the-read-only-assertion carve-out as it is. I did not run bun scripts/gate.ts or any suite beyond this file.

Try it: run bun test test/check-install.test.ts. All 26 tests pass and bun x tsc --noEmit is clean. The preview at https://lab--12774--forge-trevato-apps.open-platform.sh answers 200 on /. Its deploy log said "no tests declared, none run", which is expected: the tests are declared under check, so they run as the forge's check on the push. There was no deploy fault to fix.

🤖 Generated with Claude Code

commented

Main already fixed the read-only cache install test in f05aa200c (#12721), the same way this pull did, so after the merge this branch adds nothing to main. Close it rather than merge it.

Merge conflict: the only conflict was in test/check-install.test.ts, and I took main's side. Main's fix also installs with reg.url, the registry URL the lockfile pins and the one the cache key is built from. It goes further than this branch did:

  • it runs the install through cellInstall, so the test covers the same command and environment a contained check uses;
  • it snapshots the cache before and after, so the test checks that the cache is left untouched;
  • it gives the install its own HOME.

Cause: for the record, the failure on #12712, #12600, #12605 and #12498 was a cache miss. Bun puts the registry's host and port in the cache key. The test installed with http://127.0.0.1:1/ instead of the fixture registry's URL, so bun missed the cache it had just filled. It then tried to fetch, and failed with EACCES accessing temporary directory because the cache was read-only.

Checks: bun x tsc --noEmit is clean and bun test test/check-install.test.ts passes, 27 of 27. I did not run bun scripts/gate.ts or any other suite.

The merge commit is pushed.

🤖 Generated with Claude Code

commented

Closed by the crew: superseded, its change is already on main in f05aa200.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs