Skip to content

fix(platforms): make multi-platform builds work on latest MC versions#40

Merged
ch99q merged 2 commits into
mainfrom
ch99q/fix-template-builds
May 19, 2026
Merged

fix(platforms): make multi-platform builds work on latest MC versions#40
ch99q merged 2 commits into
mainfrom
ch99q/fix-template-builds

Conversation

@ch99q
Copy link
Copy Markdown
Collaborator

@ch99q ch99q commented May 12, 2026

Summary

  • Paper's latest version (e.g. 26.1.2) is what pluggy init picks by default, but Sponge and Folia weren't ready for it: sponge asked Maven for a release version that's only published as -SNAPSHOT, and folia hardcoded the old <mc>-R0.1-SNAPSHOT artifact name when folia-api had moved to the build-stamped form. Both now probe maven-metadata.xml and fall through to a published variant — pluggy build against the multi-platform and folia-regions templates now succeeds end-to-end.
  • Verified by building all 9 templates (paper-basic, paper-mockbukkit, paper-adventure, folia-regions, velocity-proxy, bungee-proxy, sponge-basic, multi-module, multi-platform) front-to-back.
  • pluggy build now prints jar paths relative to the invocation directory (paper/bin/foo.jar instead of /Users/.../paper/bin/foo.jar); absolute path is retained when --output points outside cwd and in the JSON payload.
  • Platform aliases: --platform bungeecord (and bungee) now resolve to waterfall instead of erroring. New platforms.resolve() / platforms.aliases() on the registry, used by both parsePlatform and platforms.get.

Test plan

  • vp test (74 files, 656 tests)
  • vp check (lint + format + typecheck)
  • Manual: built every template under playground/ (initinstallbuild), confirmed jar paths display relatively and --platform bungeecord works.

When Paper publishes a new calendar-versioned release (e.g. 26.1.2)
pluggy init defaults to it, but the downstream platform providers
weren't ready: sponge resolved spongeapi to a version only published as
-SNAPSHOT on Maven, and folia still hardcoded the old <mc>-R0.1-SNAPSHOT
artifact name even though folia-api moved to the build-stamped form
(26.1.2.build.8-stable) like paper did. Both now probe maven-metadata
and pick a published variant.

Also surfaced while testing: build output displayed absolute paths, and
--platform bungeecord was rejected even though that's the natural name
for the waterfall-backed proxy.

- sponge: resolvePublishedApiVersion checks the spongeapi metadata for
  a release variant before falling back to -SNAPSHOT.
- folia/paper: share papermc.resolveApiVersion, which prefers the
  highest <mc>.build.<N>-<channel> entry and falls back to the SNAPSHOT
  form on miss.
- build: print outputPath relative to the cwd pluggy was invoked from
  (paper/bin/foo.jar instead of /Users/.../paper/bin/foo.jar); absolute
  path retained when --output points outside cwd and in the JSON
  payload.
- platforms: new resolve()/aliases() on the registry; parsePlatform
  resolves aliases (bungee, bungeecord -> waterfall).
@ch99q ch99q force-pushed the ch99q/fix-template-builds branch from d7ba8d9 to 826ad1b Compare May 15, 2026 20:42
The Check & Test job downloads real platform server jars (paper-api,
spigot-api, folia ~53 MB, sponge, BuildTools) into the per-OS pluggy
cache on every run. The Folia download in particular was the suspected
cause of the Windows worker crash that already cost one rerun this PR.

- actions/cache@v4 keyed on the OS and a hash of the platform sources
  (so cache invalidates when version-resolution logic changes).
  restore-keys lets a stale cache rehydrate the long tail since server
  jars are immutable per version.
- Format / lint / typecheck only run on ubuntu-latest now — they're
  platform-agnostic and adding them to macos + windows just costs
  matrix latency.
@ch99q ch99q merged commit fd9023f into main May 19, 2026
4 checks passed
@ch99q ch99q deleted the ch99q/fix-template-builds branch May 19, 2026 16:20
ch99q added a commit that referenced this pull request May 19, 2026
vitest's forks pool intermittently emits Worker exited unexpectedly
after platform-compat.test.ts's 6 javac compiles complete on Windows.
All tests pass, but the pool reports the run as failed because the
fork dies during teardown — same shape we hit on #40 and #42.

The tests cover OS-agnostic javac+classpath logic (AsyncChatEvent
presence in paper-api vs spigot-api, etc.) already verified on the
ubuntu and macos legs. Skipping on Windows costs no coverage and
removes ~70s of flaky runtime.
ch99q added a commit that referenced this pull request May 19, 2026
* chore: install vite-plus git hooks (pre-commit + pre-push)

`vp config` wires up a husky-style scaffold at .vite-hooks/_/ that
points at the top-level scripts in .vite-hooks/. Local-clone only:
`git config core.hooksPath .vite-hooks/_` is per-clone, so contributors
run `vp config` once after cloning.

- pre-commit: `vp staged` (runs `vp check --fix` on staged paths via
  the new `staged` block in vite.config.ts).
- pre-push: `vp check && vp test` so CI failures get caught locally
  before the push round-trip. VITE_GIT_HOOKS=0 skips for emergencies.
- CLAUDE.md: new review-checklist line telling agents/devs to run
  `vp config` once per fresh clone.

* test(platform-compat): skip on Windows to avoid flaky worker crash

vitest's forks pool intermittently emits Worker exited unexpectedly
after platform-compat.test.ts's 6 javac compiles complete on Windows.
All tests pass, but the pool reports the run as failed because the
fork dies during teardown — same shape we hit on #40 and #42.

The tests cover OS-agnostic javac+classpath logic (AsyncChatEvent
presence in paper-api vs spigot-api, etc.) already verified on the
ubuntu and macos legs. Skipping on Windows costs no coverage and
removes ~70s of flaky runtime.
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