Skip to content

fix(go): Remove install-time version override for subpath packages#9135

Merged
jdx merged 1 commit intojdx:mainfrom
c22:main
Apr 16, 2026
Merged

fix(go): Remove install-time version override for subpath packages#9135
jdx merged 1 commit intojdx:mainfrom
c22:main

Conversation

@c22
Copy link
Copy Markdown
Contributor

@c22 c22 commented Apr 16, 2026

The install method had a workaround that queried go list -m -versions on the full tool path (including subpath) and, if no versions were found, overrode tv.version to "latest". This was needed before #8968 because version resolution couldn't distinguish subpath packages from tagless modules.

After #8968, proxy-based resolution handles both cases correctly: subpaths get 404 (truncating to the root module), and tagless modules get their pseudo-version from @latest.

The old workaround now fights with the correct resolution, it queries the subpath (which always returns empty), overrides the version to "latest", and installs into a .../latest/ directory.

On the next mise up, version resolution finds e.g. 1.7.0 but .../1.7.0/ doesn't exist and causes a reinstall every time.

Apologies for missing this on the original PR!

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the install_version_ function in the Go backend by removing the logic that handled 'latest' pseudo-versions for modules without tagged versions. Additionally, it removes unnecessary mutability from the tv parameter and the install_version variable. I have no feedback to provide as there were no review comments to evaluate.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 16, 2026

Greptile Summary

This PR removes an install-time version override workaround in the Go backend that was introduced before proxy-based resolution (#8968) and has since been causing a mise up reinstall loop. The removed block called go list -m -versions on the full tool path (subpath included), always got an empty result for subpath packages, and then forced tv.version back to "latest" — so binaries landed in .../latest/ while version resolution later resolved a concrete semver, leaving no matching directory and triggering a reinstall every run.

Confidence Score: 5/5

Safe to merge — removes a narrow, clearly-broken workaround with no side-effects on the remaining install path.

The deleted block only fired when the user requested @latest, version resolution had already resolved a concrete version via the proxy (introduced in #8968), and go list -m -versions on the subpath returned empty (which it always does for subpaths). Removing it restores correct behaviour: the resolved version is kept, the binary lands in the right directory, and mise up no longer triggers an infinite reinstall loop. All remaining findings are P2 or lower.

No files require special attention.

Important Files Changed

Filename Overview
src/backend/go.rs Removes the stale install-time version override block and the now-unnecessary mut on tv; the rest of the file is unchanged.
e2e/backend/test_go_install_slow Updates inline comment to accurately describe why the kratos subpath test uses @latest (proxy pseudo-version resolution rather than the old go-list fallback).

Sequence Diagram

sequenceDiagram
    participant U as User (mise up)
    participant VR as Version Resolver
    participant Proxy as GOPROXY
    participant Install as install_version_

    Note over U,Install: Before fix (broken)
    U->>VR: resolve go:kratos/cmd/kratos/v2@latest
    VR->>Proxy: GET /github.com/go-kratos/kratos/@v/list
    Proxy-->>VR: [v2.7.0, ...]
    VR-->>Install: tv.version = "2.7.0"
    Install->>Install: go list -m -versions (subpath) → []
    Install->>Install: override tv.version = "latest"
    Install->>Install: go install ...@latest → installs to .../latest/
    U->>VR: resolve again (mise up)
    VR-->>VR: resolves "2.7.0"
    VR->>Install: .../2.7.0/ missing → reinstall (loop)

    Note over U,Install: After fix (correct)
    U->>VR: resolve go:kratos/cmd/kratos/v2@latest
    VR->>Proxy: GET /github.com/go-kratos/kratos/@v/list
    Proxy-->>VR: [v2.7.0, ...]
    VR-->>Install: tv.version = "2.7.0"
    Install->>Install: go install ...@v2.7.0 → installs to .../2.7.0/
    U->>VR: resolve again (mise up)
    VR-->>VR: resolves "2.7.0"
    VR->>Install: .../2.7.0/ exists → no reinstall ✓
Loading

Reviews (2): Last reviewed commit: "fix(go): Remove install-time version ove..." | Re-trigger Greptile

The install method had a workaround that queried `go list -m -versions` on the full tool path (including subpath) and, if no versions were found, overrode tv.version to "latest". This was needed before #8968 because version resolution couldn't distinguish subpath packages from tagless modules.

After #8968, proxy-based resolution handles both cases correctly: subpaths get 404 (truncating to the root module), and tagless modules get their pseudo-version from @latest.

The old workaround now fights with the correct resolution, it queries the subpath (which always returns empty), overrides the version to "latest", and installs into a `.../latest/` directory.

On the next `mise up`, version resolution finds e.g. `1.7.0` but `.../1.7.0/` doesn't exist and causes a reinstall every time.
@c22
Copy link
Copy Markdown
Contributor Author

c22 commented Apr 16, 2026

Stale test comment

Cleaned up

@jdx jdx merged commit 06a4e51 into jdx:main Apr 16, 2026
34 checks passed
mise-en-dev added a commit that referenced this pull request Apr 17, 2026
### 🚀 Features

- **(registry)** add .perl-version support for perl by @ergofriend in
[#9102](#9102)
- **(task)** add Tera template support for inline table run tasks by
@iamkroot in [#9079](#9079)

### 🐛 Bug Fixes

- **(env)** use runtime symlink paths for fuzzy versions by @jdx in
[#9143](#9143)
- **(github)** use full token resolution chain for attestation
verification by @jdx in [#9154](#9154)
- **(go)** Remove install-time version override for subpath packages by
@c22 in [#9135](#9135)
- **(npm)** respect install_before when resolving dist-tag versions by
@webkaz in [#9145](#9145)
- **(self-update)** ensure subcommand exists by @salim-b in
[#9144](#9144)
- **(task)** show available tasks when run target missing by @jdx in
[#9141](#9141)
- **(task)** forward task help args and add raw_args by @jdx in
[#9118](#9118)
- **(task)** remove red/yellow from task prefix colors by
@lechuckcaptain in [#8782](#8782)
- **(task)** merge TOML task block into same-named file task and surface
resolved dir by @jdx in [#9147](#9147)
- **(toolset)** round-trip serialized tool options by @atharvasingh7007
in [#9124](#9124)
- **(vfox)** fallback to absolute bin path if env_keys not set by
@80avin in [#9151](#9151)

### 📚 Documentation

- make agent guide wording generic by @jdx in
[#9142](#9142)

### 📦️ Dependency Updates

- update ghcr.io/jdx/mise:deb docker digest to e019cb9 by @renovate[bot]
in [#9160](#9160)
- update ghcr.io/jdx/mise:copr docker digest to 8d25608 by
@renovate[bot] in [#9159](#9159)
- update ghcr.io/jdx/mise:rpm docker digest to 22e52da by @renovate[bot]
in [#9161](#9161)
- update ghcr.io/jdx/mise:alpine docker digest to a3da97c by
@renovate[bot] in [#9158](#9158)
- update rust docker digest to 4a2ef38 by @renovate[bot] in
[#9162](#9162)
- update ubuntu:24.04 docker digest to c4a8d55 by @renovate[bot] in
[#9164](#9164)
- update rust crate aws-lc-rs to v1.16.3 by @renovate[bot] in
[#9165](#9165)
- update ubuntu docker tag to resolute-20260413 by @renovate[bot] in
[#9169](#9169)
- update rust crate clap to v4.6.1 by @renovate[bot] in
[#9166](#9166)
- update taiki-e/install-action digest to a2352fc by @renovate[bot] in
[#9163](#9163)
- update rust crate ctor to 0.10 by @renovate[bot] in
[#9170](#9170)
- update rust crate tokio to v1.52.1 by @renovate[bot] in
[#9167](#9167)
- update rust crate rmcp-macros to 0.17 by @renovate[bot] in
[#9173](#9173)
- update rust crate signal-hook to 0.4 by @renovate[bot] in
[#9177](#9177)
- update rust crate zipsign-api to 0.2 by @renovate[bot] in
[#9180](#9180)
- update rust crate toml_edit to 0.25 by @renovate[bot] in
[#9179](#9179)
- update rust crate strum to 0.28 by @renovate[bot] in
[#9178](#9178)

### 📦 Registry

- add ibmcloud by @dnwe in
[#9139](#9139)
- add rush by @jdx in [#9146](#9146)

### New Contributors

- @80avin made their first contribution in
[#9151](#9151)
- @atharvasingh7007 made their first contribution in
[#9124](#9124)
- @lechuckcaptain made their first contribution in
[#8782](#8782)
- @ergofriend made their first contribution in
[#9102](#9102)
- @dnwe made their first contribution in
[#9139](#9139)

## 📦 Aqua Registry Updates

#### New Packages (3)

-
[`controlplaneio-fluxcd/flux-operator`](https://github.com/controlplaneio-fluxcd/flux-operator)
-
[`dependency-check/DependencyCheck`](https://github.com/dependency-check/DependencyCheck)
- [`kiro.dev/kiro-cli`](https://github.com/kiro.dev/kiro-cli)

#### Updated Packages (2)

-
[`jreleaser/jreleaser/standalone`](https://github.com/jreleaser/jreleaser/standalone)
- [`sigstore/cosign`](https://github.com/sigstore/cosign)
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.

2 participants