Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#41561 - [go] go install bytes: permission denied after upgrading to 1.3.1

Attached to Project: Community Packages
Opened by Stanislav Seletskiy (seletskiy) - Thursday, 14 August 2014, 06:34 GMT
Last edited by Alexander F. Rødseth (xyproto) - Thursday, 09 February 2017, 11:22 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Vesa Kaihlavirta (vegai)
Alexander F. Rødseth (xyproto)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 16
Private No

Details

Description:
`go install [...]: open /usr/lib/go/pkg/linux_amd64/[...].a: permission denied` errors after upgrading go from 1.3 to 1.3.1.


Steps to reproduce:

1. Upgrade go to 1.3.1;
2. go get any package and see the error, for example:
$ go get git.bytbox.net/sloc.git/sloc
go install bytes: open /usr/lib/go/pkg/linux_amd64/bytes.a: permission denied
go install strings: open /usr/lib/go/pkg/linux_amd64/strings.a: permission denied
This task depends upon

Closed by  Alexander F. Rødseth (xyproto)
Thursday, 09 February 2017, 11:22 GMT
Reason for closing:  Fixed
Comment by Jorge Kodato (jkodato) - Thursday, 14 August 2014, 12:36 GMT
After upgrade to 1.3.1, packages bytes and string are marked as stale:
$ go list -f '{{.Stale}}' bytes
true
$ go list -f '{{.Stale}}' strings
true

When you want to install a package that imports these packages (bytes and strings), go compiles and try to install them in /usr/lib/go/pkg/linux_amd64. As non-root user, you don't have the permission to write in this directory.

Comment by Makpoc (Makpoc) - Thursday, 14 August 2014, 16:40 GMT
Hi,

I had the same issue. The following resolved it for me:

find /usr/lib/go -name "*.a" -exec touch -r `which go` {} \;

Hope this helps.
Comment by Jerome (sinatosk) - Thursday, 14 August 2014, 20:45 GMT
I too had the same error

I recompiled the package myself and that helped and also tried Makpoc find command and that helped too

What do you think the issue is Makpoc? I'm curious to how you came to conclusion about file time stamp
Comment by Karol Marcjan (szabba) - Thursday, 14 August 2014, 22:44 GMT
Also affected and confirming Makpoc's solution works.

Note that steps to reproduce might be misleading -- this will only happen if you go get something that actually depends on bytes/strings.
Comment by Stanislav Seletskiy (seletskiy) - Friday, 15 August 2014, 04:17 GMT
@szabba, it's actually not. Not only bytes and strings are marked as stale, but every stdlib package that comes with go. If you `sudo touch` bytes.a and strings.a and try to `go get` something that depends on other packages, you'll get some errors about other .a files.
Comment by Karol Marcjan (szabba) - Friday, 15 August 2014, 06:14 GMT
Well that's weird. I had the same issue with bytes/strings, but packages that depended import (directly or indirectly) math (github.com/szabba/md/vect, github.com/szabba/md/newton) were go got just fine.

(I've reinstalled go from the repositories to check that it's still true on my machine.)

I've sniffed a bit around and some stdlib packages in community/go are stale and some aren't. See the attached file for how this looks on my system. Use the script below to generate the results on your machine (if your so inclined).

for pkg in `find /usr/lib/go | grep '\.a$' | sed '{s/\/usr\/lib\/go\/pkg\/linux_amd64\///; s/\.a$//}'`; do
echo $pkg `go list -f {{.Stale}} $pkg`
done 2> /dev/null | sort > out

EDIT: Change the linux_amd64 part in the sed script to the directory for your machine's architecture.

EDIT2: Oh, did you mean that some other stdlib packages will also cause the issue (as opposed to all)?
   out (13.7 KiB)
Comment by Stanislav Seletskiy (seletskiy) - Friday, 15 August 2014, 06:31 GMT
@szabba, hmm, you're right. I thought that every package is stale, but I've just checked output with your script and yes, some of them is stale and some of them is not. And stale list is same with yours. Sorry for inconvenience.
Comment by Karol Marcjan (szabba) - Friday, 15 August 2014, 07:54 GMT
Well I wasn't right initally either. In the end we both got a better understanding of the problem and someone else might benefit from it too. Win/win.
Comment by Karol Marcjan (szabba) - Friday, 15 August 2014, 09:33 GMT
Comment by Alexander F. Rødseth (xyproto) - Saturday, 16 August 2014, 08:54 GMT
Thanks for reporting. I will fix this as soon as humanly possible. I'm going on a cabin trip this weekend, but I might be able to fix it from my mobile phone over ssh. If another TU/dev wishes to fix it instead, just leave a short note here, please.
Comment by Darko Luketic (dalu) - Monday, 18 August 2014, 12:11 GMT
https://code.google.com/p/go/issues/detail?id=5064

quote:
I suggest that we update the docs to tell people to tell tar to preserve time stamps from the archive.
Comment by Dmitry (Zverushko) - Tuesday, 19 August 2014, 16:43 GMT
you may install every stale package
sudo go install <nameofpackage>

or install all

sudo go install all

and try to install you package in gopath

go get github.com/revel/cmd/revel (exemple)
Comment by Alexander F. Rødseth (xyproto) - Sunday, 24 August 2014, 11:10 GMT
Would running "go install all" in the go.install file (after the package has been installed/upgraded) be a possible solution?
Comment by Karol Marcjan (szabba) - Sunday, 24 August 2014, 12:50 GMT
Take a look at `go help packages` -- seems like if anything you should rather put `go install std`.

It conveys what you're tryin to do better and in the odd circumstance that the user under whom the install script runs has a GOPATH set -- it prevents you from automatically reinstalling everything they have go installed by hand.
Comment by Thiago Perrotta (thiagowfx) - Sunday, 24 August 2014, 16:29 GMT
I also have this problem. Any solutions yet? Downgrading to 1.3 is a temporary workaround for me.
Comment by Karol Marcjan (szabba) - Sunday, 24 August 2014, 16:39 GMT
After installing 1.3.1 Makpoc's oneliner works, so does

su -c 'go install std'
Comment by Alexander F. Rødseth (xyproto) - Wednesday, 27 August 2014, 18:28 GMT
Updated the package to run "go install std" after upgrade/installation. Sorry about the slight delay.

Please confirm that go-2:1.3.1-2 now works as expected, it should appear in [community] any minute now.

Tested the steps to reproduce, and it works here.
Comment by Thiago Perrotta (thiagowfx) - Wednesday, 27 August 2014, 23:53 GMT
Yes, it works. Tested with: 'go get github.com/gobuild/got'.
Comment by Denis Gagnon (McNoggins) - Thursday, 28 August 2014, 02:25 GMT
Tested it with the following AUR package which failed to build before the upgrade. It works fine now: https://aur.archlinux.org/packages/go-mtpfs-git/
Comment by Alexander F. Rødseth (xyproto) - Thursday, 28 August 2014, 09:39 GMT
Great, thanks for testing, closing this one.
Comment by Miki Tebeka (tebeka) - Sunday, 19 October 2014, 13:53 GMT
  • Field changed: Percent Complete (100% → 0%)
I still see the problem:

go get github.com/nsf/gocode Thu Aug 28, 17:34
go install bytes: open /usr/lib/go/pkg/linux_amd64/bytes.a: permission denied
go install strings: open /usr/lib/go/pkg/linux_amd64/strings.a: permission denied
Comment by Alexander F. Rødseth (xyproto) - Monday, 20 October 2014, 13:40 GMT
Miki Tebeka, if you run "go install std" as root, does it fix the problem?
Comment by Miki Tebeka (tebeka) - Friday, 24 October 2014, 15:04 GMT
I've created a new archline VM (based on 2014.10.01 and after installing go tried "go get github.com/nsf/gocode" - works for me :)

I guess you can close this one.
Comment by Alexander F. Rødseth (xyproto) - Thursday, 09 February 2017, 11:20 GMT
Tried removing "go install std" for go 1.7.5 and could not reproduce this error after installation. Will remove the .install file. Please re-open this issue if the issue should re-occur.

Loading...