Skip to content

executor: expose file descriptors inside action sandboxes - #37

Open
zbarsky-openai wants to merge 1 commit into
hermeticbuild:mainfrom
zbarsky-openai:zbarsky/action-sandbox-file-descriptors
Open

zbarsky-openai wants to merge 1 commit into
hermeticbuild:mainfrom
zbarsky-openai:zbarsky/action-sandbox-file-descriptors

Conversation

@zbarsky-openai

Copy link
Copy Markdown

Bash process substitutions fail inside action sandboxes because the normal
/dev/fd descriptor link is absent:

join: /dev/fd/63: No such file or directory
sort: cannot read: /dev/fd/62: No such file or directory

This occurs in real remote UnusedTarInputs actions while computing OCI-layer
dependencies. Some actions continue after the error, leaving incorrect or empty
unused-input sets.

Create the standard /dev/fd -> /proc/self/fd symlink in each action's
existing device directory. The action already mounts its own procfs after
entering its mount namespace, so the link remains local to the sandbox and
requires no runtime packages or additional mounts. Extend the existing base
directory test to assert the exact symlink target.

The failure was reproduced in all four remote OCI-layer rule tests with Bazel
9.3.0-actiond-dzbarsky14 and actiond invocation
e04aa24e-0f40-4715-92b9-1afe76b48268. Running the upstream unit suite
locally is currently blocked by the repository's rejected BuildBuddy API key.

Bash process substitutions fail inside action sandboxes because the normal
`/dev/fd` descriptor link is absent:

```text
join: /dev/fd/63: No such file or directory
sort: cannot read: /dev/fd/62: No such file or directory
```

This occurs in real remote `UnusedTarInputs` actions while computing OCI-layer
dependencies. Some actions continue after the error, leaving incorrect or empty
unused-input sets.

Create the standard `/dev/fd -> /proc/self/fd` symlink in each action's
existing device directory. The action already mounts its own procfs after
entering its mount namespace, so the link remains local to the sandbox and
requires no runtime packages or additional mounts. Extend the existing base
directory test to assert the exact symlink target.

The failure was reproduced in all four remote OCI-layer rule tests with Bazel
`9.3.0-actiond-dzbarsky14` and actiond invocation
`e04aa24e-0f40-4715-92b9-1afe76b48268`. Running the upstream unit suite
locally is currently blocked by the repository's rejected BuildBuddy API key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant