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

build: fail nicely if somebody runs all.bash from a binary download checkout #20008

Closed
chenjie4255 opened this issue Apr 17, 2017 · 11 comments
Closed
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@chenjie4255
Copy link

Please answer these questions before submitting your issue. Thanks!

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

go version go1.8.1 darwin/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/chenjie/Workspace/GO"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/l6/m31j3rrd1hgfm4yc1vx7c07h0000gn/T/go-build345210972=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

cd /usr/local/go/src && sudo ./all.bash

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

build succeed

What did you see instead?

../test
API check

stat /usr/local/go/src/cmd/api/run.go: no such file or directory
2017/04/17 15:41:53 Failed: exit status 1
2017/04/17 15:41:53 FAILED

I think the stat path should be /usr/local/go/src/cmd/go/run.go...

@mvdan
Copy link
Member

mvdan commented Apr 17, 2017

Did you follow the installing from source instructions? Nowhere do they tell you to use sudo, so I assume not.

Did you set a proper GOROOT_BOOTSTRAP?

@chenjie4255
Copy link
Author

@mvdan
yes, I follow the instructions, I downloaded the go1.4 version and succeed to build it, nothing go wrong from here.

I didn't set the GOROOT_BOOTSTRAP env, I put go1.4 on my $HOME folder, the go1.4 was build succeed, and the go 1.8 was build succeed(be installed to /usr/local/go/bin path) ,but just fail to run test after install.

sudo command is used for handle some permission problem for my folder /usr/local/go, which stat is 'drwxr-xr-x 20 root wheel 680B Apr 8 00:59 go'

and I exec the following command on src folder,

grep "cmd/api/run.go" ./ -r

I found this:
.//cmd/dist/test.go: t.addCmd(dt, "src", "go", "build", filepath.Join(t.goroot, "src/cmd/api/run.go"))
.//cmd/dist/test.go: t.addCmd(dt, "src", "go", "run", filepath.Join(t.goroot, "src/cmd/api/run.go"))

but there is not such api folder on the "src/cmd/"
I think it should be "src/cmd/go/run.go."

@josharian
Copy link
Contributor

I have a run.go there.

~/go/1.8/src/cmd/api ((go1.8.1))$ ls
goapi.go	goapi_test.go	run.go		testdata

Does git reset --hard go 1.8.1 fix things? (Warning, that is a destructive command, do not run if you have any local changes!)

@josharian josharian changed the title fail to build go from source code all.bash: fail to build go from source code, cmd/api/run.go apparently missing Apr 17, 2017
@bradfitz
Copy link
Contributor

I'd suggest you start over and keep notes about everything you did.

There's not enough information to help you here, but this also isn't really a Go problem.

We don't delete cmd/api/run.go during tests or anything.

The golang-nuts mailing list might be a better place for this debugging.

@chenjie4255
Copy link
Author

@bradfitz @josharian
sorry I was wrong, I build the source code from a pre-build go version(mac 1.8.1), but not from a pure source code. I thought this should be ok since it seems to have all the source code in the installed folder.
I redownloaded the source code and everything goes well.

@bradfitz
Copy link
Contributor

Ah, makes sense. Perhaps we could fail nicer in that case. I never considered that scenario before.

@bradfitz bradfitz reopened this Apr 18, 2017
@bradfitz bradfitz changed the title all.bash: fail to build go from source code, cmd/api/run.go apparently missing build: fail nicely if somebody runs all.bash from a binary download checkout Apr 18, 2017
@bradfitz bradfitz added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Apr 18, 2017
@bradfitz bradfitz added this to the Go1.9Maybe milestone Apr 18, 2017
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/41858 mentions this issue.

@bradfitz bradfitz reopened this Apr 28, 2017
@bradfitz
Copy link
Contributor

Let's fix this another way and just not remove the api/ directory from releases.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/42138 mentions this issue.

gopherbot pushed a commit that referenced this issue Apr 28, 2017
…rball package"

This reverts commit 3d86d45.

Reason for revert: Fixing a different way. See #20008.

Change-Id: I6f4382ffdfff83a4504b013ba37100319b2c1aad
Reviewed-on: https://go-review.googlesource.com/42138
Reviewed-by: Brad Fitzpatrick <[email protected]>
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/42140 mentions this issue.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/42050 mentions this issue.

@golang golang locked and limited conversation to collaborators Apr 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants