Bug 973842 - golang package is unusable
Summary: golang package is unusable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: golang
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Adam Goode
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-12 22:51 UTC by Paul P Komkoff Jr
Modified: 2013-07-24 03:42 UTC (History)
8 users (show)

Fixed In Version: golang-1.1.1-5.fc18
Clone Of:
Environment:
Last Closed: 2013-07-24 03:25:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Paul P Komkoff Jr 2013-06-12 22:51:46 UTC
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-13 03:05:25 UTC
Oops. What a mess.

Comment 2 Adam Goode 2013-06-13 05:14:44 UTC
Part of this is https://code.google.com/p/go/issues/detail?id=3506

Comment 3 Adam Goode 2013-06-13 05:38:33 UTC
Mostly figured it out, should have something ready tomorrow.

Comment 4 Fedora Update System 2013-06-14 03:04:53 UTC
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-14 03:05:03 UTC
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-14 03:05:18 UTC
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-14 03:07:11 UTC
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 23:11:37 UTC
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 16:05:15 UTC
[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 05:44:11 UTC
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 10:58:05 UTC
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 18:42:59 UTC
Ok, I can reproduce this, so I am looking into it again.

Comment 13 Fedora Update System 2013-06-17 05:00:14 UTC
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 05:00:45 UTC
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 05:01:03 UTC
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 17:03:12 UTC
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 15:45:07 UTC
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 15:45:28 UTC
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 15:45:44 UTC
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 17:14:45 UTC
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 17:21:39 UTC
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 18:42:41 UTC
Nevermind. Build from source.

Comment 23 Richard W.M. Jones 2013-07-01 15:22:02 UTC
(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 15:34:25 UTC
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 15:36:13 UTC
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 21:52:39 UTC
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-02 00:45:01 UTC
(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 08:10:06 UTC
(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 08:41:23 UTC
https://code.google.com/p/go/issues/detail?id=5830

Comment 30 Fedora Update System 2013-07-05 04:27:47 UTC
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 04:28:10 UTC
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 04:28:35 UTC
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-06 00:51:13 UTC
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 13:59:42 UTC
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 16:50:17 UTC
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-10 03:49:19 UTC
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 04:49:17 UTC
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 05:55:18 UTC
RPM strip was messing up the timestamps.

Comment 40 Fedora Update System 2013-07-10 06:23:12 UTC
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 06:23:37 UTC
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 06:23:53 UTC
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 18:20:56 UTC
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 19:06:15 UTC
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 21:06:11 UTC
The -5 package is working well for libguestfs (in Rawhide).

Comment 46 Fedora Update System 2013-07-11 02:29:56 UTC
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-24 03:25:50 UTC
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-24 03:35:03 UTC
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-24 03:42:00 UTC
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.