FS#35278 - [go] touch installed files to make "go install ..." work

Attached to Project: Community Packages
Opened by daaku (daaku) - Tuesday, 14 May 2013, 17:02 GMT
Last edited by Alexander F. Rødseth (xyproto) - Sunday, 02 June 2013, 18:21 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Alexander F. Rødseth (xyproto)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

It's common to use "go install ..." which tries to compile/install everything where the source files have a more recent timestamp than the installed binaries or pkg files. It would be great if the install script touched the binaries or something to ensure a more recent timestamp on them. I think something like this would suffice:

find /usr/lib/go/pkg -type f | xargs touch
touch /usr/lib/go/bin/{godoc,go,gofmt}

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:

go install ...
This task depends upon

Closed by  Alexander F. Rødseth (xyproto)
Sunday, 02 June 2013, 18:21 GMT
Reason for closing:  Fixed
Additional comments about closing:  Please reopen if this should still be an issue. Thank you.
Comment by Alexander F. Rødseth (xyproto) - Wednesday, 15 May 2013, 09:20 GMT
Hi, good idea! Will look at it now.
Comment by Alexander F. Rødseth (xyproto) - Monday, 20 May 2013, 20:44 GMT
Tried adding something along those lines, but it didn't work out. Will look at it some more another day.
Comment by T. Jameson Little (beatgammit) - Tuesday, 28 May 2013, 22:40 GMT
I just ran into this today, and I got errors like this:

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

There's a similar thread on the Debian bug tracker: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658421

I did a similar fix by touching all the files (find /usr/lib/go/pkg -type f -exec touch {} +), and that resolved the errors.
Comment by Alexander F. Rødseth (xyproto) - Saturday, 01 June 2013, 10:09 GMT
Thanks T. Jameson Little. Rebuilding the package now, will see how it fares.
Comment by daaku (daaku) - Sunday, 02 June 2013, 15:47 GMT
  • Field changed: Percent Complete (100% → 0%)
The fix got us most of the way there. We need to also touch the binaries to have them be considered newer. Replacing the recent change with:

find "$pkgdir/usr/lib/go/pkg" "$pkgdir/usr/bin" -type f -exec touch '{}' +

Should do the trick. You could be more specific, but I think just touching all binaries will reduce future breakage if new binaries are introduced as part of the go package.

To test if this is successful you can run this on a fresh install:

go install -v ...

And it should work and not try to rebuild standard go binaries/libraries provided by this package.
Comment by Alexander F. Rødseth (xyproto) - Sunday, 02 June 2013, 16:04 GMT
Hi,

Thanks for reporting. Just to be 100% sure that everything is working correctly this time, do you have a command I can run when testing the updated package, to make sure it's working?
I did run "go install" in a directory with some go code before updating the package and could not find any problems at the time. (What would be a good test for '...' for "go install -v"?)

Thanks
Comment by daaku (daaku) - Sunday, 02 June 2013, 17:25 GMT
The command from the description or my previous comment will do: 'go install ...'. To test all possible variants you need to cross compile etc, but 'go install ...' will probably be sufficient. Note, the '...' (triple dot) syntax is go specific wildcard syntax described here: http://golang.org/cmd/go/.
Comment by Alexander F. Rødseth (xyproto) - Sunday, 02 June 2013, 18:20 GMT
Thanks for the clarification! 'go install -v ...' works great here now. Uploading the modified package.

Loading...