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: missing zversion.go when building for windows on mac #15018

Closed
dcboy opened this issue Mar 29, 2016 · 19 comments
Closed

cmd/dist: missing zversion.go when building for windows on mac #15018

dcboy opened this issue Mar 29, 2016 · 19 comments

Comments

@dcboy
Copy link

@dcboy dcboy commented Mar 29, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6 darwin/amd64
  2. What operating system and processor architecture are you using (go env)?
    ➜ src git:(master) go env
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Volumes/D/go"
    GORACE=""
    GOROOT="/usr/local/go"
    GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"
  3. What did you do?
    cd $GOROOT/src
    GOOS=windows GOARCH=386 PATH=$PATH ./make.bash
  4. What did you expect to see?
Building Go bootstrap tool.

cmd/dist
go: open /usr/local/go/src/runtime/internal/sys/zversion.go: no such file or directory

@ianlancetaylor ianlancetaylor changed the title Building windows go programs on mac fail cmd/dist: missing zversion.go when building for windows on mac Mar 29, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Mar 29, 2016
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Mar 29, 2016

Note that it is not necessary to run make.bash again for a cross-compiler. Once you've run make.bash for darwin/amd64, you can build for Windows by running

GOOS=windows GOARCH=386 go install PROGRAM
@minux
Copy link
Member

@minux minux commented Mar 29, 2016

@davecheney
Copy link
Contributor

@davecheney davecheney commented Mar 29, 2016

@minux @ianlancetaylor I think we should stop shipping the make.bash and other scripts as part of the binary distributions. They cannot be used safely.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Mar 29, 2016

/cc @adg

@adg
Copy link
Contributor

@adg adg commented Mar 29, 2016

@davecheney they can't?

@davecheney
Copy link
Contributor

@davecheney davecheney commented Mar 29, 2016

@adg in an ideal world, maybe those scripts would work, but when the files
are owned by root, they are a temptation to reach for the sudo hammer and
that'll just make things worse.

You don't need to run ./make.bash to season a Go install for cross
compilation, so I think we should remove the scripts to prevent the
temptation to follow the outdated tutorials on the internet.

On Wed, Mar 30, 2016 at 9:40 AM, Andrew Gerrand notifications@github.com
wrote:

@davecheney https://github.com/davecheney they can't?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#15018 (comment)

@adg
Copy link
Contributor

@adg adg commented Mar 29, 2016

@davecheney I didn't think about root. The scripts do work for people that install the binary tarball or zip under their own usernames.

Maybe we should just remove make/all.bash/bat for the MSI and PKG installers?

@davecheney
Copy link
Contributor

@davecheney davecheney commented Mar 29, 2016

@davecheney I didn't think about root. The scripts do work for people that install the binary tarball or zip under their own usernames.

I don't think this is the case. Our installation instructions tell people to place the contents in /usr/local/go and not owned by their own username.

We strongly discourage people from placing the contents elsewhere as that raises the spectre of GOROOT.

I agree that these scripts should be stripped from the MSI and PKG installers. I think they should also be stripped from the zip and tar distributions.

If people want to install from source, they should check it out from git or use the source tarball. All the rest of the mechanisms should not be useable as proxies for the source tarball.

@adg
Copy link
Contributor

@adg adg commented Mar 29, 2016

Our installation instructions tell people to place the contents in /usr/local/go and not owned by their own username.

We strongly discourage people from placing the contents elsewhere as that raises the spectre of GOROOT.

See the Getting Started docs, where we helpfully explain how to install Go elsewhere. We don't mention permissions at all.

I agree that these scripts should be stripped from the MSI and PKG installers. I think they should also be stripped from the zip and tar distributions.

Seems reasonable. Should be a trivial change to x/build/cmd/release.

@minux
Copy link
Member

@minux minux commented Mar 29, 2016

@davecheney
Copy link
Contributor

@davecheney davecheney commented Mar 29, 2016

@minux, yes. Sorry I distracted the issue by talking about strategies to
talk about overcoming the outdated information on the internet on how to
prepare your Go installation for cross compilation, which are now
unnecessary.

On Wed, Mar 30, 2016 at 10:34 AM, Minux Ma notifications@github.com wrote:

we still don't understand the problem here, so we shouldn't hurry
to blame make.bash.

zversion.go should exist, and if it's really owned by root, how could
make.bash somehow make it disappear?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#15018 (comment)

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented May 1, 2016

@dcboy, sure you don't have Go 1.4 or Go 1.5 in /usr/local/go?

What does /usr/local/go/bin/go version say?

@rsc
Copy link
Contributor

@rsc rsc commented May 17, 2016

Timed out.

@rsc rsc closed this May 17, 2016
@JoopClaireIT
Copy link

@JoopClaireIT JoopClaireIT commented Jun 2, 2016

I just got this problem when checking out go1.7beta1 and compiling it from source, then trying to use it to build master.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 2, 2016

@JoopClaireIT Please show us the exact sequence of commands that you ran.

@JoopClaireIT
Copy link

@JoopClaireIT JoopClaireIT commented Jun 2, 2016

~$ cd go/src # I already checked out Go from git before
$ git pull
$ git checkout go1.7beta1
$ GOROOT=/usr/local/go GOROOT_BOOTSTRAP=/usr/local/go ./all.bash
$ sudo rm -r /usr/local/go
$ sudo cp -r /home/joop/go /usr/local/
$ go version
go version devel +3c6b668 Thu Jun 2 00:22:03 2016 +0000 linux/amd64
$ git checkout master
$ GOROOT_BOOTSTRAP=/usr/local/go ./all.bash
##### Building Go bootstrap tool.
cmd/dist
go: open /usr/local/go/src/runtime/internal/sys/zversion.go: no such file
or directory
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 2, 2016

I'm not sure I understand. What directory were you running in--what directory do you get to when you cd go/src?

It does not make sense to set both GOROOT and GOROOT_BOOTSTRAP to the same directory. It doesn't really make sense to set GOROOT at all when running all.bash. I'm surprised that it worked as well as it did. Did you mean to set GOROOT_FINAL rather than GOROOT?

@Patuti
Copy link

@Patuti Patuti commented Jul 11, 2016

I believe I'm having the same problem here.
It's the first time I'm trying to build it from source so maybe I missed some step.

My env vars:

GOARCH=amd64
GOOS=windows
GOROOT_BOOTSTRAP=C:\go
GOROOT_FINAL=D:\personal\labs\go

GOROOT_BOOTSTRAP points to my binary dist go version go1.6.2 windows/amd64
GOROOT_FINAL points to my local repo of go master branch.

Then, when calling all.bat:

D:\personal\labs\go\src>all.bat
##### Building Go bootstrap tool.
cmd/dist
go: open C:\go\src\runtime\internal\sys\zversion.go: Le fichier spécifié est introuvable.
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jul 11, 2016

@Patuti Whatever problem that is, it is not this problem, which is about building for Windows on the Mac. Please take your question to a forum; see https://golang.org/wiki/Questions . Thanks.

@golang golang locked and limited conversation to collaborators Jul 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants
You can’t perform that action at this time.