Repository navigation
Add a Go AppHost tooling check to aspire doctor - #21196
Conversation
aspire doctor now reports Go toolchain problems for a Go AppHost, the way it already does for TypeScript, instead of leaving users to find out when aspire run fails. GoAppHostToolingCheck stays silent unless the resolved AppHost is apphost.go. It fails when go is not on PATH (with an install link) and checks go version against the Go 1.26 floor declared by the generated SDK go.mod. An older toolchain is a warning when Go can download the required toolchain (GOTOOLCHAIN unset or auto, Go 1.21 or later) and a failure when GOTOOLCHAIN=local or Go predates toolchain switching. A passing check reports the language and version in its metadata. Also add go to the missing-command table so aspire run prints the friendly install message, and route the generated go.mod templates to Aspire.Cli.Tests in the test trigger map because the drift test reads them. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
The go command takes GOTOOLCHAIN from the process environment, then from the user config written by go env -w, then from $GOROOT/go.env. The check only read the process environment and only treated local as blocking. Fedora's Go package ships GOTOOLCHAIN=local in go.env, and users can run go env -w GOTOOLCHAIN=local. With a Go older than 1.26 on such a machine, doctor warned that Go downloads the toolchain while go run fails with "go.mod requires go >= 1.26 (running go 1.2x; GOTOOLCHAIN=local)". For Go 1.21 up to 1.25, a non-empty process GOTOOLCHAIN is now used as is. Otherwise the check runs go env GOTOOLCHAIN with the same 5 second timeout as the version probe, in a fresh empty temp directory that is deleted afterwards, never in the AppHost directory, so a go.mod there cannot trigger a toolchain download. An unreadable answer counts as auto. local, path, local+path and <name>+path fail; auto, <name>+auto and a pinned <name> keep the download warning. A pinned GOTOOLCHAIN=<name> is not modelled. Nothing extra runs for Go 1.26 or later, or for Go older than 1.21. Add tests for each GOTOOLCHAIN source and value, the probe directory lifecycle, and the version probe pinning GOTOOLCHAIN=local. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21196Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21196" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
AppHost discovery can skip or misapply Go checks, and offline toolchain selection can incorrectly report failure.
3 open issues
What changed in this PR
Adds Go AppHost tooling diagnostics to aspire doctor, supporting Go general availability work.
Changes:
- Checks Go availability, minimum version, and toolchain download settings.
- Adds Go-specific installation guidance.
- Adds tests and CI routing for minimum-version consistency.
| File | Description |
|---|---|
| tests/Infrastructure.Tests/TestTriggerMap/TestTriggerMapTests.cs | Tests Go template routing. |
| tests/Aspire.Cli.Tests/Utils/CommandPathResolverTests.cs | Tests missing-Go guidance. |
| tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs | Registers the check for tests. |
| tests/Aspire.Cli.Tests/Commands/GoAppHostToolingCheckTests.cs | Covers diagnostics and version consistency. |
| src/Shared/CommandPathResolver.cs | Adds Go installation guidance. |
| src/Aspire.Cli/Utils/EnvironmentChecker/GoAppHostToolingCheck.cs | Implements Go tooling diagnostics. |
| src/Aspire.Cli/Projects/ProjectLocator.cs | Updates a caller-list comment only. |
| src/Aspire.Cli/Program.cs | Registers the Go check. |
| eng/github-ci/test-trigger-map.yml | Routes Go template changes to CLI tests. |
Review effort: Balanced
The configured AppHost is authoritative. When settings select an AppHost of another language, that AppHost is the one that runs, so the check returns no results instead of falling back to discovery and requiring Go for an unrelated apphost.go in the working directory. When no AppHost is configured, the check looks for apphost.go through the Go language definition instead of DetectLanguageRecursiveAsync. That method returns only the first language that matches, and C# matches any *.csproj, so a Go AppHost beside a service project was never checked. The Go language definition is only returned while experimentalPolyglotGo is on, so the lookup stays feature-gated. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Only GOTOOLCHAIN=local proves that a Go older than the minimum cannot run the AppHost: it never switches toolchains. The path modes (path, local+path and <name>+path) never download, but they look in PATH for the exact toolchain that go.mod names, for example go1.26.0 for `go 1.26`, and fail only when it is missing. Doctor does not read go.mod, so those settings now produce a warning that names the toolchain to put on PATH instead of a failure. The local failure now says Go cannot switch to a newer toolchain, because local also blocks a toolchain that is already on PATH. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Launch 'go version' and 'go env GOTOOLCHAIN' through the shared process execution factory instead of Process.RunAndCaptureTextAsync, so the probes get the same child-process behavior as the rest of the CLI: ASPIRE_CLI_* identity variables are stripped, output encodings are pinned, and each launch is debug-logged. A hung go is still killed with its process tree when the 5 second probe timeout elapses. The probe takes the timeout as a parameter, so the failure, start-failure, timeout and cancellation paths are covered by unit tests that use the shared TestProcessExecutionFactory. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Tests selector10 / 100 PR test projects · 4 PR jobs, from 9 changed files. Selected PR test projects (10 / 100)
Selected PR jobs (4)
How these were chosen — grouped by what changed
🔧 📦 affected project 📄 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Sébastien Ros (sebastienros)
left a comment
There was a problem hiding this comment.
Thanks, this looks good to me. The probes are careful (output is drained before the exit code returns, the process tree is killed on timeout, GOTOOLCHAIN=local is set only on the version probe), the earlier discovery and path-mode issues are fixed with regression tests, and the trigger-map rule covers the go.mod template guard. I ran GoAppHostToolingCheckTests, CommandPathResolverTests and DoctorCommandTests locally on macOS arm64: 110 passed.
One minor inline note below. It can be a follow-up or a small update before merge.
Cross-PR note: #21183 removes the experimentalPolyglotGo flag. Whichever of the two PRs merges second has to drop this PR's use of it. The check itself only relies on GetLanguageById returning the Go definition, but GoAppHostToolingCheckTests.CreateLanguageDiscovery references KnownFeatures.ExperimentalPolyglotGo and CheckAsync_Skips_WhenGoFeatureIsDisabled tests the flag-off path, and the comment in ResolveGoAppHostAsync describes the gating.
|
Pull request created: #1966
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1966 targeting Updated Note This draft PR needs human review before merging. |
> [!IMPORTANT] > **Merge last.** This PR depends on the other open Go AppHost PRs and must land after them. > > - **Must land first**, because each adds references to the flag that this PR has to delete: #21189 (E2E helper and call sites), #21195 (`SdkExportCommandTests`) and #21196 (`GoAppHostToolingCheck` and its tests). > - **Must land first**, because it edits the same hunk of `DefaultLanguageDiscovery.cs` and this PR rebases onto it: #21191. > - **Should land first**, because removing the flag turns Go on for everyone and these fixes should ship before it: #21186, #21187, #21188, #21193, #21194, #21197 and #21199. ## Description Removes the `experimentalPolyglotGo` feature flag so Go AppHosts are available by default, the same way TypeScript AppHosts are. With no flag, **Empty (Go AppHost)** and **Starter App (Go API + Redis, Go AppHost)** are offered by interactive and non-interactive `aspire new`, and Go is offered by `aspire init` language selection and `--language go`. **This is the GA switch for the Go AppHost epic (#21115) and must merge last**, after the other children have landed: #21108 (E2E, publish, deploy), #21110 (support policy, API review, packaging), #21112 (docs and samples) and #21114 (VS Code debugging). It was opened as a draft so CI exercises the 52 Go fixtures without the flag. It is ready for review now, but not for merging. What changed: - **CLI:** `KnownFeatures` drops the Go flag and `DefaultLanguageDiscovery` no longer marks Go experimental. `LanguageInfo.IsExperimental` is kept because Python, Java and Rust still use it. - **Leftover key:** a stale `experimentalPolyglotGo` in a user's configuration is ignored with no warning, matching what happened to the TypeScript flag when it was removed. `Features` only reads named keys, and the extension schemas set `additionalProperties: false`, so VS Code flags the stale key. - **Extension schemas:** `aspire-config`, `aspire-global-settings` and `aspire-settings` are regenerated with `extension/scripts/generate-schema.js`. Only the 16-line Go block is removed from each. - **Fixtures and CI:** 52 `tests/PolyglotAppHosts/*/Go/aspire.config.json` files and `.github/workflows/polyglot-validation/Dockerfile.golang` no longer set the key. - **Java E2E picker offsets:** Go is always listed now, so with only the Java flag set the `aspire init` language picker is C#, TypeScript, Go, Java, and Java needs 3 Down presses instead of 2. The first CI run on this PR timed out waiting for `> Java` in `JavaPolyglotTests`, `JavaCodegenValidationTests` and `JavaPolyglotApphostDirectoryTests`; each now presses Down once more, with a comment stating the picker order. The order comes from `DefaultLanguageDiscovery`, `LanguageService` and `CliTemplateFactory`. TypeScript flows are unaffected because TypeScript sorts before Go. - **Tests:** `DefaultLanguageDiscoveryTests`, `NewCommandTests`, `ConfigCommandTests`, `NewCommandTemplateConfigPersistenceTests` and `InitCommandTests` now expect Go without the flag, with 6 new tests. One of them, `GetAvailableLanguagesAsync_ListsLanguagesInPickerOrder`, pins the picker order so a future ungated language fails a unit test before it breaks a Docker E2E run. - **Docs:** `docs/specs/polyglot-apphost.md`, the Go code generation README and `playground/GoAppHost/apphost.go` no longer mention the flag. Fixes #21106 ## Validation | Command | Result | | --- | --- | | `.\restore.cmd` | passed | | `dotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj -m:2 --no-restore` | 0 warnings, 0 errors | | `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.DefaultLanguageDiscoveryTests" --filter-class "*.NewCommandTests" --filter-class "*.ConfigCommandTests" --filter-class "*.NewCommandTemplateConfigPersistenceTests" --filter-class "*.InitCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | 312 passed, 0 failed (run before the picker-order test was added) | | `dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.DefaultLanguageDiscoveryTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | 39 passed, 0 failed (38 existing plus the picker-order test) | | `node extension\scripts\generate-schema.js` | only the Go block was removed from each schema | | repository-wide search for `experimentalPolyglotGo` and its variants | 0 hits | | JSON parse of the 53 fixtures and 3 schemas | all parse, none contain the flag | Run in PR CI instead of locally, all passing on `0e65752d44`: the three Java E2E tests (`JavaPolyglotTests`, `JavaCodegenValidationTests` and `JavaPolyglotApphostDirectoryTests`; they need Docker, so CI was the first execution of the extra Down press), `Infrastructure.Tests` and the VS Code extension unit and E2E jobs. Not run: the VS Code new-project flow in an extension host (`extension/src/commands/new.ts` just runs `aspire new`). ### Before merging - [ ] Search again for `experimentalPolyglotGo`, `KnownFeatures.ExperimentalPolyglotGo`, `EnableExperimentalGoSupportAsync`, `features__experimentalPolyglotGo` and `experimentalPolyglot:go`, because open Go branches add flag setup of their own and this PR must merge after all of them. Today that covers #21189 (the `EnableExperimentalGoSupportAsync` helper and its call sites in every Go scenario), #21195 (`SdkExportCommandTests` sets `KnownFeatures.ExperimentalPolyglotGo`) and #21196 (`GoAppHostToolingCheckTests` builds its language discovery with the flag, including a `goEnabled: false` case that stops being meaningful, and `GoAppHostToolingCheck` has a comment that describes the flag). Each of them stops compiling or goes stale once the flag is removed, so delete or rewrite them here. - [ ] Rebase onto #21191, which adds `DefaultHostingPackages = ["Aspire.Hosting.Go"]` to Go's `LanguageInfo` in the same hunk of `DefaultLanguageDiscovery.cs` (#21045). Keep that initializer and drop `IsExperimental: true`. - [ ] Drop the Go experimental notes in the aspire.dev API reference and docs at the same time. ## Checklist - Is this feature complete? - [ ] Yes. Ready to ship. - [x] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: David Pine <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
Documents changes from microsoft/aspire#21196 Author: ``@davidfowl-unknown-placeholder`` Targeting `release/17.0` based on the source PR milestone `17.0` (`exact_match`). ## Why `aspire doctor` gained a `GoAppHostToolingCheck` that validates the Go toolchain for Go AppHosts. The doctor reference page didn't mention it. ## Changes - Updated `src/frontend/src/content/docs/reference/cli/commands/aspire-doctor.mdx` (existing page) with a "Go AppHost checks" entry covering `go-apphost-go`, `go-apphost-version`, and `go-apphost-tools` outcomes. > Generated by [PR Documentation Check](https://github.com/microsoft/aspire/actions/runs/40727728528) for #21196 · copilot · auto · 19.1 AIC · ⌖ 1.14 AIC · ⊞ 7.1K · [◷](https://github.com/search?q=repo%3Amicrosoft%2Faspire.dev+%22gh-aw-workflow-id%3A+pr-docs-check%22&type=pullrequests) <!-- gh-aw-agentic-workflow: PR Documentation Check, engine: copilot, model: auto, id: 40727728528, workflow_id: pr-docs-check, run: https://github.com/microsoft/aspire/actions/runs/40727728528 --> <!-- gh-aw-workflow-id: pr-docs-check --> <!-- gh-aw-workflow-call-id: microsoft/aspire/pr-docs-check --> --------- Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com> Co-authored-by: Sébastien Ros <[email protected]>

Description
aspire doctorchecks the TypeScript AppHost toolchain but says nothing about Go. A Go AppHost needs a Go toolchain at or above thego 1.26directive in the generated SDK and the scaffoldedgo.mod, andaspire runwithout one fails late with a raw process-start error.This adds
GoAppHostToolingCheck(order 33, next toTypeScriptAppHostToolingCheck). It runs only for a Go AppHost, so other AppHost languages see no change. The configured AppHost is authoritative: when settings select an AppHost of another language there are no Go checks. When none is configured, the check looks forapphost.goin the working directory.go-apphost-gogois not onPATH(includes the install link)go-apphost-versionGOTOOLCHAINislocal(Go never switches toolchains, so it cannot satisfy the AppHost'sgo 1.26)go-apphost-versionGOTOOLCHAINispath,local+pathor<name>+path: Go only switches to a newer toolchain that is already onPATH(for examplego1.26.0), and the check does not readgo.mod, so it cannot tell whether one is therego-apphost-versionGOTOOLCHAIN(auto,<name>,<name>+auto), or no readable answer fromgo env GOTOOLCHAINgo-apphost-versiongo versionprints nothing readable (inconclusive, not proven broken)go-apphost-toolsDetails worth knowing:
GOTOOLCHAINis only needed for Go 1.21 up to 1.25. Nothing extra runs for Go 1.26 or later, or for Go older than 1.21. Thegocommand takes the value from the process environment, then from the user config thatgo env -wwrites, then from$GOROOT/go.env. Fedora's Go package shipsGOTOOLCHAIN=localin thatgo.env(Fedora docs). A non-empty process variable is used as is. Otherwise the check runsgo env GOTOOLCHAINwith the same 5 s timeout as the version probe, and a failure or empty output counts asauto, which keeps the Warning.go env GOTOOLCHAINruns in a fresh empty directory under the temp folder, deleted afterwards, never in the AppHost directory, because doctor must not download a toolchain, and go commands that read ago.modcan trigger a download. Measured in a directory whose go.mod saysgo 1.99: on Go 1.24.1 and 1.27.0go env GOTOOLCHAINprintedautowithout switching, whilego versionthere tries to downloadgo1.99.0. The empty directory keeps the probe independent of that behaviour; it is defence in depth, not a documented guarantee.go versionruns withGOTOOLCHAIN=local. With the defaultauto, everygocommand runs toolchain selection first, so a Go older than thego.modin the current directory tries to download that toolchain instead of reporting the installed version. On Go 1.24.1 in thego 1.99directorygo versionfailed after 0.8 s; withlocalit answered in 0.04 s.gothroughIProcessExecutionFactory, like the other CLI child processes: theASPIRE_CLI_*identity variables are stripped from the environment, output encodings are pinned, and each launch is debug-logged. Agothat outlives the 5 s timeout is killed together with its process tree. Standard output and standard error are collected separately:goreports notices such as a toolchain download on standard error, and they must not end up in the version string or in theGOTOOLCHAINvalue that the callers parse. A non-zero exit is logged at debug level with its standard error and counts as no answer.GOTOOLCHAIN=localproves failure. In every modegolooks inPATHfor the exact toolchain thatgo.modnames (the go linego 1.26becomesgo1.26.0), and the path modes fail only when that executable is missing (cmd/go/internal/toolchain/select.go). Measured with Go 1.27.0,GOTOOLCHAIN=pathand ago.modthat saysgo 1.99: with nogo1.99.0onPATH,go list .printsgo: cannot find "go1.99.0" in PATH; with ago1.99.0shim onPATH, Go selects and runs it offline; ago1.99.1shim is not accepted. The check does not readgo.mod, sopath,local+pathand<name>+pathare a Warning that names the toolchain to put onPATH, built fromMinimumGoVersion.GOTOOLCHAINvalues are matched case-sensitively, as thegocommand does.CommandPathResolvernow knowsgo, so the AppHost launcher reportsgo is not installed or not found in PATH. Please install Go and try again.withhttps://go.dev/doc/installinstead of a process-start failure.Aspire.Hosting.CodeGeneration.Go.MinimumGoVersion_MatchesGoModTemplatereads thegodirective from the templates inAtsGoCodeGenerator.csandGoLanguageSupport.csand fails when they stop matching. Apath_rulesentry ineng/github-ci/test-trigger-map.ymlselectsAspire.Cli.Testswhen either file changes, with a guard test inInfrastructure.Tests.experimentalPolyglotGois on, so the check returns no results with the flag off and needs no change when the flag is removed ([Go AppHost preview] Remove the feature flag and expose Go templates #21106). The check asks that definition forapphost.godirectly instead of callingDetectLanguageRecursiveAsync, which returns only the first language that matches, and C# matches any*.csproj: a Go AppHost beside a service project would be reported as C#.Part of #21115
Known limitations
GOTOOLCHAIN=<name>(for examplego1.24.1) is not modelled; the check validates the Go onPATH.path,local+pathand<name>+paththe check cannot tell whether the toolchain thatgo.modnames is onPATH, because it does not readgo.mod; it warns.go1.26rc1is accepted as Go 1.26.Not in this PR
apphost.godirectly.TypeScriptAppHostToolingCheckresolves throughLegacyTypeScriptAppHost, which is shared withaspire update --migrateand falls back to first-language-wins discovery even when settings select another language's AppHost.Validation
All commands ran on Windows with the repo-local SDK, on the head of this branch, on top of
upstream/main5ea175ce62.mainhas since moved ten commits (f4ae2cc424); a trial merge of this branch into it is clean, and the commands were not repeated on the merged result.dotnet build src\Aspire.Cli\Aspire.Cli.csproj -m:2 --no-restore --no-incremental -p:BuildProjectReferences=falsedotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-class "*.GoAppHostToolingCheckTests" --filter-class "*.TypeScriptAppHostToolingCheckTests" --filter-class "*.DoctorCommandTests" --filter-class "*.EnvironmentCheckerTests" --filter-class "*.CommandPathResolverTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"GoAppHostToolingCheckTests)dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-restore --no-launch-profile -- --filter-class "*.TestTriggerMapTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"The
GOTOOLCHAINhandling and the AppHost lookup were each tested RED first, against the code before the change, and went GREEN afterwards:GOTOOLCHAINvalue: 10 of 45 Go tests failed, including everygo.envrow (expected Fail, actual Warning).apphost.go;apphost.gobeside a.csprojwith Go missing).path,local+pathand<name>+pathrows expected a Warning and got a Fail, and the fourlocalrows expected the new message.The probe runner has its own unit tests with the shared
TestProcessExecutionFactory. They cover: standard output returned without the standard error notices thatgoprints; a non-zero exit, which logs the standard error and gives no answer; a process that does not start; start failures (Win32Exception,InvalidOperationException,IOException); agothat outlives the timeout; and caller cancellation. The timeout is a parameter, so the timeout test takes milliseconds. A separate test asserts that thego env GOTOOLCHAINprobe does not overrideGOTOOLCHAIN.Real
aspire doctor --format jsonruns of the CLI built from this branch. The scratch directory has anapphost.gobesideapi\Api.csprojand{"features":{"experimentalPolyglotGo":true}}inaspire.config.json. The installed Go is 1.27.0. For the older-Go rows ago.cmdshim onPATHstands in for Go 1.24.1: it answersversionwithgo version go1.24.1 windows/amd64, answersenv GOTOOLCHAINwith a value from a test variable (defaultauto), and logs its arguments,GOTOOLCHAINand working directory.go-apphost-toolspass (go 1.27.0), exit 0goonPATHgo-apphost-gofail with the install link, exit 1GOTOOLCHAIN=localin the process environmentgo-apphost-versionfail, exit 1go env GOTOOLCHAINanswerslocalGOTOOLCHAIN=pathgo-apphost-versionwarning: "only lets Go switch to a newer toolchain that is already on PATH (for example go1.26.0)", exit 0GOTOOLCHAIN=go1.25.0+pathgo env GOTOOLCHAINanswerspathgo-apphost-versionwarning with the download message, exit 0aspire.config.jsonselects../ts/apphost.mts(Go enabled), the working directory also has anapphost.go, nogoonPATHexperimentalPolyglotGonot set,apphost.gobesideapi\Api.csproj, nogoonPATHThe shim saw
versionwithGOTOOLCHAIN=localin the AppHost directory. The runs without a processGOTOOLCHAINalso sawenv GOTOOLCHAIN, withGOTOOLCHAINunset, in a fresh%TEMP%\aspire-go-doctor-*directory, and no such directory was left afterwards. Go 1.27.0 reportsgo-apphost-toolswithmetadata{"language":"go","appHostPath":"...\\apphost.go","version":"1.27.0"}. Before the AppHost lookup change this layout produced no Go results, even with Go missing (the second RED test above).An earlier run used the real Go 1.24.1 binary (from a scratch module cache) with
GOTOOLCHAIN=localin the process environment, only in theGOENVconfig file, and only in ago.envunderGOROOT. Each gave the samego-apphost-versionfail, and the default gave the download warning. The code that reads the effectiveGOTOOLCHAINhas not changed since.After the probes moved to
IProcessExecutionFactory, the Go 1.27.0 run and the shim rows forGOTOOLCHAIN=local,go env GOTOOLCHAINansweringlocalorpath, and the default were run again on the new head with--log-level Debug. They gave the same results and left noaspire-go-doctor-*directory. The shim saw an emptyASPIRE_CLI_COMMITalthough the parent process had a 40-character SHA in it. Three more shim runs:gothat hangs: the debug log shows the wait canceled after 5 s and the kill of the process tree, the check gives the inconclusive warning, and nocmdorpingprocess was left behind.go versionthat writes a notice to standard error: the version is still read from standard output alone and the check carries on to thego env GOTOOLCHAINprobe.go versionthat exits with 2 and printsgo: cannot find main moduleto standard error: the debug log shows'go version' failed with exit code 2: go: cannot find main module, and the check gives the inconclusive warning.Not run:
go1.26.0toolchain onPATHwithGOTOOLCHAIN=path, end to end. The Go 1.27.0 measurements above, with a copy ofgo.exenamedgo1.99.0, show that Go selects aPATHtoolchain offline.go.envinstalled by a real distribution package. The real-binarygo.envrun usedGOROOTpointing at a scratch directory that holds only ago.env.aspire runfor a Go AppHost without Go onPATH, end to end. The message comes from the sameCommandPathResolverthatCommandPathResolverTestscovers.go.exethat exits with a non-zero code. That path is covered by a unit test and by ago.cmdshim that exits with 2.goonPATH, a configured TypeScript AppHost,experimentalPolyglotGooff) and theGOTOOLCHAIN=go1.25.0+pathrow were not repeated after the probes moved to the factory.Checklist
<remarks />and<code />elements on your triple slash comments?