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/go: GODEBUG=installgoroot=all appears to be broken #56687

Closed
ALTree opened this issue Nov 10, 2022 · 2 comments
Closed

cmd/go: GODEBUG=installgoroot=all appears to be broken #56687

ALTree opened this issue Nov 10, 2022 · 2 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

@ALTree
Copy link
Member

ALTree commented Nov 10, 2022

$ git clone --depth=1 https://go.googlesource.com/go go-tip
$ export GODEBUG=installgoroot=all
$ cd go-tip/src
$ ./make.bash
Building Go cmd/dist using /home/XXX/go. (go1.19.3 linux/amd64)
Building Go toolchain1 using /home/XXX/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for linux/amd64.
go: no install location for directory /home/XXX/go-tip/src/unsafe outside GOPATH
        For more details see: 'go help gopath'
go tool dist: FAILED: /home/XXX/go-tip/pkg/tool/linux_amd64/go_bootstrap install std cmd: exit status 1

My env

$ ~/go/bin/go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/XXX/.cache/go-build"
GOENV="/home/XXX/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/XXX/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/XXX/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/XXX/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/XXX/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/XXX/go-tip/src/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build792152691=/tmp/go-build -gno-record-gcc-switches"

I get this both on Linux and on Windows, with fresh Go installations, while building tip from source. A manual gotip install unsafe on GODEBUG=installgoroot=all fails with the same error, while other packages (like math) work and correctly put a math.a file in GOROOT/pkg.

cc @matloob

@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 10, 2022
@bcmills bcmills added the GoCommand cmd/go label Nov 10, 2022
@bcmills bcmills added this to the Go1.20 milestone Nov 10, 2022
@gopherbot
Copy link

Change https://go.dev/cl/449376 mentions this issue: go/build: omit PkgObj for packages "unsafe" and "builtin"

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 10, 2022
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 10, 2022
@gopherbot
Copy link

Change https://go.dev/cl/449515 mentions this issue: cmd/go/internal/load: remove a special case for "unsafe"

gopherbot pushed a commit that referenced this issue Nov 10, 2022
We had a special case to zero out the Target field for package
"unsafe", which is not imported from a normal object file.

As of CL 449376 that special case has been folded into go/build's
logic for setting the PkgObj field, so the special case in
cmd/go/internal/load has become redundant.

(Noticed while investigating CL 449376.)

Updates #47257.
Updates #56687.

Change-Id: I1668123aa6230097aa75e55380d3e2c7937c4b64
Reviewed-on: https://go-review.googlesource.com/c/go/+/449515
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
@golang golang locked and limited conversation to collaborators Nov 10, 2023
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

4 participants