Skip to content

Conversation

@mariduv
Copy link
Contributor

@mariduv mariduv commented Nov 18, 2025

Currently, using go-backend tools in a project directory that is also using go vendoring emits error messages and can't find versions during outdated and upgrade :

go: can't determine available versions using the vendor directory
        (Use -mod=mod or -mod=readonly to bypass.)
mise WARN  No versions found for delve

The underlying command here is go list -m -versions -json <module>; the go toolchain switches itself to -mod=vendor if a vendor directory is present. The go install run by mise, on the other hand, always has an @<version>, so vendored modules are never used for install. So I think only the "mod=vendor is unexpected/unwanted" case needs to be covered for a fix at this time.


Note

Force go list to use -mod=readonly so versions can be listed even when a vendor directory exists.

  • Go backend:
    • Use go list -mod=readonly -m -versions -json <module> in src/backend/go.rs::_list_remote_versions to avoid implicit -mod=vendor and ensure module versions are retrievable.

Written by Cursor Bugbot for commit 6d04332. This will update automatically on new commits. Configure here.

@jdx
Copy link
Owner

jdx commented Nov 18, 2025

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@jdx jdx enabled auto-merge (squash) November 18, 2025 23:23
@jdx jdx merged commit 338113c into jdx:main Nov 18, 2025
28 checks passed
jdx pushed a commit that referenced this pull request Nov 20, 2025
### 📦 Registry

- added nelm by @tony-sol in
[#7020](#7020)

### 🚀 Features

- **(exec)** ensure MISE_ENV is set in spawned shell when specified via
-E flag by @ceelian in [#7007](#7007)

### 🐛 Bug Fixes

- **(go)** Don't allow auto mod=vendor mode by @mariduv in
[#7006](#7006)
- **(nushell)** test `use` not `source`, fix pipeline parse error by
@jokeyrhyme in [#7013](#7013)
- **(tasks)** make file paths relative to config location and
templateable by @halms in [#7005](#7005)

### Chore

- **(deny)** add exclusion for number_prefix by @jdx in
[e955ecb](e955ecb)

### New Contributors

- @mariduv made their first contribution in
[#7006](#7006)
- @ceelian made their first contribution in
[#7007](#7007)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`blender/blender`](https://github.com/blender/blender)
- [`werf/werf`](https://github.com/werf/werf)

#### Updated Packages (1)

- [`mas-cli/mas`](https://github.com/mas-cli/mas)
jdx pushed a commit that referenced this pull request Nov 25, 2025
In a Go project where I'm using mise, we have an explicit environment
variable set to force vendoring for our dependencies via `GOFLAGS`:

```toml
[env]
GOFLAGS = "-mod=vendor"

[tools]
"go:golang.org/x/tools/cmd/goimports" = "0.39.0"
```

Unfortunately (fortunately?) this flag also gets applied to any `go:...`
backend tool installs, which results in the following:
```shell
$ mise install
go: golang.org/x/tools/cmd/[email protected]: cannot query module due to -mod=vendor
mise ERROR go failed
go: golang.org/x/tools/cmd/[email protected]: cannot query module due to -mod=vendor
mise WARN  Failed to install, trying again without added 'v' prefix
go: golang.org/x/tools/cmd/[email protected]: cannot query module due to -mod=vendor
mise ERROR go failed
go: golang.org/x/tools/cmd/[email protected]: cannot query module due to -mod=vendor
mise ERROR Failed to install go:golang.org/x/tools/cmd/[email protected]:
   0: go exited with non-zero status: exit code 1
```

To address this, `mise` can pass `-mod=readonly` to the `go install`
command, similar to how #7006 changed
the `go list` command to include `-mod=readonly`.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Passes -mod=readonly to Go backend installs to prevent module
modification and avoid vendor-mode conflicts.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
325109c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Signed-off-by: Joonas Bergius <[email protected]>
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