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

x/build/version: prepend $PATH with $GOROOT/bin #23635

dolmen opened this issue Jan 31, 2018 · 5 comments


Copy link

@dolmen dolmen commented Jan 31, 2018

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

go1.9.3, but trying go1.10rc1

Does this issue reproduce with the latest release?

Yes: golang/build@46a0bbc

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


What did you do?

$ go version
go version go1.9.3 darwin/amd64
$ go get
$ go1.10rc1 download
$ go get
$ cd "$(go env GOPATH)/src/"
$ go1.10rc1 generate
# runtime/internal/sys
compile: version "go1.10rc1" does not match go tool version "go1.9.3"
gen.go:7: running "go": exit status 2

What did you expect to see?

go1.10rc1 generate should succeed.


$ PATH="$(go1.10rc1 env GOROOT)/bin:$PATH" go1.10rc1 generate

Suggested fix

Prepend $PATH with $GOROOT/bin in Run

@gopherbot gopherbot added this to the Unreleased milestone Jan 31, 2018
@gopherbot gopherbot added the Builders label Jan 31, 2018

This comment has been minimized.

Copy link

@bradfitz bradfitz commented Jan 31, 2018

Sorry, there's not enough information here. Before evaluating your solution, we need to understand the problem. It's nice that you provided a repo, but it doesn't include information about your environment.

Are you sure you included all the steps? Why is even relevant here? I don't see you using the go1.10rc1 binary in your steps above.

@bradfitz bradfitz changed the title x/build/version.Run: prepend $PATH with $GOROOT/bin x/build/version: prepend $PATH with $GOROOT/bin Jan 31, 2018

This comment has been minimized.

Copy link

@dolmen dolmen commented Jan 31, 2018

Sorry. My original submission had a typo: it mentioned go generate instead of go1.10rc1 generate. I have fixed it.


This comment has been minimized.

Copy link

@bradfitz bradfitz commented Oct 24, 2018

Looks like this was already fixed in (dup of #28103).

/cc @dmitshur

@bradfitz bradfitz closed this Oct 24, 2018

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 25, 2018

Change mentions this issue: version: make replacement more visible

gopherbot pushed a commit to golang/build that referenced this issue Oct 25, 2018
The packages have been deprecated
in favor of in CL 123678, as part of golang/go#23223.

Make this more visible by pointing to the new packages in the package

Use a link to avoid confusion, because these import paths
are hard tell apart from normal URLs that have a different meaning.

Updates golang/go#23635.
Updates golang/go#23223.

Change-Id: Ide6371f24fa2369b2807987c83df4226cacfe35d
Reviewed-by: Brad Fitzpatrick <>

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 10, 2018

Change mentions this issue: version: convert to generated copy of

gopherbot pushed a commit to golang/build that referenced this issue Dec 11, 2018
Package version has been copied from to as part of golang/go#23223. The old
package was marked deprecated but kept for backwards compatibility
reasons. Fixes and changes have not been backported from the new
dl/internal/version package (to avoid spending time unproductively).

bundle has recently been updated to accept an empty prefix in CL 105515.

This allows one to use bundle to make a generated copy of a package.
A generated copied package is better than a manually-maintained copied
package for the following reasons:

1. Keeping the copied package up to date with upstream is low effort,
   just need to run go generate.

2. It's clear to contributors that the copied package isn't the
   canonical version, since there is a generated comment like
   "// Code generated by DO NOT EDIT."
   at the top of the file. It's easy to reject changes to the copied
   package, or redirect them to the upstream.

Overall, making the copied package generated rather than hand-written
reduces the maintenace cost, and makes it more viable to keep it more
up to date with upstream.

The diff to version.go in this CL is due to some dl/internal/version
CLs being effectively backported by bundle, including CL 134435,
CL 143545, and CL 144698.

Updates golang/go#23223
Fixes golang/go#23635

Change-Id: Id8cd63c52b660b6817e6fdba080373966789e1e8
Reviewed-by: Brad Fitzpatrick <>
@golang golang locked and limited conversation to collaborators Nov 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
3 participants
You can’t perform that action at this time.