Skip to content

Add a Pumpkin port (Rust WebAssembly plugin); keep the e2e tools local - #8

Merged
Macaron27 merged 2 commits into
mainfrom
pumpkin
Nov 6, 2026
Merged

Macaron27 merged 2 commits into
mainfrom
pumpkin

Conversation

@Macaron27

Copy link
Copy Markdown
Owner

Two commits:

  1. Keep the end-to-end tools local: tools/e2e (bot players, real-server scenarios, the Java API probe) is untracked and ignored, like the test sources. The files stay on disk. settings.gradle.kts includes :probe only where tools/e2e/probe exists, because Gradle 9 rejects a project whose directory is missing. Checked with ./gradlew projects on JDK 25, both without the folder (no :probe) and with it (:probe included). Earlier versions of these files remain in the git history; only the branch tip drops them.
  2. Add a Pumpkin port: PumpkinMC/ runs Friends on Pumpkin, the Rust server, as a WebAssembly plugin. Start with PumpkinMC/README.md.

What the port is

  • PumpkinMC/core is the platform-agnostic core ported to Rust: rules, caches, every chat message (the MiniMessage templates rebuilt with the same nesting), FriendCommand, ConfigUpgrade, and SQLite/MySQL/MariaDB storage. Nothing in it knows about Pumpkin.
  • PumpkinMC/plugin is the Pumpkin glue. It builds friends_pumpkin.wasm against pumpkin-plugin-api 0.2.1, which is Wasm API v0.1, what Pumpkin loads by default.
  • PumpkinMC/tools/probe is a test plugin that exercises the API.
  • Same config and data as Java:
    • config.yml is embedded from core/src/main/resources, and upgrades add new settings the same way.
    • Same tables and SQL, so a Paper friends.db (including WAL mode) or a shared MySQL database works.
    • Data lives in plugins/data/friends/.
  • How the Paper pieces map:
    • Commands, arguments and messages are the same.
    • friends.use becomes friends:use, because Pumpkin requires the plugin's namespace.
    • Vanilla owns /msg, /tell and /w on Pumpkin, so Friends takes them over from the command event before they run; /whisper, /r and /reply are its own commands.
    • The join and leave listeners become non-blocking Pumpkin event handlers.
    • FriendsAPI and its events are JSON over plugin IPC, with cancelling and message rewriting supported.
  • MySQL: the mysql crate doesn't build for wasm32-wasip2, so core/src/storage/mysql_wire.rs is a small client on top of mysql_common. It supports caching_sha2_password (including the RSA full-auth path) and mysql_native_password, and reconnects the way HikariCP does.
  • CI and releases:
    • The new pumpkin job runs cargo fmt --check, clippy -D warnings and the release build. It doesn't run tests, which stay local (PumpkinMC/*/tests/ is ignored).
    • Releases also attach friends-pumpkin.wasm, with the same tag-vs-version check against PumpkinMC/Cargo.toml.

Known limitations

  • Player names aren't tab-completed (subcommands and /status values are). On the 2026-11-06 nightly, Pumpkin's Wasm host shuts the whole server down when a player tab-completes an argument that has a plugin suggestion handler: it panics in crates/pumpkin-wasm-host-v0_1/src/commands/executor.rs:149, calling block_in_place on the tick thread. So Friends registers none. This is not reported upstream yet.
  • mysql.use-ssl: true is refused at startup: there's no TLS in the plugin sandbox.
  • No LuckPerms prefixes on Pumpkin.
  • SQLite uses exclusive locking: WASI has no shared memory for WAL's index.
  • The config is read as YAML 1.2: only true/false are booleans.

Tested locally (in Docker; the host has no Rust or Java)

  • Core suite, 25 tests: pass natively and as WASI programs under wasmtime (the plugin's runtime). They cover:
    • the friend rules against Java's messages;
    • config defaults and upgrades;
    • a friends.db written with Java's DDL, with its rows still in the WAL;
    • MySQL 8.4 (with caching_sha2_password and mysql_native_password users) and MariaDB 11.4, including reconnecting after the connection is killed.
  • End-to-end on the Pumpkin nightly (0.2.1+26.3-26.60), with 26.3 bots driven by the (now local) e2e tools. All four scenarios pass:
    • pumpkin: the same friend story as the Paper scenarios, plus tab completion;
    • pumpkin-mysql;
    • load-pumpkin;
    • api-pumpkin: events, one cancelled, one rewritten; a call back into Friends from inside an event; API actions.
  • CI job: replayed on a clean copy of the repo, and it passes. GitHub Actions itself hasn't run it yet; this PR is its first run.

For review

  • Versions: build.gradle.kts and PumpkinMC/Cargo.toml both say 0.7.0, but the latest release is tagged 1.0.0. The release workflow requires the tag to match, so the next release needs both versions bumped together.
  • Build locally: docker build -t friends-pumpkin-dev -f PumpkinMC/tools/dev.Dockerfile PumpkinMC/tools, then from the repo root docker run --rm -v "$PWD:/repo" -w /repo/PumpkinMC friends-pumpkin-dev cargo plugin.

🤖 Generated with Claude Code

Macaron27 and others added 2 commits November 6, 2026 12:26
tools/e2e (bot players, real-server scenarios and the API probe plugin) leaves the repository like the test
sources: it is untracked and ignored, and stays on disk for local runs. Gradle includes the probe subproject only
where tools/e2e/probe exists, so a fresh checkout still configures (Gradle 9 rejects a missing project directory).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PumpkinMC/ ports the core (rules, caches, messages, commands, config upgrades, SQLite and MySQL/MariaDB storage)
to Rust and adds the Pumpkin glue, built against pumpkin-plugin-api (Wasm API v0.1) to friends_pumpkin.wasm.
It ships the same config.yml (embedded from core/) and uses the same tables and SQL, so databases move between
platforms. Commands, permission (friends:use) and messages match Paper; vanilla /msg, /tell and /w are taken over
from the command event. FriendsAPI and its events are JSON over plugin IPC. MySQL goes through a small client on
mysql_common, as the mysql crate doesn't build for wasm32-wasip2; TLS is refused for now.

Pumpkin's Wasm host crashes the server when a player tab-completes a plugin suggestion argument, so commands use
literal subcommand nodes and register no suggestion handler: player names aren't completed yet.

CI builds and lints the plugin (tests stay local); releases attach friends-pumpkin.wasm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Macaron27
Macaron27 merged commit 549b02d into main Nov 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant