Skip to content

Add "go" _util command; use it to run getmingw#2165

Merged
dagood merged 2 commits intomicrosoft/mainfrom
dev/dagood/util-go
Feb 27, 2026
Merged

Add "go" _util command; use it to run getmingw#2165
dagood merged 2 commits intomicrosoft/mainfrom
dev/dagood/util-go

Conversation

@dagood
Copy link
Member

@dagood dagood commented Feb 27, 2026

Add pwsh eng/run.ps1 go [...]. This runs any go command, 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/getmingw rather than using an ambiently installed go.

This is also useful in general: it's sometimes annoying to work with the _util module because it doesn't live in the root of the repo. Now you can use commands like pwsh eng/run.ps1 go mod tidy from the root to maintain the _util module.

@dagood dagood requested a review from a team as a code owner February 27, 2026 19:31
@dagood dagood requested a review from Copilot February 27, 2026 19:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/go tool to proxy go invocations through the stage 0 toolchain and run from the _util module directory.
  • Update the Windows pipeline MinGW install step to run github.com/microsoft/go-infra/cmd/getmingw via eng/run.ps1 go run ... instead of go 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.

@dagood dagood merged commit 0f0768a into microsoft/main Feb 27, 2026
43 checks passed
@dagood dagood deleted the dev/dagood/util-go branch February 27, 2026 22:37
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.

3 participants