Summary: | dev-lang/go - static libraries in /usr/lib/go/pkg* with older mtimes than /usr/lib/go/src causes user-compiled packages to fail | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jeff Mitchell <jeffrey.mitchell> |
Component: | New packages | Assignee: | William Hubbs <williamh> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Jeff Mitchell
2012-09-13 16:34:42 UTC
I'm not sure why you changed the bug description, which was more correct earlier. The static libraries are coming from the package building and the mtimes from installation/merging; it's not just random static libraries having old mtimes. And it's rather major as it pretty much makes Go unusable for non-root users :-) There are a couple of things that come to mind for this bug. First, a non-root user can use go by setting GOPATH. I would use something like this personally: export GOPATH=/home/william/go: If GOPATH is set, and you have write permission in the first directory mentioned in GOPATH, things should work. The question is, should I ewarn about it, or force a default setting? The other issue is that this shouldn't be happening for things in /usr/lib/go, so I will take a look at that as well. "If GOPATH is set, and you have write permission in the first directory mentioned in GOPATH, things should work." This is what you'd expect (and what I expected) but it's not correct. Go appears to try to build "updated" source files in GOROOT into GOROOT, so files with newer timestamps in /usr/lib/go/src/pkg don't get built into GOPATH, they get built into GOROOT -- which normal users do not have permissions for. You should be able to see this for yourself quite easily by running touch on all of the files in /usr/lib/go/src/pkg. Then clear out some custom library (like mgo for instance) and try to go get it. It'll fetch the source into GOPATH but then try to rebuild the system libraries in GOROOT. Jeff, first, I'm sorry it has taken me this long to get back to this bug. I'm slightly confused to be honest. Here is the code from pkg_postinst that is supposed to take care of this issue. # If the go tool sees a package file timestamped older than a dependancy it # will rebuild that file. So, in order to stop go from rebuilding lots of # packages for every build we need to fix the timestamps. The compiler and # linker are also checked - so we need to fix them too. ebegin "fixing timestamps to avoid unnecessary rebuilds" tref="usr/lib/go/pkg/*/runtime.a" find "${ROOT}"usr/lib/go -type f \ -exec touch -r "${ROOT}"${tref} {} \; eend $? This is supposed to set the date/time of everything in /usr/lib/go to match the file pointed to by tref. Does that not fix the mtimes? Honestly, I'm not sure -- I haven't had an issue with this since I rebuilt the package. I don't know why the first time the package was merged in I had those wonky mtimes, though. In that case, I'll go ahead and close this as resolved. However, feel free to re-open if this happens again. |