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
19 changes: 5 additions & 14 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@
target = "wasm32-unknown-emscripten"
target-dir = "target/workers"

# worker-build --emscripten supplies these (and the link settings) through
# RUSTFLAGS when building with the `worker/experimental_tokio` feature; they are repeated
# here so `cargo check` sees the same cfgs.
[target.wasm32-unknown-emscripten]
rustflags = [
# Static linking and unwind semantics are required by the hosted runtime.
"-Crelocation-model=static",
"-Cllvm-args=-wasm-use-legacy-eh=false",
"--cfg=tokio_unstable",
"-Clink-arg=-sWASM_BINDGEN=auto",
"-Clink-arg=-sEXPORT_ES6",
# Generated host glue uses Workers' Node compatibility APIs.
"-Clink-arg=-sENVIRONMENT=node",
"-Clink-arg=-sNODERAWSOCKETS",
"-Clink-arg=-sNODERAWFS",
"-Clink-arg=-sJSPI",
"-Clink-arg=-sASSERTIONS=0",
"-Clink-arg=-sSTACK_SIZE=8MB",
"-Clink-arg=-sALLOW_MEMORY_GROWTH=1",
# Each Durable Object creates its own wasm instance and mounted filesystem.
"-Clink-arg=-sMODULARIZE=1",
"-Clink-arg=-sEXPORT_NAME=createPumpkinModule",
"--cfg=wasm_bindgen_unstable_tokio",
]
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ concurrency:

jobs:
smoke:
runs-on: macos-14
timeout-minutes: 75
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -25,18 +25,15 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Emscripten backend
run: brew install emscripten
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: minecraft-cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Setup pinned sources and toolchain
~/.cache/worker-build
key: minecraft-toolchain-${{ runner.os }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml', 'scripts/setup.sh') }}
- name: Setup pinned sources, toolchain and Worker dependencies
run: bash scripts/setup.sh
- name: Install Worker dependencies
run: npm ci
- name: Worker TCP, shared world, and SQLite restart
run: |
set -o pipefail
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.work/
/target/
**/target/
/build/
node_modules/
.wrangler/
/worker/env.d.ts
Expand Down
25 changes: 14 additions & 11 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,28 @@ Read [README.md](README.md), [architecture](docs/architecture.md), and

## Project layout

- `src/`: Pumpkin entry points and configuration. The hosted Tokio bridge lives in workers-rs.
- `worker/`: TCP ingress, Durable Object lifecycle, and SQLite filesystem.
- `tests/`: protocol clients, integration tests, and isolated filesystem fixtures.
- `scripts/setup.sh`: provision pinned sources and build the toolchain.
- `src/`: the Worker: TCP ingress, the Durable Object, the SQLite filesystem
mount (`js/mount.js`), Pumpkin configuration, and the Emscripten JS library
(`workerd.js`).
- `tests/`: protocol clients and the integration test.
- `scripts/setup.sh`: provision the patched Pumpkin checkout, worker-build (which
provisions Emscripten and wasm-bindgen) and npm dependencies.
- `scripts/{build,serve,test}.sh`: build, run, and validate the Workers server.

Use Node 24+ (26 recommended) and the pinned Rust nightly. Run `npm test` after
Use Node 24+ (26 recommended) and the pinned Rust toolchain. Run `npm test` after
build/runtime changes; it must print `PUMPKIN-DO-SQLITE-RESTART-OK` after verifying
player and chunk restoration. Keep test fixtures out of the production bundle.
player and chunk restoration.
Scripts bind to loopback and fail if their ports are occupied. Do not kill another
process to free a port.

## Reproducibility and data

Changes to patched checkouts (Pumpkin, wasm-bindgen, workers-rs, wasm-streams) must
be reflected in `patches/`. Keep unpatched checkouts unmodified; update pins for
upstream changes. Preserve the unified ticker and cooperative scheduler unless
the task requires a runtime change. Do not reintroduce old Tokio/libc networking
patches.
Changes to the patched Pumpkin checkout must be reflected in `patches/`
(`node_modules` patches are applied by `npm install`). Update pins for
upstream changes; workers-rs, tokio and mio are git dependencies in Cargo.toml. Preserve the unified ticker and cooperative scheduler unless
the task requires a runtime change. Keep the event-loop model: exports
return promises and nothing blocks or suspends; do not reintroduce JSPI, old
Tokio/libc networking patches, or a JS-side driver.

Worlds under `.data/` are user data; do not remove or copy them into commits.
Playable databases live in `.data/workers/server/`; tests use `.data/probes/`.
Expand Down
Loading
Loading