Bug 973842 - golang package is unusable
golang package is unusable
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: golang (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Adam Goode
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-12 18:51 EDT by Paul P Komkoff Jr
Modified: 2013-07-23 23:42 EDT (History)
8 users (show)

See Also:
Fixed In Version: golang-1.1.1-5.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-23 23:25:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Paul P Komkoff Jr 2013-06-12 18:51:46 EDT
Description of problem:
Golang package, as installed by default, is not usable for building go programs.

Version-Release number of selected component (if applicable):
1.1-2.fc18

How reproducible:
Always

Steps to Reproduce:
1. yum -y install golang
2. create gopath directory structure (foo/{src}, export GOPATH=foo), checkout some repos into it
3. try to do build install blah/blah (something installable)

at this point you'll get a screenful of compile errors, because runtime sources are not installed and go compiler needs them.
yum install golang-godoc installs the sources, but next you'll fail with error because cgo tool can't be found.
If you set CGO_ENABLED=0, then it will fail next because it'll try to create libs 
go install errors: open /usr/lib64/golang/pkg/linux_amd64/errors.a: permission denied
go install sync: open /usr/lib64/golang/pkg/linux_amd64/sync.a: permission denied
go install unicode/utf8: open /usr/lib64/golang/pkg/linux_amd64/unicode/utf8.a: permission denied
go install sort: open /usr/lib64/golang/pkg/linux_amd64/sort.a: permission denied
go install unicode/utf16: open /usr/lib64/golang/pkg/linux_amd64/unicode/utf16.a: permission denied
go install crypto/subtle: open /usr/lib64/golang/pkg/linux_amd64/crypto/subtle.a: permission denied
go install unicode: open /usr/lib64/golang/pkg/linux_amd64/unicode.a: permission denied

Actual results:
described above

Expected results:
should have stuff compiling

Additional info:
none
Comment 1 Adam Goode 2013-06-12 23:05:25 EDT
Oops. What a mess.
Comment 2 Adam Goode 2013-06-13 01:14:44 EDT
Part of this is https://code.google.com/p/go/issues/detail?id=3506
Comment 3 Adam Goode 2013-06-13 01:38:33 EDT
Mostly figured it out, should have something ready tomorrow.
Comment 4 Fedora Update System 2013-06-13 23:04:53 EDT
golang-1.1.1-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.1.1-1.fc19
Comment 5 Fedora Update System 2013-06-13 23:05:03 EDT
golang-1.1.1-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/golang-1.1.1-1.fc18
Comment 6 Fedora Update System 2013-06-13 23:05:18 EDT
golang-1.1.1-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/golang-1.1.1-1.fc17
Comment 7 Adam Goode 2013-06-13 23:07:11 EDT
Please try out the package (via updates-testing) and vote up if successful:
https://admin.fedoraproject.org/updates/golang-1.1.1-1.fc18
Comment 8 Fedora Update System 2013-06-14 19:11:37 EDT
Package golang-1.1.1-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing golang-1.1.1-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-10845/golang-1.1.1-1.fc19
then log in and leave karma (feedback).
Comment 9 Paul P Komkoff Jr 2013-06-15 12:05:15 EDT
[stingray@arcane go2]$ go install bla/bla
go install crypto: open /usr/lib64/golang/pkg/linux_amd64/crypto.a: permission denied

:(
Comment 10 Adam Goode 2013-06-16 01:44:11 EDT
I don't think the update is pushed out to all mirrors yet. You should wait another day or two.

Can you check the version with rpm -q golang ?
Comment 11 Paul P Komkoff Jr 2013-06-16 06:58:05 EDT
Name        : golang
Version     : 1.1.1
Release     : 1.fc18
Architecture: x86_64
I installed it directly from koji.
Comment 12 Adam Goode 2013-06-16 14:42:59 EDT
Ok, I can reproduce this, so I am looking into it again.
Comment 13 Fedora Update System 2013-06-17 01:00:14 EDT
golang-1.1.1-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/golang-1.1.1-2.fc17
Comment 14 Fedora Update System 2013-06-17 01:00:45 EDT
golang-1.1.1-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/golang-1.1.1-2.fc18
Comment 15 Fedora Update System 2013-06-17 01:01:03 EDT
golang-1.1.1-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.1.1-2.fc19
Comment 16 Fedora Update System 2013-06-17 13:03:12 EDT
Package golang-1.1.1-2.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing golang-1.1.1-2.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11056/golang-1.1.1-2.fc19
then log in and leave karma (feedback).
Comment 17 Fedora Update System 2013-06-19 11:45:07 EDT
golang-1.1.1-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.1.1-3.fc19
Comment 18 Fedora Update System 2013-06-19 11:45:28 EDT
golang-1.1.1-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/golang-1.1.1-3.fc18
Comment 19 Fedora Update System 2013-06-19 11:45:44 EDT
golang-1.1.1-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/golang-1.1.1-3.fc17
Comment 20 Alexander Dorofeev 2013-06-20 13:14:45 EDT
Name        : golang
Arch        : x86_64
Version     : 1.1.1
Release     : 2.fc18
Size        : 64 M
Repo        : installed
From repo   : updates-testing
Summary     : The Go Programming Language
URL         : http://golang.org/
License     : BSD
Description : The Go Programming Language.

Still no luck. 

go get -u github.com/nsf/gocode
go install sync: open /usr/lib64/golang/pkg/linux_amd64/sync.a: permission denied
go install sort: open /usr/lib64/golang/pkg/linux_amd64/sort.a: permission denied
go install crypto/subtle: open /usr/lib64/golang/pkg/linux_amd64/crypto/subtle.a: permission denied
go install strconv: open /usr/lib64/golang/pkg/linux_amd64/strconv.a: permission denied
go install unicode: open /usr/lib64/golang/pkg/linux_amd64/unicode.a: permission denied
Comment 21 Paul P Komkoff Jr 2013-06-20 13:21:39 EDT
Alexander, you're using the previos package (-2)
but I'm using the correct one and it still doesn't work. I tried it, again needs permission to overwrite some libraries.
Comment 22 Alexander Dorofeev 2013-06-20 14:42:41 EDT
Nevermind. Build from source.
Comment 23 Richard W.M. Jones 2013-07-01 11:22:02 EDT
(In reply to Paul P Komkoff Jr from comment #21)
> Alexander, you're using the previos package (-2)
> but I'm using the correct one and it still doesn't work. I tried it, again
> needs permission to overwrite some libraries.

I'm also getting the same problem:

$ export GOPATH=~/go
$ go install libguestfs.org/guestfs
go install errors: open /usr/lib64/golang/pkg/linux_amd64/errors.a: permission denied
go install sync/atomic: open /usr/lib64/golang/pkg/linux_amd64/sync/atomic.a: permission denied
go install math: open /usr/lib64/golang/pkg/linux_amd64/math.a: permission denied
rjones@choo:~/d/libguestfs/golang$ ../run strace -o /tmp/1 go install libguestfs.org/guestfs
go install errors: open /usr/lib64/golang/pkg/linux_amd64/errors.a: permission denied
go install sync/atomic: open /usr/lib64/golang/pkg/linux_amd64/sync/atomic.a: permission denied
go install math: open /usr/lib64/golang/pkg/linux_amd64/math.a: permission denied

golang-1.1.1-3.fc18.x86_64

So there's definitely still a bug in the -3 package.  Weirdly
though I've been running exactly the same command most of the
morning and it's only just started to fail.
Comment 24 Richard W.M. Jones 2013-07-01 11:34:25 EDT
So this is strange:

$ ls -l /usr/lib64/golang/pkg/linux_amd64/errors.a
-rw-r--r--. 1 root root 6940 Jun 19 16:18 /usr/lib64/golang/pkg/linux_amd64/errors.a
$ ls -l /usr/lib64/golang/src/pkg/errors/*
lrwxrwxrwx. 1 root root 52 Jul  1 12:04 /usr/lib64/golang/src/pkg/errors/errors.go -> ../../../../../share/golang/src/pkg/errors/errors.go
lrwxrwxrwx. 1 root root 57 Jul  1 12:04 /usr/lib64/golang/src/pkg/errors/errors_test.go -> ../../../../../share/golang/src/pkg/errors/errors_test.go
lrwxrwxrwx. 1 root root 58 Jul  1 12:04 /usr/lib64/golang/src/pkg/errors/example_test.go -> ../../../../../share/golang/src/pkg/errors/example_test.go

Jul 1 12:04 is approximately the time that I installed
the package.

I notice from reading around that if the source is newer,
golang will try to recompile it.

I wonder if we should be using 'cp -a' to preserve timestamps,
or even just forcibly setting timestamps to ensure the source
is always older than the binaries in the RPM?
Comment 25 Richard W.M. Jones 2013-07-01 11:36:13 EDT
Sorry, previous comment doesn't make much sense without my
other observation:

go uses lstat instead of stat when examining the timestamp of files.

That's probably a bug in go, but anyway, it means that the
timestamp of the symbolic links is used, not the timestamp
of the target files (which is correct).
Comment 26 John Villalovos 2013-07-01 17:52:39 EDT
Well installing golang-1.1.1-3.fc18.x86_64 made it at least compile my hello world program.  Before that it failed completely.

As a note, when I enabled the updates-testing repo and did an update on golang, it failed to update with errors like:
  file /usr/share/golang/src/pkg/unsafe/unsafe.go conflicts between attempted installs of golang-data-1.1.1-3.fc18.noarch and golang-1.1.1-3.fc18.x86_64


But doing a remove of golang first and then doing an install for the testing-updates repo worked.
Comment 27 Adam Goode 2013-07-01 20:45:01 EDT
(In reply to Richard W.M. Jones from comment #25)
> Sorry, previous comment doesn't make much sense without my
> other observation:
> 
> go uses lstat instead of stat when examining the timestamp of files.
> 

Can you please file a bug at https://code.google.com/p/go/issues/entry ?

I suspected this before but convinced myself I was wrong. :)

If this is really the case, I am happy to patch up golang in Fedora once a bug is filed.

The workaround for now is not to bother with %{_datadir} which I'm afraid is anyway pretty busted due to bug 975909.
Comment 28 Richard W.M. Jones 2013-07-02 04:10:06 EDT
(In reply to John Villalovos from comment #26)
> Well installing golang-1.1.1-3.fc18.x86_64 made it at least compile my hello
> world program.

I should note that after installing the -3 package, it worked
fine for "a while" (a few hours) and then suddenly stopped working.

During this time I didn't run any yum or sudo commands at all
(I checked).  But I was developing a cgo library and constantly
running go commands as *non* root.

Why this should be, I have reallly no idea,
Comment 29 Richard W.M. Jones 2013-07-02 04:41:23 EDT
https://code.google.com/p/go/issues/detail?id=5830
Comment 30 Fedora Update System 2013-07-05 00:27:47 EDT
golang-1.1.1-4.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/golang-1.1.1-4.fc18
Comment 31 Fedora Update System 2013-07-05 00:28:10 EDT
golang-1.1.1-4.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/golang-1.1.1-4.fc17
Comment 32 Fedora Update System 2013-07-05 00:28:35 EDT
golang-1.1.1-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.1.1-4.fc19
Comment 33 Fedora Update System 2013-07-05 20:51:13 EDT
Package golang-1.1.1-4.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing golang-1.1.1-4.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-12392/golang-1.1.1-4.fc17
then log in and leave karma (feedback).
Comment 34 Richard W.M. Jones 2013-07-09 09:59:42 EDT
I'm still seeing this bug, even with the -4 package in Rawhide.

Take a look at:

http://kojipkgs.fedoraproject.org//work/tasks/7712/5587712/root.log
http://kojipkgs.fedoraproject.org//work/tasks/7712/5587712/build.log

make[2]: Entering directory `/builddir/build/BUILD/libguestfs-1.23.8/golang'
../run go install libguestfs.org/guestfs
go install sync: open /usr/lib/golang/pkg/linux_386/sync.a: permission denied
make[2]: Leaving directory `/builddir/build/BUILD/libguestfs-1.23.8/golang'
make[2]: *** [pkg/linux_386/libguestfs.org/guestfs.a] Error 1
make[1]: Leaving directory `/builddir/build/BUILD/libguestfs-1.23.8'
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Comment 35 Adam Goode 2013-07-09 12:50:17 EDT
At this point, I am suspecting prelink or anything else that might be changing the times on files.

If the compiler binary becomes newer than the .a files, it triggers a rebuild.
https://code.google.com/p/go/issues/detail?id=3506
Comment 36 Adam Goode 2013-07-09 23:49:19 EDT
Aha, something is wrong with how golang-1.1.1-4.fc20.i686 was built. I can reproduce with that RPM. Investigating this.
Comment 37 Adam Goode 2013-07-10 00:49:17 EDT
golang-1.1.1-4.fc20.x86_64 works:
/usr/lib64/golang/pkg/linux_amd64 $ ls -l --full-time sync.a sync/atomic.a
-rw-r--r--. 1 root root 55766 2013-07-05 00:07:34.000000000 -0400 sync.a
-rw-r--r--. 1 root root  8364 2013-07-05 00:07:33.000000000 -0400 sync/atomic.a

golang-1.1.1-4.fc20.i686 fails:
/usr/lib/golang/pkg/linux_386 $ ls -l --full-time sync.a sync/atomic.a 
-rw-r--r--. 1 root root 55694 2013-07-05 00:07:38.000000000 -0400 sync.a
-rw-r--r--. 1 root root  8970 2013-07-05 00:07:39.000000000 -0400 sync/atomic.a


sync relies on sync/atomic. If sync/atomic.a is newer than sync.a, then failure.

I don't know why these files differ in time, probably there is something that uses sync/atomic and rebuilds it after sync is already built (parallel builds that run in different orders? or perhaps directory ordering?)

I guess I will try to file a golang bug.
Comment 39 Adam Goode 2013-07-10 01:55:18 EDT
RPM strip was messing up the timestamps.
Comment 40 Fedora Update System 2013-07-10 02:23:12 EDT
golang-1.1.1-5.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/golang-1.1.1-5.fc18
Comment 41 Fedora Update System 2013-07-10 02:23:37 EDT
golang-1.1.1-5.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/golang-1.1.1-5.fc17
Comment 42 Fedora Update System 2013-07-10 02:23:53 EDT
golang-1.1.1-5.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.1.1-5.fc19
Comment 43 Richard W.M. Jones 2013-07-10 14:20:56 EDT
I wonder if we should either:

(a) Leave the setting of timestamps to a %post-install script, or:

(b) At least check that the timestamps are reasonable in a %post-
install script.

Of course this would require that golang has a command to
display the topological order of build dependencies for installed
packages.  (No idea if it does or not, I didn't check)
Comment 44 Adam Goode 2013-07-10 15:06:15 EDT
The timestamps from go were correct, it was RPM's use of strip that was non-deterministically rewriting timestamps. The solution is either

%global __strip "strip -p"

or just disable strip all together, which I did under advice in the golang bug to "never strip go binaries or archives".
Comment 45 Richard W.M. Jones 2013-07-10 17:06:11 EDT
The -5 package is working well for libguestfs (in Rawhide).
Comment 46 Fedora Update System 2013-07-10 22:29:56 EDT
Package golang-1.1.1-5.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing golang-1.1.1-5.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-12720/golang-1.1.1-5.fc18
then log in and leave karma (feedback).
Comment 47 Fedora Update System 2013-07-23 23:25:50 EDT
golang-1.1.1-5.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 48 Fedora Update System 2013-07-23 23:35:03 EDT
golang-1.1.1-5.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 49 Fedora Update System 2013-07-23 23:42:00 EDT
golang-1.1.1-5.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.