Skip to content
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

cmd/dist,cmd/go: no such tool "dist" running go tool dist list #60939

Closed
marten-seemann opened this issue Jun 22, 2023 · 6 comments
Closed

cmd/dist,cmd/go: no such tool "dist" running go tool dist list #60939

marten-seemann opened this issue Jun 22, 2023 · 6 comments
Assignees
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@marten-seemann
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version go1.21rc2 darwin/arm64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/marten/Library/Caches/go-build'
GOENV='/Users/marten/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/marten/src/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/marten/src/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/marten/bin/go1.21ex'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/marten/bin/go1.21ex/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21rc2'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/q0/b5ynf00142l7bl9sp8y098zr0000gn/T/go-build2814318498=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

I use go tool dist list to get the architectures available for cross-compilation (CI workflow).

What did you expect to see?

The list of architectures available for cross-compilation. This worked fine in Go 1.20.x.

What did you see instead?

❯ go tool dist list
go: no such tool "dist"
@prattmic
Copy link
Member

cc @rsc

@bcmills bcmills added this to the Go1.21 milestone Jun 22, 2023
@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Jun 22, 2023
@bcmills bcmills self-assigned this Jun 22, 2023
@bcmills
Copy link
Contributor

bcmills commented Jun 22, 2023

Our current thinking is that shipping go tool dist is excessive, but breaking scripts that rely on go tool dist list is also unfortunate. Perhaps we can allow cmd/go to impersonate dist when the command is go tool dist list and the dist tool isn't present.

@bcmills bcmills added the GoCommand cmd/go label Jun 22, 2023
@dmitshur
Copy link
Contributor

Mentioning that there is a workaround that can be used with go1.21rc2:

~ $ go version
go version go1.21rc2 darwin/arm64
~ $ go tool dist list
go: no such tool "dist"
~ $ GOROOT=$(go env GOROOT) go run cmd/dist list          
aix/ppc64
android/386
android/amd64
android/arm
[...]

It is more verbose than just go tool dist list, and slightly slower since go builds the dist command on the fly. But that wouldn't be noticeable in the context of a CI job.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/505175 mentions this issue: internal/platform,cmd/dist: export the list of supported platforms

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/505176 mentions this issue: cmd/go: impersonate 'go tool dist list' if 'go tool dist' is not present

@bcmills bcmills changed the title cmd/dist: no such tool "dist" cmd/dist,cmd/go: no such tool "dist" running go tool dist list Jun 22, 2023
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 22, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/505216 mentions this issue: dashboard: simplify 'go tool dist list' invocation for Go 1.21 RC 3

gopherbot pushed a commit that referenced this issue Jun 22, 2023
Also switch internal/platform to commit the generated code instead of
regenerating it in cmd/dist. Nothing in the generated code depends on
the target configuration, and committing the source file makes it
more amenable to searching and indexing (particularly on
https://cs.opensource.google/go/go).

For #60939.

Change-Id: I9133dfd5129b3c4d7457267589dfac5e7ecbef65
Reviewed-on: https://go-review.googlesource.com/c/go/+/505175
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
bradfitz pushed a commit to tailscale/go that referenced this issue Jul 15, 2023
Also switch internal/platform to commit the generated code instead of
regenerating it in cmd/dist. Nothing in the generated code depends on
the target configuration, and committing the source file makes it
more amenable to searching and indexing (particularly on
https://cs.opensource.google/go/go).

For golang#60939.

Change-Id: I9133dfd5129b3c4d7457267589dfac5e7ecbef65
Reviewed-on: https://go-review.googlesource.com/c/go/+/505175
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
bradfitz pushed a commit to tailscale/go that referenced this issue Jul 15, 2023
Fixes golang#60939.

Change-Id: I6a15db558a8e80e242818cccd642899aba47e596
Reviewed-on: https://go-review.googlesource.com/c/go/+/505176
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
gopherbot pushed a commit to golang/build that referenced this issue Jul 17, 2023
It's viable to use go tool subcommand now that CL 505176 landed.
It's included in the recent Go 1.21 Release Candidate 3 release.

For golang/go#60939.

Change-Id: I4d64e145eba5fb9761790f5445773aff08330a42
Reviewed-on: https://go-review.googlesource.com/c/build/+/505216
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
@golang golang locked and limited conversation to collaborators Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants