fix: go backend missing supports_lockfile_url() override#8790
Conversation
Go backend tools compile from source via `go install` and don't produce downloadable binary artifacts. The default supports_lockfile_url() returns true, causing --locked mode to fail for any go-backend tool since their lockfile entries can never contain platform-specific download URLs. Other source-based backends (cargo, npm, pipx, asdf, dotnet, rust, ubi) already override this to false. This adds the same override for the go backend. Fixes the --locked failure for tools like: go:golang.org/x/tools/cmd/goimports go:github.com/go-delve/delve/cmd/dlv Discussion: jdx#8789
Greptile SummaryThis PR adds a one-line Confidence Score: 5/5Safe to merge — the change is minimal, correctly follows established patterns, and directly fixes a broken user-facing workflow. Single-method override that returns a constant false, consistent with at least seven other backends that have the same pattern. The logic in mod.rs clearly shows this is the correct fix. No risk of regression in unrelated code paths. No files require special attention — the single changed file is straightforward. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["mise install --locked (go:some/tool)"] --> B["install_version() — mod.rs:996"]
B --> C{"ctx.locked &&\nnot tool_stub?"}
C -- No --> F["Proceed with install via go install"]
C -- Yes --> D{"supports_lockfile_url()?"}
D -- "true (before fix)\ndefault" --> E["❌ bail! — No lockfile URL found\n(go tools have no binary URLs)"]
D -- "false (after fix)\nGoBackend override" --> F
F --> G["go install golang.org/x/...@version"]
G --> H["✅ Tool installed from source"]
Reviews (1): Last reviewed commit: "fix: go backend missing supports_lockfil..." | Re-trigger Greptile |
| fn supports_lockfile_url(&self) -> bool { | ||
| false | ||
| } |
There was a problem hiding this comment.
No regression test for locked mode
The fix is correct, but there's no new e2e test covering mise install --locked with a go-backend tool. The existing lockfile tests (e.g. e2e/lockfile/test_lockfile_install, e2e/lockfile/test_lockfile_locked_mode) don't exercise this code path for the go backend. Without a test, a future refactor that accidentally reverts this override or changes how supports_lockfile_url() is wired would silently re-introduce the regression.
Consider adding a small test under e2e/lockfile/ — something like:
#!/usr/bin/env bash
export MISE_LOCKFILE=1
cat <<EOF >mise.toml
[tools]
"go:golang.org/x/tools/cmd/goimports" = "latest"
EOF
# mise lock should succeed and produce an entry without a URL
mise lock
assert_contains "mise.lock" 'backend = "go"'
# mise install --locked should succeed (not bail with "No lockfile URL found")
mise install --locked### 🚀 Features - **(python)** add GitHub provenance verification for prebuilt binaries by @malept in [#8820](#8820) ### 🐛 Bug Fixes - **(ci)** use rustls-native-roots for Windows CI build by @jdx in [#8822](#8822) - **(go)** improve version fetching logic to support deeply nested sub-modules by @roele in [#8823](#8823) - **(shim)** prevent infinite recursion when system shims dir is on PATH by @andrewthauer in [#8816](#8816) - go backend missing supports_lockfile_url() override by @palootcenas-outreach in [#8790](#8790) - strip shims from PATH in credential and template subprocesses by @antonioacg in [#8802](#8802) ### 📚 Documentation - fix typo in shims documentation for fish by @roele in [#8798](#8798) ### 📦️ Dependency Updates - update ghcr.io/jdx/mise:alpine docker digest to 3e6d001 by @renovate[bot] in [#8794](#8794) - pin dependencies by @renovate[bot] in [#8793](#8793) ### 📦 Registry - fix flutter version sorting by @roele in [#8818](#8818) - add svgo (npm:svgo) by @3w36zj6 in [#8817](#8817) ### New Contributors - @antonioacg made their first contribution in [#8802](#8802) - @palootcenas-outreach made their first contribution in [#8790](#8790) ## 📦 Aqua Registry Updates #### New Packages (3) - [`RasKrebs/sonar`](https://github.com/RasKrebs/sonar) - [`emacs-eask/cli`](https://github.com/emacs-eask/cli) - [`superradcompany/microsandbox`](https://github.com/superradcompany/microsandbox) #### Updated Packages (4) - [`dimo414/bkt`](https://github.com/dimo414/bkt) - [`lxc/incus`](https://github.com/lxc/incus) - [`shinagawa-web/gomarklint`](https://github.com/shinagawa-web/gomarklint) - [`updatecli/updatecli`](https://github.com/updatecli/updatecli)
Summary
Go backend tools compile from source via
go installand don't produce downloadable binary artifacts. The defaultsupports_lockfile_url()returnstrue, causing--lockedmode to fail for any go-backend tool since their lockfile entries can never contain platform-specific download URLs.This adds
supports_lockfile_url() -> falseto the Go backend, matching the pattern already used by cargo, npm, pipx, asdf, dotnet, rust, and ubi backends.The Problem
When using
--lockedmode with go-backend tools:mise lockgenerates entries without download URLs (because there are none — go tools are compiled from source):Then
mise install --lockedfails becauseinstall_version()insrc/backend/mod.rsexpects lockfile URLs whensupports_lockfile_url()returnstrue.The Fix
One-line override in
src/backend/go.rs:Note:
gem,spm, andcondabackends may have the same issue — they also don't overridesupports_lockfile_url()and may compile from source or use non-URL-based installation. Worth checking.Related
disable_backendsbypass): `disable_backends` doesn't work for explicitly declared tools (two bugs) #8789