fix(agent): keep Python-launched clang on the work drive #51

Merged
HumanBean merged 1 commit from futondestroyer/Beanstalk-contributions:codex/win-clang-prefix into main 2026-11-16 08:25:46 +00:00
Member

Windows base builds still fail the compiler check after PR 47. On this RTX 4070 / i7-13700F PC, a game-free AppContainer test shows clang --version works and CCC_OVERRIDE_OPTIONS is present, but an actual compile/link exits 1 with the real-path Permission denied message. Putting -no-canonical-prefixes in the driver's actual argv makes the same program compile, link and run.

Change

Extend the existing agent-owned managed-Python sandbox module to insert -no-canonical-prefixes before Python launches a known clang driver in LONGSHOT_MINGW/bin on BEANSTALK_WORK_DRIVE. Clang decides canonical prefixes before reading the environment override; early argv keeps InstalledDir, resources and child tools on the accessible drive.

The hook preserves the Popen class and original constructor options, does not mutate caller argv, and does not add the option twice. It handles list/tuple commands and executable overrides. Shell/string commands, bare PATH names, other programs/toolchains and off-drive paths are unchanged. The Windows/sandbox import gate and managed-Python-only installation remain in force. No ACL, capability, signature, approval or upload rule changes.

Validation

  • Real Windows AppContainer and the managed LLVM 23.1.5/Python 3.14.7: the PR 47-only before test exits 1; with this module, clang.exe and clang++.exe each compile/link successfully and their synthetic C/C++ executables exit 0. The C++ test uses a standard-library vector and provides the toolchain runtime DLL path.
  • 1,665 Windows agent core checks pass.
  • Five portable execution tests run the actual emitted Python module, covering scope gates, command selection, unchanged commands, constructor positional/keyword options, separate env, path objects/spaces and non-mutating argv.
  • Locked Release solution build: zero warnings and zero errors; git diff --check passes.
  • Checked-in Windows integration: dotnet run --project agent/tests/windows_clang/WindowsClang.csproj -c Release -- .

Only made-up sources and executables are used. The new module is imported only in the probe interpreter; it has not been installed into the live worker or written into its toolchain. Native programs launching their own clang drivers without the early option are outside this Python-launch fix and still need verification. A full main base build and gameplay acceptance remain for the next normal approved farm run after rollout. PR 815 has not been retried again during this investigation.

Latest farm failure used for diagnosis: https://beanstalk.magicbean.dev/reports/rp_d3667d4312a3f2db . The same compiler preflight stopped the last PR 815 run: https://beanstalk.magicbean.dev/reports/rp_8f7f22a4b11f9ab6 . Further details: docs/windows-clang.md.

Windows base builds still fail the compiler check after PR 47. On this RTX 4070 / i7-13700F PC, a game-free AppContainer test shows clang --version works and CCC_OVERRIDE_OPTIONS is present, but an actual compile/link exits 1 with the real-path Permission denied message. Putting -no-canonical-prefixes in the driver's actual argv makes the same program compile, link and run. ## Change Extend the existing agent-owned managed-Python sandbox module to insert -no-canonical-prefixes before Python launches a known clang driver in LONGSHOT_MINGW/bin on BEANSTALK_WORK_DRIVE. Clang decides canonical prefixes before reading the environment override; early argv keeps InstalledDir, resources and child tools on the accessible drive. The hook preserves the Popen class and original constructor options, does not mutate caller argv, and does not add the option twice. It handles list/tuple commands and executable overrides. Shell/string commands, bare PATH names, other programs/toolchains and off-drive paths are unchanged. The Windows/sandbox import gate and managed-Python-only installation remain in force. No ACL, capability, signature, approval or upload rule changes. ## Validation - Real Windows AppContainer and the managed LLVM 23.1.5/Python 3.14.7: the PR 47-only before test exits 1; with this module, clang.exe and clang++.exe each compile/link successfully and their synthetic C/C++ executables exit 0. The C++ test uses a standard-library vector and provides the toolchain runtime DLL path. - 1,665 Windows agent core checks pass. - Five portable execution tests run the actual emitted Python module, covering scope gates, command selection, unchanged commands, constructor positional/keyword options, separate env, path objects/spaces and non-mutating argv. - Locked Release solution build: zero warnings and zero errors; git diff --check passes. - Checked-in Windows integration: dotnet run --project agent/tests/windows_clang/WindowsClang.csproj -c Release -- <Beanstalk-work-directory>. Only made-up sources and executables are used. The new module is imported only in the probe interpreter; it has not been installed into the live worker or written into its toolchain. Native programs launching their own clang drivers without the early option are outside this Python-launch fix and still need verification. A full main base build and gameplay acceptance remain for the next normal approved farm run after rollout. PR 815 has not been retried again during this investigation. Latest farm failure used for diagnosis: https://beanstalk.magicbean.dev/reports/rp_d3667d4312a3f2db . The same compiler preflight stopped the last PR 815 run: https://beanstalk.magicbean.dev/reports/rp_8f7f22a4b11f9ab6 . Further details: docs/windows-clang.md.
fix(agent): keep Python-launched clang on the work drive
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 3s
CI / Coordinator tests (pull_request) Has been cancelled
CI / Agent build and checks (pull_request) Has been cancelled
CI / Coordinator image (pull_request) Has been cancelled
e71ce237c4
Pass the no-canonical-prefixes option in managed driver argv before clang resolves its installed directory. Keep the existing sandbox and managed-Python scope and verify C/C++ compile, link and execution in a real AppContainer.

Assisted-by: OpenAI Codex

Co-Authored-By: Codex <[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!51
No description provided.