Bug 1099206

Summary: timestamps of libraries and artifacts out of sync
Product: [Fedora] Fedora Reporter: Vincent Batts <vbatts>
Component: golangAssignee: Vincent Batts <vbatts>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: adam, admiller, claudiu.raveica, golang-updates, jumanjiman, lemenkov, lsm5, mfojtik, renich, rjones, s, vbatts
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: golang-1.3.3-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-16 00:25:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1127518    
Bug Blocks: 910269    

Description Vincent Batts 2014-05-19 18:05:13 UTC
Description of problem:
https://gist.github.com/ncdc/1a6bcb988a700d52dfec

Version-Release number of selected component (if applicable):
1.2.2-2

How reproducible:
consisten

Steps to Reproduce:
1. build something that uses stdlib
2.
3.

Actual results:
agoldste@localhost:~/go/src/github.com/openshift/docker-source-to-images/go/sti (master) go install
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied

Expected results:
successful compile


Additional info:

Comment 1 Vincent Batts 2014-05-19 18:36:14 UTC
this is caused because of how koji combines the rpms built from a number of builders. So the golang-src may be newer than the golang-pkg-* that includes the *.a archives.

As a temporary work around, run the following as root:
find $(go env GOROOT) -type f -name '*.a' -exec touch "{}" \;

Comment 2 Fedora Update System 2014-05-20 13:55:22 UTC
golang-1.2.2-3.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.2.2-3.el6

Comment 3 Vincent Batts 2014-05-20 13:55:54 UTC
more information https://code.google.com/p/go/issues/detail?id=4749

Comment 4 Fedora Update System 2014-05-20 13:56:17 UTC
golang-1.2.2-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.2.2-3.fc19

Comment 5 Fedora Update System 2014-05-20 13:56:54 UTC
golang-1.2.2-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/golang-1.2.2-3.fc20

Comment 6 Fedora Update System 2014-05-21 12:40:02 UTC
golang-1.2.2-6.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/golang-1.2.2-6.fc20

Comment 7 Fedora Update System 2014-05-21 12:40:37 UTC
golang-1.2.2-6.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.2.2-6.el6

Comment 8 Fedora Update System 2014-05-21 12:41:04 UTC
golang-1.2.2-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.2.2-6.fc19

Comment 9 Fedora Update System 2014-05-21 21:33:56 UTC
golang-1.2.2-7.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/golang-1.2.2-7.fc20

Comment 10 Fedora Update System 2014-05-21 21:34:48 UTC
golang-1.2.2-7.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.2.2-7.el6

Comment 11 Fedora Update System 2014-05-21 21:35:22 UTC
golang-1.2.2-7.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.2.2-7.fc19

Comment 12 Fedora Update System 2014-05-23 18:55:55 UTC
Package golang-1.2.2-7.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.2.2-7.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-6604/golang-1.2.2-7.fc19
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2014-05-23 18:58:27 UTC
golang-1.2.2-7.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Michal Fojtik 2014-05-27 10:52:42 UTC
Package golang-1.2.2-7.fc20.x86_64 already installed and latest version


go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied

Comment 15 Michal Fojtik 2014-05-27 10:58:34 UTC
Vincent:

The workaround will make it even worse ;-)

go install sync: open /usr/lib/golang/pkg/linux_amd64/sync.a: permission denied
go install encoding: open /usr/lib/golang/pkg/linux_amd64/encoding.a: permission denied
go install container/ring: open /usr/lib/golang/pkg/linux_amd64/container/ring.a: permission denied
go install container/list: open /usr/lib/golang/pkg/linux_amd64/container/list.a: permission denied
go install strconv: open /usr/lib/golang/pkg/linux_amd64/strconv.a: permission denied
go install sync: open /usr/lib/golang/pkg/linux_amd64/sync.a: permission denied
go install encoding: open /usr/lib/golang/pkg/linux_amd64/encoding.a: permission denied
go install container/ring: open /usr/lib/golang/pkg/linux_amd64/container/ring.a: permission denied
go install strconv: open /usr/lib/golang/pkg/linux_amd64/strconv.a: permission denied
go install sync: open /usr/lib/golang/pkg/linux_amd64/sync.a: permission denied
go install encoding: open /usr/lib/golang/pkg/linux_amd64/encoding.a: permission denied
go install strconv: open /usr/lib/golang/pkg/linux_amd64/strconv.a: permission denied
go install sync: open /usr/lib/golang/pkg/linux_amd64/sync.a: permission denied
go install encoding: open /usr/lib/golang/pkg/linux_amd64/encoding.a: permission denied
go install container/ring: open /usr/lib/golang/pkg/linux_amd64/container/ring.a: permission denied
go install strconv: open /usr/lib/golang/pkg/linux_amd64/strconv.a: permission denied

Comment 16 Michal Fojtik 2014-05-27 11:06:33 UTC
Btw. 'reinstalling' the Go packages fixed the problem:

yum reinstall golang golang-pkg*  golang-src

Comment 17 Paul Morgan 2014-06-07 19:59:11 UTC
(In reply to Michal Fojtik from comment #16)
> Btw. 'reinstalling' the Go packages fixed the problem:
> 
> yum reinstall golang golang-pkg*  golang-src

indeed.

On a fresh installation of Fedora 20 with `golang-1.2.2-7.fc20.x86_64`
or Fedora Rawhide with `golang-1.3rc1-1.fc21.x86_64`,
`go get` errors out with:

    go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied

If you run `yum -y reinstall golang golang-pkg* golang-src`,
the `go get` command finishes successfully.
One should not have to reinstall the packages to get a working set.

To reproduce the behavior, clone this repo [1] and run
`script/test` as a user with privileges to run `docker`.

`script/test` builds four docker images:

* f20
* f20_with_reinstall
* rawhide
* rawhide_with_reinstall

It then runs the `go get` command to demonstrate the error:

```
===> Running gotest in f20...
[INFO] docker run --rm -i -t -u user f20 /gotest
[INFO] rpm -qa golang*
golang-pkg-bin-linux-amd64-1.2.2-7.fc20.x86_64
golang-pkg-linux-amd64-1.2.2-7.fc20.noarch
golang-src-1.2.2-7.fc20.noarch
golang-1.2.2-7.fc20.x86_64
[INFO] go get github.com/golang/lint/golint
[INFO] go get github.com/rakyll/drive
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied
[INFO] go get github.com/epeli/hooktftp
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied

===> Running gotest in f20_with_reinstall...
[INFO] docker run --rm -i -t -u user f20_with_reinstall /gotest
[INFO] rpm -qa golang*
golang-pkg-bin-linux-amd64-1.2.2-7.fc20.x86_64
golang-pkg-linux-amd64-1.2.2-7.fc20.noarch
golang-src-1.2.2-7.fc20.noarch
golang-1.2.2-7.fc20.x86_64
[INFO] go get github.com/golang/lint/golint
[INFO] go get github.com/rakyll/drive
[INFO] go get github.com/epeli/hooktftp

===> Running gotest in rawhide...
[INFO] docker run --rm -i -t -u user rawhide /gotest
[INFO] rpm -qa golang*
golang-1.3rc1-1.fc21.x86_64
golang-pkg-linux-amd64-1.3rc1-1.fc21.noarch
golang-src-1.3rc1-1.fc21.noarch
golang-pkg-bin-linux-amd64-1.3rc1-1.fc21.x86_64
[INFO] go get github.com/golang/lint/golint
[INFO] go get github.com/rakyll/drive
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied
[INFO] go get github.com/epeli/hooktftp
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied

===> Running gotest in rawhide_with_reinstall...
[INFO] docker run --rm -i -t -u user rawhide_with_reinstall /gotest
[INFO] rpm -qa golang*
golang-src-1.3rc1-1.fc21.noarch
golang-pkg-bin-linux-amd64-1.3rc1-1.fc21.x86_64
golang-1.3rc1-1.fc21.x86_64
golang-pkg-linux-amd64-1.3rc1-1.fc21.noarch
[INFO] go get github.com/golang/lint/golint
[INFO] go get github.com/rakyll/drive
[INFO] go get github.com/epeli/hooktftp
```

[1] https://github.com/jumanjiman/bz1099206


I found this message [2] that implies the need to preserve timestamps when packaging the files.

[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658421#25

Comment 18 Paul Morgan 2014-06-08 21:59:42 UTC
Install gcc _before_ golang to avoid non-fatal rpm error
observed during build of reproducer docker images:

    Running transaction
      Installing : golang-src-1.2.2-7.fc20.noarch                              1/52
      Installing : golang-pkg-bin-linux-amd64-1.2.2-7.fc20.x86_64              2/52
      Installing : golang-1.2.2-7.fc20.x86_64                                  3/52
      Installing : golang-pkg-linux-amd64-1.2.2-7.fc20.noarch                  4/52
    # runtime/cgo
    exec: "gcc": executable file not found in $PATH
    warning: %post(golang-pkg-linux-amd64-1.2.2-7.fc20.noarch) scriptlet failed, exit status 2
    Non-fatal POSTIN scriptlet failure in rpm package golang-pkg-linux-amd64-1.2.2-7.fc20.noarch
      Installing : mpfr-3.1.2-4.fc20.x86_64                                    5/52


If you install gcc _before_ golang, the above error does not error, and the "permission denied" symptom in this BZ goes away.

See results at:

https://app.wercker.com/#applications/5394ce3e85147b684f0c91a4

Comment 19 Fedora Update System 2014-06-09 15:36:24 UTC
golang-1.2.2-7.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2014-06-10 03:03:09 UTC
golang-1.2.2-7.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 Claudiu RAVEICA 2014-07-26 23:22:35 UTC
Broken again in golang-1.2.2-9.fc20

go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied

Comment 22 Richard W.M. Jones 2014-07-30 13:35:32 UTC
As noted in the comments, this is broken again.  I'm using
golang-1.3-5.fc22.x86_64

../run go install libguestfs.org/guestfs
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied

Comment 23 Vincent Batts 2014-08-06 21:18:59 UTC
*** Bug 1124017 has been marked as a duplicate of this bug. ***

Comment 24 Vincent Batts 2014-08-06 21:31:23 UTC
The issue is in the building of a noarch 'golang-src' that the compiler checks timestamps of the source files against the compiled stdlib libraries. Since the x86_64, i686 and arm builders all produce the same 'golang-src', then the last builder to finish wins. In this case it is always the ARM builder, so the freshness of x86_64 and i686 libraries appears out-of-date.

Comment 25 Vincent Batts 2014-08-07 18:49:04 UTC
unrelated to this issue, but the golang build is failing now due to bz1127518

Comment 26 Fedora Update System 2014-08-08 17:44:41 UTC
golang-1.2.2-12.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.2.2-12.el6

Comment 27 Fedora Update System 2014-08-08 17:45:25 UTC
golang-1.2.2-12.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.2.2-12.fc19

Comment 28 Fedora Update System 2014-08-08 18:33:11 UTC
golang-1.2.2-12.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/golang-1.2.2-12.fc20

Comment 29 Fedora Update System 2014-08-11 15:21:49 UTC
golang-1.2.2-14.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.2.2-14.el6

Comment 30 Fedora Update System 2014-08-11 17:01:06 UTC
golang-1.2.2-15.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.2.2-15.el6

Comment 31 Fedora Update System 2014-08-11 17:01:52 UTC
golang-1.2.2-15.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.2.2-15.fc19

Comment 32 Fedora Update System 2014-08-11 17:27:28 UTC
golang-1.2.2-15.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/golang-1.2.2-15.fc20

Comment 33 Richard W.M. Jones 2014-08-11 18:03:21 UTC
I'm still having the same problem with golang-1.2.2-15.fc20.x86_64
(Fedora 20) and golang-1.3-7.fc22.x86_64 (Fedora Rawhide).

The same error both times:

$ GOLANG=go GOPATH=`pwd` go install libguestfs.org/guestfs
go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a: permission denied

Looking at strace it does appear to be trying to recompile the
core libraries:

28593 unlink("/usr/lib/golang/pkg/linux_amd64/runtime/cgo.a" <unfinished ...>
28589 <... select resumed> )            = 0 (Timeout)
28593 <... unlink resumed> )            = -1 EACCES (Permission denied)
28589 select(0, NULL, NULL, NULL, {0, 20} <unfinished ...>
28593 rmdir("/usr/lib/golang/pkg/linux_amd64/runtime/cgo.a") = -1 EACCES (Permission denied)
28589 <... select resumed> )            = 0 (Timeout)
28593 open("/usr/lib/golang/pkg/linux_amd64/runtime/cgo.a", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666 <unfinished ...>
28589 select(0, NULL, NULL, NULL, {0, 20} <unfinished ...>
28593 <... open resumed> )              = -1 EACCES (Permission denied)

Comment 34 Fedora Update System 2014-08-13 19:29:02 UTC
golang-1.2.2-22.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.2.2-22.el6

Comment 35 Fedora Update System 2014-08-13 19:29:35 UTC
golang-1.2.2-22.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.2.2-22.fc19

Comment 36 Fedora Update System 2014-08-13 19:30:16 UTC
golang-1.2.2-22.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/golang-1.2.2-22.fc20

Comment 37 Vincent Batts 2014-08-14 00:59:04 UTC
(In reply to Richard W.M. Jones from comment #33)
> I'm still having the same problem with golang-1.2.2-15.fc20.x86_64
> (Fedora 20) and golang-1.3-7.fc22.x86_64 (Fedora Rawhide).
> 
> The same error both times:
> 
> $ GOLANG=go GOPATH=`pwd` go install libguestfs.org/guestfs
> go install runtime/cgo: open /usr/lib/golang/pkg/linux_amd64/runtime/cgo.a:
> permission denied
> 
> Looking at strace it does appear to be trying to recompile the
> core libraries:
> 
> 28593 unlink("/usr/lib/golang/pkg/linux_amd64/runtime/cgo.a" <unfinished ...>
> 28589 <... select resumed> )            = 0 (Timeout)
> 28593 <... unlink resumed> )            = -1 EACCES (Permission denied)
> 28589 select(0, NULL, NULL, NULL, {0, 20} <unfinished ...>
> 28593 rmdir("/usr/lib/golang/pkg/linux_amd64/runtime/cgo.a") = -1 EACCES
> (Permission denied)
> 28589 <... select resumed> )            = 0 (Timeout)
> 28593 open("/usr/lib/golang/pkg/linux_amd64/runtime/cgo.a",
> O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666 <unfinished ...>
> 28589 select(0, NULL, NULL, NULL, {0, 20} <unfinished ...>
> 28593 <... open resumed> )              = -1 EACCES (Permission denied)

thanks for testing. https://admin.fedoraproject.org/updates/golang-1.2.2-22.fc20 should be shipped shortly and finally fixes it.

Comment 38 Fedora Update System 2014-08-15 18:58:25 UTC
Package golang-1.2.2-22.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing golang-1.2.2-22.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-2203/golang-1.2.2-22.el6
then log in and leave karma (feedback).

Comment 39 Fedora Update System 2014-08-16 00:25:20 UTC
golang-1.2.2-22.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 40 Fedora Update System 2014-09-29 17:08:08 UTC
golang-1.3.2-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.3.2-1.el6

Comment 41 Fedora Update System 2014-09-29 17:09:05 UTC
golang-1.3.2-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.3.2-1.fc19

Comment 42 Fedora Update System 2014-10-01 16:24:07 UTC
golang-1.3.3-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/golang-1.3.3-1.el6

Comment 43 Fedora Update System 2014-10-01 16:53:26 UTC
golang-1.3.3-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.3.3-1.fc19

Comment 44 Fedora Update System 2014-10-11 07:03:17 UTC
golang-1.3.3-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 45 Fedora Update System 2014-10-17 17:38:20 UTC
golang-1.3.3-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.