Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ jobs:
pull-requests: read
with:
# The test legs below are skipped on release PRs; the unit tests run
# here instead, in the stable environment a consumer gets.
# here instead, in the environment a consumer gets.
task: test
env: stable
env: default
mojo-compiler: "==1.3.0.dev2026111805"

test:
needs: release
if: ${{ !cancelled() && needs.release.outputs.release_only != 'true' }}
name: ${{ matrix.env == 'default' && 'nightly' || matrix.env }} / ${{ matrix.os }}
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# x86_64 and aarch64 Linux both, because the sandbox's seccomp filter
# is written per architecture (phase 3).
os: ${{ fromJSON((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && '["ubuntu-latest", "ubuntu-24.04-arm", "macos-latest"]' || '["ubuntu-latest", "ubuntu-24.04-arm"]') }}
env: [default, stable]
steps:
- uses: actions/checkout@v4

Expand All @@ -59,16 +59,15 @@ jobs:
# Pinned: pixi.lock is written by this version, and a newer pixi
# rejects it as "lock file not up-to-date with the workspace".
pixi-version: v0.78.0
environments: ${{ matrix.env }}

- name: Unit tests
run: pixi run -e ${{ matrix.env }} test
run: pixi run test

- name: Lint (mojolint --lsp)
run: pixi run -e ${{ matrix.env }} lint
run: pixi run lint

- name: Format check
run: pixi run -e ${{ matrix.env }} format-check
run: pixi run format-check

# Imports: no cycles between modules, and each name imported from the
# module that defines it (github.com/magmalake/customs).
Expand Down
4 changes: 2 additions & 2 deletions DESIGN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# process: design

November 2, 2026 · targets stable Mojo 1.2.0 and current nightly, on osx-arm64, linux-64 and linux-aarch64
November 2, 2026 · targets the Mojo 1.3 nightly 1.3.0.dev2026111805, on osx-arm64, linux-64 and linux-aarch64

process runs programs from Mojo. It starts a child with arguments, an environment and a working directory, captures what it writes, stops it when it runs too long, limits what it can use and, when asked, sandboxes it: no network, no writes outside the directories you name, no reads outside the system and the directories you name.

Expand Down Expand Up @@ -184,7 +184,7 @@ Each phase ends at a gate: something that works, not a feature list.

| Phase | What | Gate |
|---|---|---|
| 1 | **Spawn.** `Command`, `Child`, `Output`, `Stdio`, `Limits`; fork/exec with the error pipe; `PATH` lookup; capture with `poll`; timeouts that kill the group. | The unit tests pass on osx-arm64 and linux-64, stable and nightly. A `sh -c 'sleep 100 & sleep 100'` with a 1 s timeout leaves no process behind. |
| 1 | **Spawn.** `Command`, `Child`, `Output`, `Stdio`, `Limits`; fork/exec with the error pipe; `PATH` lookup; capture with `poll`; timeouts that kill the group. | The unit tests pass on osx-arm64 and linux-64. A `sh -c 'sleep 100 & sleep 100'` with a 1 s timeout leaves no process behind. |
| 2 | **Seatbelt.** `Sandbox` on macOS, the generated profile, `allow_toolchain()`, canonical paths. | Every escape test fails and `mojo build` plus run of a program works, inside the sandbox, on macOS. |
| 3 | **Landlock and seccomp.** The ruleset, the BPF filter for both architectures, ABI detection and scopes, `harden_current_process()`. | The same tests on Linux, natively in CI and in Docker locally. A kernel without Landlock raises instead of running. |
| 4 | **In use.** shelfwatch's `build_tin` dista task over it (`examples/dista_build.mojo` is the sketch: one task per checkout, the log on the worker, a small result back); a cgroup memory limit on Linux; dista's and flare's private fork helpers replaced where it's a clean swap. | shelfwatch builds the magmalake tins nightly, each in its sandbox. |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It exists because `std.subprocess.run` is `popen` through a shell and returns
stdout only, with no exit status, stderr, environment, working directory or
timeout.

Works on **Mojo 1.2.0 (stable) and current nightly**, on **osx-arm64**,
Works on the **Mojo 1.3 nightly 1.3.0.dev2026111805**, on **osx-arm64**,
**linux-64** and **linux-aarch64**.

```mojo
Expand Down Expand Up @@ -63,9 +63,9 @@ process-mojo = { git = "https://github.com/magmalake/process.mojo" }
## Develop

```sh
pixi run test # nightly; -e stable for Mojo 1.2.0
pixi run test
pixi run lint
tests/linux.sh stable test # the same suite on Linux, in Docker
tests/linux.sh default test # the same suite on Linux, in Docker
```

[DESIGN.md](DESIGN.md) is the plan: how a child starts, the sandbox on each
Expand Down
4 changes: 3 additions & 1 deletion examples/dista_build.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def main() raises:
var refs = List[ObjectRef[RepoResult]]()
for i in range(1, len(args)):
refs.append(
rt.remote[RunRepo](RepoJob(String(args[i]), "stable", "test", 1800))
rt.remote[RunRepo](
RepoJob(String(args[i]), "default", "test", 1800)
)
)

var failed = 0
Expand Down
Loading
Loading