-
-
Notifications
You must be signed in to change notification settings - Fork 769
fix(go): Don't allow auto mod=vendor mode #7006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Owner
|
bugbot run |
There was a problem hiding this 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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, using go-backend tools in a project directory that is also using go vendoring emits error messages and can't find versions during
outdatedandupgrade:The underlying command here is
go list -m -versions -json <module>; the go toolchain switches itself to-mod=vendorif a vendor directory is present. Thego installrun 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 listto use-mod=readonlyso versions can be listed even when a vendor directory exists.go list -mod=readonly -m -versions -json <module>insrc/backend/go.rs::_list_remote_versionsto avoid implicit-mod=vendorand ensure module versions are retrievable.Written by Cursor Bugbot for commit 6d04332. This will update automatically on new commits. Configure here.