Skip to content
Draft
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: 11 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ target-dir = "target/workers"

[target.wasm32-unknown-emscripten]
rustflags = [
# Static linking and unwind semantics are required by the hosted runtime.
"-Crelocation-model=static",
"--cfg=tokio_unstable",
"-Clink-arg=-sWASM_BINDGEN=auto",
# exnref exception handling throughout: the C side gets `-fwasm-exceptions
# -sWASM_LEGACY_EXCEPTIONS=0` from EMCC_CFLAGS (scripts/common.sh), emcc
# translates the prebuilt std at link, and wasm-bindgen's JSPI wrappers use
# try_table. V8 rejects a module mixing the two.
"-Cllvm-args=-wasm-use-legacy-eh=false",
# Link-only settings stay out of EMCC_CFLAGS so they do not reach C compiles.
"-Clink-arg=-sWASM_BINDGEN",
"-Clink-arg=-sJSPI",
# Each promising activation runs on its own shadow stack, so a request or
# timer entering the module while the server is suspended cannot clobber it.
"-Clink-arg=-sREENTRANT_JSPI",
"-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",
Expand Down
13 changes: 8 additions & 5 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,21 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Emscripten backend
run: brew install emscripten
- run: sudo apt-get install -y ninja-build
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: minecraft-cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
.work/emsdk
.work/binaryen/build
key: minecraft-toolchain-${{ runner.os }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml', 'scripts/setup.sh') }}
- name: Setup pinned sources and toolchain
run: bash scripts/setup.sh
- name: Install Worker dependencies
run: npm ci
# Inbound net.Server routing inside Durable Objects is not yet in Wrangler's
# bundled workerd; set MINIFLARE_WORKERD_PATH to a build that has it.
- name: Worker TCP, shared world, and SQLite restart
run: |
set -o pipefail
Expand Down
7 changes: 3 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ 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.
- `src/`: Pumpkin entry points and configuration.
- `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.
- `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.
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
Changes to the patched Pumpkin checkout 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.
Expand Down
Loading