Add "go" _util command; use it to run getmingw#2165
Merged
dagood merged 2 commits intomicrosoft/mainfrom Feb 27, 2026
Merged
Conversation
gdams
approved these changes
Feb 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new _util tool (go) that runs go commands using the stage 0 (Microsoft) Go toolchain, and updates the Windows pipeline to use it for running getmingw so builds don’t depend on an ambient Go installation.
Changes:
- Add
eng/_util/cmd/gotool to proxygoinvocations through the stage 0 toolchain and run from the_utilmodule directory. - Update the Windows pipeline MinGW install step to run
github.com/microsoft/go-infra/cmd/getmingwviaeng/run.ps1 go run ...instead ofgo install+ GOPATH binary execution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/pipeline/stages/run-stage.yml | Switch MinGW installation to use the new stage0-backed go tool via eng/run.ps1. |
| eng/_util/cmd/go/go.go | New _util command that runs stage0 go with working directory set to eng/_util. |
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
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.
Add
pwsh eng/run.ps1 go [...]. This runs anygocommand, but uses the stage 0 version of Go, which is the Microsoft build of Go.Use it during the build to run
github.com/microsoft/go-infra/cmd/getmingwrather than using an ambiently installedgo.This is also useful in general: it's sometimes annoying to work with the
_utilmodule because it doesn't live in the root of the repo. Now you can use commands likepwsh eng/run.ps1 go mod tidyfrom the root to maintain the _util module.