Commit 43f25c2
Make the bwrap alias a wrapper around the sandboxexec Go bindings.
bwrap previously built its own specs.Spec, wrote an OCI bundle and drove runsc/container directly. It now only parses the bubblewrap command line and translates it into sandbox.Options; //sandboxexec/sandbox owns the bundle, the runsc invocation and the container lifecycle.
To support this, the bindings gain:
- Run, an attached counterpart to New that runs a command to completion over `runsc run`, preserving its stdio and exit code, and relaying signals into the container via `runsc kill`.
- Options for the process, rootfs, namespaces, ID mappings and mount options bwrap needs, plus opt-outs for the bindings' default mounts, host binary mounts and base environment. Every zero value reproduces the previous bundle layout.
- Config, which resolves options into a BundleConfig for testing.
- runsc stderr in the failure message from New, instead of a bare exit status.
Signal relaying skips SIGURG, SIGPIPE and SIGCHLD as pkg/sighandling does; relaying SIGCHLD would be self-sustaining, since each forwarded signal spawns a runsc process whose exit raises another.
Behavior deltas: bwrap now forks a runsc process, passes --ignore-cgroups when not root, and roots a container with no `--bind / /` at the bundle's rootfs directory rather than a separate temporary directory.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#14022 from milantracy:bwrap 24a225e
PiperOrigin-RevId: 9605243021 parent 7a7d8c3 commit 43f25c2
6 files changed
Lines changed: 918 additions & 470 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
0 commit comments