x/tools/go/packages: loading should report error when use custom GOROOT #69606
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Go version
(gotip) go version devel go1.24-7c72dc7 Mon Sep 23 05:36:30 2024 +0000 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Checkout to the first patch of CL 615396 and run
gotip test ./go/packages -run ^TestIssue$
.What did you see happen?
The
packages.Load
doesn't report error while it doesn't load any packages.What did you expect to see?
Actually, when
packages.Load
runsgo list
underlying, it reportsgo: no such tool "compile"
. I think it's better to report this error instead of returning nil.Stderr is:
By the way, this relates the CL 615016 when we want to migrate
go/ssa/interp
away fromloader
. We need callpackages.Load
to load some "mocked" standard libraries instead of the typical compiler's src libs under(go/ssa/interp/testdata/src
) forinterp
to interpret the ssa main package. CC: @adonovan @timothy-kingThe text was updated successfully, but these errors were encountered: