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
5 changes: 5 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
paths:
.github/workflows/check.yml:
ignore:
# Delivered to Actions but missing from its event docs: https://github.com/rhysd/actionlint/issues/726
- 'invalid activity type "destroyed" for "merge_group" Webhook event'
34 changes: 0 additions & 34 deletions .github/land.test.ts

This file was deleted.

24 changes: 17 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@ name: Check
permissions:
contents: read

# Not on a push to main: main only fast-forwards to a tree land.yml already checked.
# Main PRs report Check as skipped; the merge queue runs it once on the combined
# tree, so a push to main never needs it.
on:
pull_request:
merge_group:
# `destroyed` only cancels the dead group's in-flight run. GitHub keeps that
# run queued when the group is rebuilt behind a departed entry, where it
# holds the queue runner ahead of the live groups until they time out.
# Actions delivers this type although its docs omit it.
types: [checks_requested, destroyed]
workflow_dispatch:

# Cancel in-flight runs when a new commit lands on the same ref.
# Cancel in-flight runs when a new commit lands on the same ref. Each merge
# group has its own queue ref, shared by its `destroyed` event.
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: Check
runs-on: ubuntu-24.04-arm
# A destroyed-group run exists only to cancel the superseded in-flight build
# via the concurrency group above.
if: github.event_name != 'pull_request' && github.event.action != 'destroyed'
# Leave the variable unset until the self-hosted runner is verified.
runs-on: ${{ github.event_name == 'merge_group' && vars.RUST2_QUEUE_RUNNER || 'ubuntu-24.04-arm' }}
# Backstop a hang instead of holding the runner for the 6-hour default.
timeout-minutes: 30

Expand All @@ -27,9 +39,7 @@ jobs:
persist-credentials: false

- uses: ./.github/actions/nix
if: runner.environment != 'self-hosted'

- name: Check
run: nix develop --command just check

- name: Test
run: nix develop --command just test
run: nix develop --command just ci
107 changes: 0 additions & 107 deletions .github/workflows/land.yml

This file was deleted.

1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ direnv loads it automatically, but if not: `nix develop --command ...`.
```bash
just check # Lint everything, including the quest tree
just test # Run the tests
just ci # Both, as the merge queue runs them; run before every push
just fix # Auto-fix formatting
```

Expand Down
15 changes: 10 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Commits

PRs land on `main` only through `quest land`, each as one squash commit: the PR title becomes the commit subject and the PR's commit messages become the body.
Queue a PR with `quest merge <pr> <token> --land <sha>` (`/quest-merge` does this), and the Land workflow runs Check's steps once on the batch, landing the longest passing prefix.
The admin bypass of `main`'s ruleset is for emergencies.
Until the land setup in `quest/m1/land.md` is done, `--land` fails: merge with `gh pr merge <pr> --squash --match-head-commit <reviewed sha>` instead.
PRs into `main` are squash-merged through the merge queue, so the PR title becomes the commit subject.

- Use conventional-commit subjects (`feat(ts): ...`, `fix: ...`, `chore: ...`, `docs: ...`).
- AI commit attribution goes in a `Co-Authored-By:` trailer, not the commit body.
Expand All @@ -21,7 +18,15 @@ Have at least these sections:
- **Follow-ups**: any issues encountered or quests created.

Never rebase or force-push a pushed branch; merge the base branch in instead.
Open a draft PR while working, run `just check` and `just test` before every push, and mark the PR ready yourself when the work is done.
Open a draft PR while working, run `just ci` before every push, and mark the PR ready yourself when the work is done.

# Merge queue

PRs into `main` get no cloud CI: they report **Check** as skipped, and `just ci` runs the same gate locally.
The merge queue runs Check on the PR combined with the latest `main` and the PRs queued ahead of it.
Enqueue the reviewed head with `quest merge <pr> <token> --land <sha>` (`/quest-merge` does this).
A dequeued PR failed that combined check, timed out, or no longer meets the ruleset: read why in the PR timeline, fix the cause, and enqueue again.
The admin bypass of `main`'s ruleset is for emergencies.

# Reviews

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ Rust to other places.
- **TypeScript**: an own rustc driver that translates a [documented Rust subset](ts/README.md) to readable TypeScript, without WASM.
- **C, then any language**: an [exporter](ffi/README.md) that turns a crate's `pub` API into a C ABI and header with no attributes, sharing the TypeScript driver's front end.
- **Any language**: [a hard fork](uniffi/README.md) of [UniFFI](https://github.com/mozilla/uniffi-rs) with every generator [moq](https://github.com/moq-dev/moq) uses.
- **Faster builds**: a reproducible [build-speed benchmark](bench/build/README.md), then a pure-Rust subset (no build scripts, no C linking) that builds faster, and [rust2-lint](driver/src/bin/rust2-lint/main.rs), which fails a build whose generics' copies cost its codegen more than a budget (`nix run github:kixelated/rust2#lint -- --help`).
- **Faster builds**: a reproducible [build-speed benchmark](bench/build/README.md), then a pure-Rust subset (no build scripts, no C linking) that builds faster, and [rust2-lint](driver/src/bin/rust2-lint/main.rs), which fails a build whose generics' copies cost its codegen more than a budget (`nix run github:moq-dev/rust2#lint -- --help`).

Everything here is early; the [quest tree](quest/README.md) holds the plan.

## Development

```bash
nix develop # or direnv allow
just check
just test
just ci # just check, then just test, as the merge queue runs them

# The UniFFI fixture suites need every foreign toolchain.
nix develop .#uniffi --command just uniffi fixtures
Expand Down
4 changes: 2 additions & 2 deletions bench/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The body edits are functions the program runs, which ra-jit compiles.
ra-jit bugs seen on moq at the pinned rev, not reported upstream:

- `cargo ra-jit check` with no build loaded reads every crate of the workspace, takes minutes and GBs, and fails on errors rustc does not report (`unresolved macro moq_clock::test` in moq-net's integration tests).
- Async body edits in moq-net go to cargo (every `edit-async` run): "`new` is not compiled by ra-jit and rustc's copy is from before the edit: an instance of it does not compile". The daemon then loads the workspace again: on CI such an edit took 55.7 s and 222 CPU-s, against plain cargo's 9.1 s and 12.3 CPU-s ([run](https://github.com/kixelated/rust2/actions/runs/40285528419)).
- Async body edits in moq-net go to cargo (every `edit-async` run): "`new` is not compiled by ra-jit and rustc's copy is from before the edit: an instance of it does not compile". The daemon then loads the workspace again: on CI such an edit took 55.7 s and 222 CPU-s, against plain cargo's 9.1 s and 12.3 CPU-s ([run](https://github.com/moq-dev/rust2/actions/runs/40285528419)).
- A fallback logs `Duplicate definition of identifier ... <cc::Build>::cargo_metadata` while compiling aws-lc-sys's build script.
- On a library-only build such as regex, `cargo ra-jit build` returns after `cargo clean` without building anything.

Expand Down Expand Up @@ -136,7 +136,7 @@ Recommended on 2026-10-25: moq's CI keeps building its tests with LLVM, since 42
The `cranelift` variant's `build` numbers are for that abort build too.

Even passing, it would save little where CI spends its time.
CPU seconds from the [PR run](https://github.com/kixelated/rust2/actions/runs/40235946635) (4 CPUs; an A/A control on that run stayed within 3%):
CPU seconds from the [PR run](https://github.com/moq-dev/rust2/actions/runs/40235946635) (4 CPUs; an A/A control on that run stayed within 3%):

| CI build | nightly | cranelift | change |
| --- | ---: | ---: | ---: |
Expand Down
2 changes: 1 addition & 1 deletion bench/ffi/browser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mkdir -p "$dir"
jq -n --arg pkgs "$ubrn/pkgs" --arg playwright "$PLAYWRIGHT_VERSION" '{
name: "moq-ffi-bench",
private: true,
repository: {type: "git", url: "https://github.com/kixelated/rust2"},
repository: {type: "git", url: "https://github.com/moq-dev/rust2"},
dependencies: {
"@ubjs/core": "file:\($pkgs)/ubjs-core.tgz",
"@ubjs/wasm": "file:\($pkgs)/ubjs-wasm.tgz",
Expand Down
2 changes: 1 addition & 1 deletion driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "The rustc driver front end that rust2's drivers share, and rust2-
version = "0.0.0"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/kixelated/rust2"
repository = "https://github.com/moq-dev/rust2"
# A path dependency of the drivers, and rust2-lint through the flake: it only builds on
# their pinned nightly.
publish = false
Expand Down
2 changes: 1 addition & 1 deletion driver/src/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc_driver::Callbacks;
use rustc_session::EarlyDiagCtxt;
use rustc_session::config::ErrorOutputType;

const BUG_REPORT_URL: &str = "https://github.com/kixelated/rust2/issues/new";
const BUG_REPORT_URL: &str = "https://github.com/moq-dev/rust2/issues/new";

/// Whether cargo ran this binary as its wrapper, which it does with the rustc it would
/// have run as the first argument.
Expand Down
2 changes: 1 addition & 1 deletion ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Export a crate's pub API as a C ABI and header"
version = "0.0.0"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/kixelated/rust2"
repository = "https://github.com/moq-dev/rust2"
# Distributed through the flake: it only builds on the pinned nightly.
publish = false

Expand Down
6 changes: 5 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ check:
just driver check
just uniffi check

# Run what CI's Check runs: the lints, then the tests.
ci:
just check
just test

# Run the tests.
test:
bash .claude/hooks/direnv.test.sh
bun .github/land.test.ts
just ts test
just ffi test
just driver test
Expand Down
3 changes: 1 addition & 2 deletions quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ that replaces it.
## Plan

Decided with the maintainer on 2026-10-25, from the
[spike](https://github.com/kixelated/rust2/pull/41): the [exporter](/ffi/README.md), which
[spike](https://github.com/moq-dev/rust2/pull/41): the [exporter](/ffi/README.md), which
turns a crate's `pub` API into bindings with no attributes, replaces the UniFFI fork. The
fork stays in maintenance and keeps building moq's bindings until then; its feature quests
are folded into the [exporter's](/quest/m1/ffi-export/README.md). The
Expand All @@ -18,4 +18,3 @@ are folded into the [exporter's](/quest/m1/ffi-export/README.md). The

- [Waiting: publish the UniFFI fork](/quest/m1/uniffi-release.md) - the fork publishes to crates.io under `rust2-*` names, once the maintainer decides it should
- [Exporter](/quest/m1/ffi-export/README.md) - moq's bindings exported from its crates' `pub` API, replacing the fork
- [Land main through quest land](/quest/m1/land.md) - every queued PR lands as one tested batch through the shared gate
2 changes: 1 addition & 1 deletion quest/m1/ffi-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ until then.
## Plan

Decided with the maintainer on 2026-10-25, from the spike
([kixelated/rust2#41](https://github.com/kixelated/rust2/pull/41)): adopt the exporter, and fold
([moq-dev/rust2#41](https://github.com/moq-dev/rust2/pull/41)): adopt the exporter, and fold
the fork's paused feature quests into it.

Decided with the maintainer on 2026-10-27: this is an epic, with each item a child ranked by
Expand Down
2 changes: 1 addition & 1 deletion quest/m1/ffi-export/kotlin-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CI.

## Plan

Found by [#184](https://github.com/kixelated/rust2/pull/184) on 2026-10-28, which builds and
Found by [#184](https://github.com/moq-dev/rust2/pull/184) on 2026-10-28, which builds and
tests the Kotlin on the JVM only.

- R8 and ProGuard rename or strip `Native`'s dispatchers, which the JNI glue finds by name.
Expand Down
2 changes: 1 addition & 1 deletion quest/m1/ffi-export/kotlin-reads.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A payload read through the generated Kotlin costs what its JNI crossings must:
`just ffi bench`'s "payload read" line closes most of its gap to C, each cut measured. After
[#231](https://github.com/kixelated/rust2/pull/231), Kotlin takes 147-176 ns per 100 B
[#231](https://github.com/moq-dev/rust2/pull/231), Kotlin takes 147-176 ns per 100 B
payload read against C's 15-16.

The semantics stay as they are: `close()` is idempotent and frees exactly once, and the GC
Expand Down
2 changes: 1 addition & 1 deletion quest/m1/ffi-export/session-quic.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ moq-tokio, which `moq/moq.c` proves with moq-tokio's fallback runtime. It suits
with their own event loop or sockets.

Decided with the maintainer on 2026-10-28, from
[#215](https://github.com/kixelated/rust2/pull/215): at moq `30f25c04`, only moq-tokio's
[#215](https://github.com/moq-dev/rust2/pull/215): at moq `30f25c04`, only moq-tokio's
and moq-uring's drivers join moq-quic to moq-net's `poll::Session`, and each brings a
runtime. The runtime-free driver that joins them is moq's change, not the exporter's.
Datagrams move by pull: the binding passes in each one it receives, polls on each wake and
Expand Down
2 changes: 1 addition & 1 deletion quest/m1/ffi-export/tuples.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameter.

hang's `catalog::Audio::ranked` and `catalog::Video::ranked` are the consumer. They return
`impl Iterator<Item = (&String, &AudioConfig)>` (and `&VideoConfig`), which
[#213](https://github.com/kixelated/rust2/pull/213) collects into an array but refuses for
[#213](https://github.com/moq-dev/rust2/pull/213) collects into an array but refuses for
the tuple. They export as an array of pairs, each a string and a clone of the config object.
The same refusal holds back moq-net's `stats::Snapshot::{control, traffic, sessions}` (`Vec`s
of 2- and 3-tuples) and moq-mux's `codec::annexb::find_start_code` (`Option<(usize, usize)>`),
Expand Down
Loading
Loading