fix(mc-versions): support 26.2 and fix caches on macOS and Windows - #140
Conversation
PR #138 added the 26.2 module as a directory named `26.2` (with a dot), but the repo naming convention uses underscores and `ci-data.json` references `"dir": "26_2"`. The build matrix therefore pointed at a non-existent `26_2` directory, so the 26.2 jars were never built or attached to a release. Consumers hit: Asset with name mc-runtime-test-26.2-*-neoforge-release.jar not found! Rename the directory to `26_2` so the build matrix resolves, the 26.2 artifacts are produced, and the next release-please release publishes them. Also extend the README supported-versions range to 26.2. Fixes #137
The 26.2 module's gradlew was committed by #138 with mode 100644 instead of 100755, so the CI build failed with: ./gradlew: Permission denied (exit code 126) Every other version's gradlew is 100755. Set the executable bit to match.
|
Ah this is a problem within HeadlessMc, the mc versions.json format changed as well as the way native libraries work. |
Status of the red
|
|
Thanks @okafke, that matches what I traced: the I opened headlesshq/headlessmc#427 as a minimal fix for the native-libraries crash on the current agent: leave Completely fine if you'd rather fold this into HeadlessMC 2 alongside the versions.json changes, that's your call, just flagging it in case a current-line patch is useful to unblock headless 26.2 sooner. Either way this PR's core fix (the 🤖 Addressed by Claude Code |
|
Correction on the upstream pointer: the canonical fix is headlesshq/headlessmc#426 (by @okafke), not the #427 I linked earlier — I'd missed #426 when I opened mine, so I've closed #427 in its favour. #426 is the complete fix: it ignores 🤖 Addressed by Claude Code |
|
Ok, the auto-release for HeadlessMc 2.10.0 is running and should fix this. I can finalize this release in about 3 hours. Please note my preference on adding Claude as co-author in headlesshq repositories (headlesshq/headlessmc#428 (comment)). Before this is merged I would like to force push to remove the co-author tag. |
1c6c317 to
1508be0
Compare
|
Understood, and noted for headlesshq repos. I've force-pushed this branch to drop the co-author trailer from the commits ( |
|
Not 100% sure whats wrong here investigating, maybe the cache is broken. |
|
Confirmed the cache theory. With HeadlessMc 2.10.0 the The macOS Two ways to clear it:
|
|
Yeah we should maybe harden the cache at some point? not sure though |
The cache key was <mc>-<modloader>-hmc, independent of the HeadlessMC version. A partial .minecraft cached by an older HeadlessMC (e.g. one that crashed mid modloader-install) kept being restored after upgrading, and because the install guard only checks for the vanilla <mc>.json it skipped reinstalling, so launch failed with 'Couldn't find object for regex ...'. Salt the key with hmc-version so upgrading HeadlessMC busts stale caches and repopulates .minecraft cleanly.
|
Went ahead and hardened it here (34e2279): the |
|
That's not it. I don't think the cache action would cache if we have crashed mid install, it does not really make sense. I just thought long about it: The error is only on mac-os, I think the cache got restored from Ubuntu, to /home/runner/.minecraft, however, that's not where headlessmc thinks the .minecraft installation is, so it cannot find anything. I think similar things could happen if we restored a cache from mac-os to another OS. The reason we have not found out about this earlier is our rigorous caching, there probably have not been successful, cached, consecutive runs for the same mc version since we have added support for windows and macos.
So instead of adding |
The cache key had no OS component, so a .minecraft cached on one runner OS could be restored on another. Restoring an Ubuntu cache (/home/runner/.minecraft) on macOS lands it where HeadlessMC doesn't look ($HOME is /Users/runner), so the launch found no installed version: 'Couldn't find object for regex ...'. The cache is inherently OS-specific (paths, native libraries), so key it by runner.os to give each OS its own cache. Replaces the hmc-version salt from the previous commit.
|
You're right, that diagnosis fits the evidence better, cross-OS restore rather than a partial cache. Done in 27e67af: both cache keys now lead with `${{ runner.os }}` (`Linux-26.2-neoforge-hmc` etc.) and I dropped the hmc-version salt. Each OS gets its own cache, which is needed anyway given the OS-specific native libraries, and macOS no longer restores Ubuntu's `/home/runner/.minecraft` into a path it doesn't read. The new keys also miss the old contaminated caches, so this run reinstalls cleanly per-OS. |
|
I reran the workflow twice with the new caching and no caches for macOS and Windows have been created. |
The cache path was hardcoded to /home/runner/.minecraft, which only exists on Linux. On macOS/Windows HeadlessMC installs .minecraft elsewhere ($HOME differs, Windows defaults to %APPDATA%), so nothing at /home/runner/.minecraft got cached and cross-OS restores landed in a directory HeadlessMC never reads. Pin HeadlessMC's game dir with hmc.mcdir=$HOME/.minecraft in config.properties (Linux/macOS and Windows) and cache ~/.minecraft, so the cached path and the install path line up on every runner OS.
|
Done in 29fa07e. Set |
What
Rename the 26.2 module directory from
26.2(with a dot) to26_2(underscore), and extend the README supported-versions range to 26.2.Why
Fixes #137. Consumers running the action for MC 26.2 hit:
The 26.2 jars were never built or released. PR #138 added the module as a directory named
26.2(with a dot), but:26_1,1_21_11, …), andci-data.jsoncorrectly references"dir": "26_2".So the CI build matrix produced a
26_2entry pointing at a non-existent directory. The 26.2 build produced nothing, the release job had no 26.2 jars to attach, and the download failed. (Release4.4.0also predates #138 entirely.)The fix
git mv 26.2 → 26_2so the build matrix resolves. The build then producesmc-runtime-test-26.2-<apiver>-{lexforge,neoforge,fabric}-release.jar, exactly matching the downloader'smc-runtime-test-26.2-*-<loader>-release.jarpattern.26.1 - 26.1.2→26.1 - 26.2.Verified
ci-data.jsonbuild_datadirs now resolve on disk; the stale26.2dir is gone.26_2/build.gradle(archivesName = mc-runtime-test,version = 26.2-<api>, classifier<platform>-release) yields precisely the expected jar names.A full gradle build (Java 25 + Minecraft download) is CI-only and wasn't run locally.
Note for reviewer
This is a
fixcommit, so release-please will open a release PR on merge. Merging that release PR builds the now-working26_2module, publishes the 26.2 jars, and bumpsaction.yml's pinnedtag:via its# x-release-please-versionmarker — so the pinned tag is intentionally left untouched here. Until that release lands, consumers should reference the action at@main.🤖 Generated with Claude Code