Skip to content

fix: run python_multiprocessing_lock_works integration test on Mac and Linux - #2318

Merged
bolinfest merged 1 commit into
mainfrom
pr2318
Aug 14, 2025
Merged

bolinfest merged 1 commit into
mainfrom
pr2318

Conversation

@bolinfest

@bolinfest bolinfest commented Aug 14, 2025 •

Copy link
Copy Markdown
Collaborator

The high-order bit on this PR is that it makes it so sandbox.rs tests both Mac and Linux, as we introduce a general spawn_command_under_sandbox() function with platform-specific implementations for testing.

An important, and interesting, discovery in porting the test to Linux is that (for reasons cited in the code comments), /dev/shm has to be added to writable_roots on Linux in order for multiprocessing.Lock to work there. Granting write access to /dev/shm comes with some degree of risk, so we do not make this the default for Codex CLI.

Piggybacking on top of #2317, this moves the python_multiprocessing_lock_works test yet again, moving codex-rs/core/tests/sandbox.rs to codex-rs/exec/tests/sandbox.rs because in codex-rs/exec/tests we can use cargo_bin() like so:

let codex_linux_sandbox_exe = assert_cmd::cargo::cargo_bin("codex-exec");

which is necessary so we can use codex_linux_sandbox_exe and therefore spawn_command_under_linux_sandbox in an integration test.

This also moves spawn_command_under_linux_sandbox() out of exec.rs and into landlock.rs, which makes things more consistent with seatbelt.rs in codex-core.

For reference, #1808 is the PR that made the change to Seatbelt to get this test to pass on Mac.

@bolinfest
bolinfest merged commit 2ecca79 into main Aug 14, 2025
@bolinfest
bolinfest deleted the pr2318 branch August 14, 2025 22:47
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants