fix(agent): the Windows probe says which folders LLVM's start-up can't look up #38

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/win-longpath-probe into main 2026-11-16 02:32:02 +00:00
Owner

Why

The probe from #36 ran on futondestroyer's PC on nightly-67 (rp_c968c89138bf22dd, Longshot #910):

@@probe spawn real exit 1 ['...\llvm-mingw\bin\clang-23.exe: Permission denied']
@@probe spawn CreateProcessW inherit=False ok exit 1
@@probe spawn CreateProcessW inherit=True ok exit 1

So Windows does start clang-23.exe in the sandbox, with or without inherited handles. Then clang-23.exe itself quits with "Permission denied", even for --version. That fits LLVM's InitLLVM. On Windows it expands its own path with GetLongPathNameW (GetCommandLineArguments) and exits through ExitOnError with the banner argv[0] + ": ", which is exactly the line we see. GetLongPathNameW looks up the folders of the path with FindFirstFileW, and that needs a listing of the folder above. The sandbox can list only the folders it was given, so the look-up is refused above them, for example C:\ for Users or C:\Users for the profile.

Which folders need a listing decides the fix. If it's every folder, C:\ and C:\Users included, no grant can cover them without an administrator, and the tools have to live under a folder whose whole path the sandbox can look up. If Windows looks up only names that could be 8.3 names, fewer folders need it. So this probe asks Windows directly.

What changed

After #36's lines, the probe:

  • calls GetLongPathNameW on the compiler's path, and on the temp and current folders, and gives the Windows error when it fails;
  • looks up each folder of the compiler's path with FindFirstFileW. For each one it says its depth, whether its name looks like an 8.3 name, and whether the look-up was refused. No folder names are printed, since the report leaves the PC.

Testing

  • Agent checks: 1685 passed. The probe's Python compiles, and the probe runs on Linux, where the Windows part is skipped.
  • Not tested: the Windows part. It runs on the next Windows job once a nightly carries this.
## Why The probe from #36 ran on futondestroyer's PC on nightly-67 ([rp_c968c89138bf22dd](https://beanstalk.magicbean.dev/reports/rp_c968c89138bf22dd), Longshot #910): ``` @@probe spawn real exit 1 ['...\llvm-mingw\bin\clang-23.exe: Permission denied'] @@probe spawn CreateProcessW inherit=False ok exit 1 @@probe spawn CreateProcessW inherit=True ok exit 1 ``` So Windows **does** start `clang-23.exe` in the sandbox, with or without inherited handles. Then `clang-23.exe` itself quits with "Permission denied", even for `--version`. That fits LLVM's `InitLLVM`. On Windows it expands its own path with `GetLongPathNameW` (`GetCommandLineArguments`) and exits through `ExitOnError` with the banner `argv[0] + ": "`, which is exactly the line we see. `GetLongPathNameW` looks up the folders of the path with `FindFirstFileW`, and that needs a listing of the folder above. The sandbox can list only the folders it was given, so the look-up is refused above them, for example `C:\` for `Users` or `C:\Users` for the profile. Which folders need a listing decides the fix. If it's every folder, `C:\` and `C:\Users` included, no grant can cover them without an administrator, and the tools have to live under a folder whose whole path the sandbox can look up. If Windows looks up only names that could be 8.3 names, fewer folders need it. So this probe asks Windows directly. ## What changed After #36's lines, the probe: - calls `GetLongPathNameW` on the compiler's path, and on the temp and current folders, and gives the Windows error when it fails; - looks up each folder of the compiler's path with `FindFirstFileW`. For each one it says its depth, whether its name looks like an 8.3 name, and whether the look-up was refused. No folder names are printed, since the report leaves the PC. ## Testing - Agent checks: 1685 passed. The probe's Python compiles, and the probe runs on Linux, where the Windows part is skipped. - **Not tested:** the Windows part. It runs on the next Windows job once a nightly carries this.
fix(agent): the Windows probe says which folders LLVM's start-up can't look up
Some checks are pending
CI / Coordinator tests (pull_request) Waiting to run
CI / Agent build and checks (pull_request) Waiting to run
CI / Coordinator image (pull_request) Waiting to run
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 4s
89c97a9461
#36's probe showed Windows does start clang-23.exe in the sandbox, with or
without inherited handles, and clang-23.exe itself then says "<its path>:
Permission denied", even for --version (Longshot #910, rp_c968c89138bf22dd).
That is LLVM's InitLLVM: on Windows it expands its own path with
GetLongPathNameW, and prints argv[0] and the error when that fails.
GetLongPathNameW looks up each folder of the path with FindFirstFileW, which
needs a listing of the folder above it, and the sandbox can list only the
folders it was given.

The probe now calls GetLongPathNameW on the compiler's path, and looks up
each folder of it, saying for each (by depth, with no names) whether its
name looks like an 8.3 name and whether the look-up was refused. That tells
which folders the fix has to cover.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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/Beanstalk!38
No description provided.