fix(scripts): dev_packs.py makes a folder only when it isn't there, for the Windows farm sandbox #948

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/dev-packs-sandbox-dirs into main 2026-11-15 22:33:00 +00:00
Owner

Type: fix · Risk: low · Tested on: Linux (game-free checks) · Needs: Windows, any GPU (a Beanstalk Windows agent)

Why

Every Test Farm job on a Windows tester fails before it builds anything. scripts/dev_packs.py base stops with
PermissionError: [WinError 5] Access is denied: 'C:\\' (report
rp_069212220b5ebc8f, PR #910, RTX 4070, Windows 11).

On Windows, the Beanstalk agent runs Longshot's scripts in an AppContainer sandbox. The sandbox can open the folders it
was given, but it can't see the folders above them. os.makedirs(d, exist_ok=True) looks at every folder above d
before making anything, even when d is already there. Inside the sandbox each of those folders looks missing, so it
climbs to C:\ and fails there, and exist_ok doesn't cover that error. The agent makes the base folder before it
starts dev_packs.py, so the folder is there; only the check above it fails.

How to reproduce

Seen on: Windows 11, Beanstalk agent nightly-30-2e88da66 (AppContainer sandbox), any GPU
Settings and switches: defaults
Steps: let a Windows Beanstalk agent take any farm job; it runs dev_packs.py base <data>\bases\main ... in the sandbox
Expected: the base is built
Actual: Busy.__enter__ → os.makedirs → PermissionError: [WinError 5] Access is denied: 'C:\\'

What changed

dev_packs.py makes a folder only when it isn't already there, so a folder the sandbox was given is never checked
from above.

  • scripts/dev_packs.py: new ensure_dir(), which calls os.makedirs only when the folder isn't a directory yet. It is
    used for the busy marker's folder (Busy.__enter__, the base's own folder) and for adopt's base folder. The
    other makedirs calls make folders inside a base or job folder, whose parent is visible, so they're unchanged.
  • tests/test_dev_packs.py: test_busy_folders_above_hidden fakes the sandbox: folders above the base look missing,
    and making one is refused. Taking and leaving the busy marker, and making a folder inside the base, still work.

Measurements

Nothing to measure: a script fix with a game-free test, which fails on main with the same PermissionError: Access is denied: '/' (/ standing in for C:\) and passes here.

Flags and settings

None

Testing

Tested:

  • python -I -B tests/test_dev_packs.py passes on Linux. With main's dev_packs.py the new test fails as on the
    tester's PC.
  • python -I -B tests/run_all.py: 548 passed, 17 failed, 76 skipped on Linux. The same 17 also fail on main without this change: test_appimage_player_build.py, test_bake_portability.py, test_crash_dialog.py, test_crt_options.py, test_env_on.py, test_lift_cleanup_error.py, test_linux_preflight.py, test_linux_update.py, test_make_game_cache.py, test_missing_nup.py, test_mods_size_table.py, test_options_budget_once.py, test_pipeline_tour.py, test_readback_late.py, test_vk_occlusion_queries.py, test_vk_pgo.py, test_walk_key.py.

Not tested: a real Windows agent run. I'm on Linux, and the AppContainer only exists on Windows.

Must be tested:

  • Windows, any GPU, with a Beanstalk agent, after merge: a farm job gets past "the main base" and builds the base,
    expecting no Access is denied: 'C:\\' in the report (Test Farm: @Beanstalk windows on any PR). It can't be
    seen on this PR first: the agent builds the main base with main's own dev_packs.py, which still has the bug.

Risks

What could break: nothing outside the sandbox. A folder that isn't there yet is made as before. A folder that is
there is now left alone instead of being checked from above.

Turning it off: revert the commit

Compatibility: Nothing changes

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
**Type:** fix · **Risk:** low · **Tested on:** Linux (game-free checks) · **Needs:** Windows, any GPU (a Beanstalk Windows agent) ## Why Every Test Farm job on a Windows tester fails before it builds anything. `scripts/dev_packs.py base` stops with `PermissionError: [WinError 5] Access is denied: 'C:\\'` (report [rp_069212220b5ebc8f](https://beanstalk.magicbean.dev/reports/rp_069212220b5ebc8f), PR #910, RTX 4070, Windows 11). On Windows, the Beanstalk agent runs Longshot's scripts in an AppContainer sandbox. The sandbox can open the folders it was given, but it can't see the folders above them. `os.makedirs(d, exist_ok=True)` looks at every folder above `d` before making anything, even when `d` is already there. Inside the sandbox each of those folders looks missing, so it climbs to `C:\` and fails there, and `exist_ok` doesn't cover that error. The agent makes the base folder before it starts `dev_packs.py`, so the folder is there; only the check above it fails. ## How to reproduce **Seen on:** Windows 11, Beanstalk agent nightly-30-2e88da66 (AppContainer sandbox), any GPU **Settings and switches:** defaults **Steps:** let a Windows Beanstalk agent take any farm job; it runs `dev_packs.py base <data>\bases\main ...` in the sandbox **Expected:** the base is built **Actual:** `Busy.__enter__` → `os.makedirs` → `PermissionError: [WinError 5] Access is denied: 'C:\\'` ## What changed `dev_packs.py` makes a folder only when it isn't already there, so a folder the sandbox was given is never checked from above. - `scripts/dev_packs.py`: new `ensure_dir()`, which calls `os.makedirs` only when the folder isn't a directory yet. It is used for the busy marker's folder (`Busy.__enter__`, the base's own folder) and for `adopt`'s base folder. The other `makedirs` calls make folders inside a base or job folder, whose parent is visible, so they're unchanged. - `tests/test_dev_packs.py`: `test_busy_folders_above_hidden` fakes the sandbox: folders above the base look missing, and making one is refused. Taking and leaving the busy marker, and making a folder inside the base, still work. ## Measurements Nothing to measure: a script fix with a game-free test, which fails on `main` with the same `PermissionError: Access is denied: '/'` (`/` standing in for `C:\`) and passes here. ### Flags and settings None ## Testing **Tested:** - `python -I -B tests/test_dev_packs.py` passes on Linux. With `main`'s `dev_packs.py` the new test fails as on the tester's PC. - `python -I -B tests/run_all.py`: 548 passed, 17 failed, 76 skipped on Linux. The same 17 also fail on `main` without this change: `test_appimage_player_build.py`, `test_bake_portability.py`, `test_crash_dialog.py`, `test_crt_options.py`, `test_env_on.py`, `test_lift_cleanup_error.py`, `test_linux_preflight.py`, `test_linux_update.py`, `test_make_game_cache.py`, `test_missing_nup.py`, `test_mods_size_table.py`, `test_options_budget_once.py`, `test_pipeline_tour.py`, `test_readback_late.py`, `test_vk_occlusion_queries.py`, `test_vk_pgo.py`, `test_walk_key.py`. **Not tested:** a real Windows agent run. I'm on Linux, and the AppContainer only exists on Windows. **Must be tested:** - Windows, any GPU, with a Beanstalk agent, **after merge**: a farm job gets past "the main base" and builds the base, expecting no `Access is denied: 'C:\\'` in the report (Test Farm: `@Beanstalk windows` on any PR). It can't be seen on this PR first: the agent builds the main base with `main`'s own `dev_packs.py`, which still has the bug. ## Risks **What could break:** nothing outside the sandbox. A folder that isn't there yet is made as before. A folder that is there is now left alone instead of being checked from above. **Turning it off:** revert the commit **Compatibility:** Nothing changes ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened.
fix(scripts): dev_packs.py makes a folder only when it isn't there, for the Windows farm sandbox
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 4s
Third-party parts / As their notes say (pull_request) Successful in 8s
PR description / Description follows the template (pull_request_target) Successful in 4s
7d72fed100
os.makedirs(d, exist_ok=True) looks at every folder above d before it
makes anything, even when d is already there. In the Beanstalk agent's
Windows sandbox (an AppContainer) the folders above the ones it was
given look missing, so the call climbed to C:\ and failed with Access
is denied: every farm job on a Windows tester stopped at the main base.

ensure_dir() calls makedirs only when the folder isn't a directory yet;
the busy marker's folder and adopt's base folder use it.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

Testing: a farm run can only show the fix after merge, because the agent builds the main base with main's dev_packs.py. The description now says so.

Testing: a farm run can only show the fix after merge, because the agent builds the main base with main's dev_packs.py. The description now says so.
HumanBean changed title from WIP: fix(scripts): dev_packs.py makes a folder only when it isn't there, for the Windows farm sandbox to fix(scripts): dev_packs.py makes a folder only when it isn't there, for the Windows farm sandbox 2026-11-15 22:25:59 +00:00
HumanBean deleted branch fix/dev-packs-sandbox-dirs 2026-11-15 22:33:00 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!948
No description provided.