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

golang.org/dl/gotip: command should override GOROOT with its tip packages location #35577

Closed
lggomez opened this issue Nov 13, 2019 · 4 comments
Assignees

Comments

@lggomez
Copy link

@lggomez lggomez commented Nov 13, 2019

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

$ go version
1.13.4

Does this issue reproduce with the latest release?

Yes

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

go env
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build255297653=/tmp/go-build -gno-record-gcc-switches"

What did you do?

While verifying an issue fix from tip (#34123), I built the affected repro case I have using gotip run main.go

What did you expect to see?

I expected the compiled app to use the runtime packages downloaded by it

What did you see instead?

The app was still being built using the local GOROOT packages. I had to override GOROOT manually to achieve that end: GOROOT=~/sdk/gotip gotip run main.go

Since the purpose of gotip is to serve as a downloader and nightly version of Go it could be more consistent from an usability standpoint for it to use its packages by default (although I guess that this would be a breaking change because all users of this all are already used to this behavior)

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 13, 2019

Do you normally have GOROOT set in the environment? You shouldn't.

@lggomez

This comment has been minimized.

Copy link
Author

@lggomez lggomez commented Nov 14, 2019

Yes but because I use this version of gvm to manage multiple go versions at work

In this specific case it was a docker container, I would have to check if it is set up by default on our production images but I don´t recall tweaking it on this specific container

@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Nov 14, 2019

Which version of gotip are you using? Is it the latest?

I believe this exact change was very recently implemented via CL 206537 and issue #35507. Please let me know if I'm overlooking something.

@dmitshur dmitshur changed the title gotip: command should override GOROOT with its tip packages location golang.org/dl/gotip: command should override GOROOT with its tip packages location Nov 14, 2019
@lggomez

This comment has been minimized.

Copy link
Author

@lggomez lggomez commented Nov 14, 2019

@dmitshur it wasn´t the latest, updating it solved it. Thanks

@lggomez lggomez closed this Nov 14, 2019
@dmitshur dmitshur self-assigned this Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.