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: using wrong timestamps for recompiling runtime/cgo (cross-compiler related) #4749

Closed
gopherbot opened this issue Feb 3, 2013 · 11 comments
Milestone

Comments

@gopherbot
Copy link

by m.gebetsr:

I've nearly all cross-compiler activated for go and thus my timestamp on
/opt/go/src/pkg/runtime/ is newer than /opt/go/pkg/*/runtime/* for all but the last
compiled runtime.

Seems go tries to match the timestamps and automatically recompiles if if thinks some
files are out of date. BUT there are 2 problems here:

  1. every cross-compiler creates files in /opt/go/src/pkg/runtime/, thus the directory has the timestamp of the last cross-compiled runtime.

  2. go tries to recompile system installed files

Command fixing the problem:
touch /opt/go/pkg/linux_amd64/runtime/*
After this command go does not try to recompile runtime/cgo anymore.

What steps will reproduce the problem?
- Cross compile helper script to setup the go environment:
https://gist.github.com/4702669
- the problem was with go-mtpfs, though it does have nothing to do with the real problem
- go get github.com/hanwen/go-mtpfs

What is the expected output?
<nothing>

What do you see instead?
go install runtime/cgo: open /opt/go/pkg/linux_amd64/runtime/cgo.a: permission denied

Which compiler are you using (5g, 6g, 8g, gccgo)?


Which operating system are you using?
linux/amd64

Which version are you using?  (run 'go version')
go version go1.0.3

Please provide any additional information below.
% go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/gebi/go"
GOROOT="/opt/go"
GOTOOLDIR="/opt/go/pkg/tool/linux_amd64"
CGO_ENABLED="1"
@rsc
Copy link
Contributor

rsc commented Feb 4, 2013

Comment 1:

Labels changed: added priority-later, go1.1, removed priority-triage, go1.1maybe.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Mar 12, 2013

Comment 2:

Labels changed: added go1.1maybe, removed go1.1.

@robpike
Copy link
Contributor

robpike commented May 18, 2013

Comment 3:

Labels changed: added go1.2maybe, removed go1.1maybe.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 4:

Labels changed: added feature.

@robpike
Copy link
Contributor

robpike commented Aug 30, 2013

Comment 5:

Not for 1.2.

Labels changed: removed go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 6:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 7:

Labels changed: removed feature.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 8:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 9:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc
Copy link
Contributor

rsc commented Apr 20, 2015

The only file written to runtime during cmd/dist now is runtime/zversion.go.
I will make it so that cmd/dist will leave the file alone if it already exists and
has the right content. That will solve the problem.

Note that you actually don't need to run make.bash multiple times for cross-compiling
anymore (as of Go 1.5) either. You can just set GOOS= and GOARCH= and run go install.
That will also solve the problem.

@rsc rsc self-assigned this Apr 20, 2015
@rsc rsc modified the milestones: Go1.5, Unplanned Apr 20, 2015
@rsc rsc added the Started label Apr 20, 2015
@gopherbot
Copy link
Author

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

@rsc rsc closed this as completed in e346adf Jun 3, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants