Repository navigation
fix(cli): toolchain latest is the highest version, update keeps the pinned major - #921
Conversation
…ublish A bugfix on an older line, such as moc 1.16.2 published after 2.x, became `latest` for `mops toolchain use <tool> latest`, `mops toolchain update` and `mops toolchain info`. Pick the highest version instead, as Cargo does, and list the picker rows in the same order. Semver tags now outrank non-version tags, and wasm-opt keeps only Binaryen's `version_N` tags, so the repo's old `1.38.x` tags can't win. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cursor AI review👍 APPROVE — looks safe to merge
VerdictDecision: APPROVE Generated for commit f77bd17 |
automation-sa-sre
left a comment
There was a problem hiding this comment.
Automated approval: the AI review verdict for 5e70ce2 is APPROVE. See the "Cursor AI review" comment for details.
…est version in help and docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
automation-sa-sre
left a comment
There was a problem hiding this comment.
Automated approval: the AI review verdict for ca144e2 is APPROVE. See the "Cursor AI review" comment for details.
Like `mops update` for packages, `mops toolchain update` now moves a pin only within its caret range: same major, or same minor for 0.x. A project on moc 1.16.1 gets the 1.x bugfix instead of 2.x. `--major` crosses the bound, and the command names a newer out-of-range release when there is one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
latest is the highest version, not the newest publishlatest is the highest version, update keeps the pinned major
…e fetch per tool `--major` replaced a local-file pin with the latest release, which `mops update --major` never does to path dependencies. `update` also fetched the first releases page twice per tool. Fix docs and changelog that still said `update` goes to the highest version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n every stable release Also fix two doc spots that still tied `update` to the highest version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Automated approval: the AI review verdict for f77bd17 is APPROVE. See the "Cursor AI review" comment for details.
mops toolchain use <tool> latest,mops toolchain update, and thelatestline ofmops toolchain infotook the first release in GitHub's list, which is the most recently published one. Once the moc 1.x line ships a bugfix such as 1.16.2 after 2.x, every new project that runsmops toolchain use moc latestwould pin 1.16.2 instead of the newest 2.x. The interactive picker had the same problem: it lists releases in that order and preselects the first row.latestis now the release with the highest version, as Cargo resolves it, and the picker,--versions, andlatestall share one order.Before / after
With a moc release page where
1.16.2was published after2.2.2:Actual output against live GitHub on this branch:
Non-version and prerelease tags
Sorting by version exposed three tag shapes that publish order used to hide:
A semver prerelease such as
2.3.0-rc.1that GitHub doesn't flag as a prerelease would outrank a later2.2.3and staylatestuntil2.3.0ships. A prerelease suffix now counts as a prerelease, as in Cargo. Every hyphenated tag in the six repos is flagged today, so nothing changes on live data.A tag that doesn't parse as semver, such as wasmtime's
devor another release line in the same repo, now always ranks below real versions, so it can't becomelatest. Among themselves, non-semver tags compare numerically.Binaryen's first releases page also holds its old Emscripten-era
1.38.xand1.39.1tags. As semver, they would outrankversion_133.wasm-optnow keeps onlyversion_Ntags through the existingtagPrefixoption.mopscould never install the old tags anyway, since it builds the download URL fromversion_<N>. This also fixes--versions, which listed99above131.mops toolchain updatestays within the pin's caret rangePicking the highest version made a second problem visible:
mops toolchain updatemoved every pin to the overalllatest, across major versions, so a project on moc 1.16.1 would jump to 2.x instead of getting the 1.x bugfix. It now followsmops updatefor packages and Cargo: it stays within the caret range of the pin (same major, or same minor for0.x.y) and names any newer release out of range. The new--majorflag crosses the bound, matchingmops update --major.Actual output in a scratch project pinned to
moc = "1.16.0",lintoko = "0.11.0", andwasm-opt = "132":Before this PR, the same command pinned moc 2.2.3, lintoko 0.12.0, and wasm-opt 133.
A pin that isn't a semantic version, such as Binaryen's
133, has no caret range, so it changes only with--major. A pin to a local file is always skipped,--majorincluded, asmops updateskips path dependencies. Before,updatereplaced it with the latest release.What is unchanged
mopsversions keep the publish-order behavior until they upgrade, so the 1.x bugfix releases should stay marked as pre-releases on GitHub for now.🤖 Generated with Claude Code