On Mon, Oct 10, 2016 at 12:48 PM, Ian Rose <ianros...@gmail.com> wrote:
> On my macbook pro, I'm able to `go install` with a custom installsuffix just
> fine:
>
>
> $ ls -l /usr/local/go/pkg/
> total 0
> drwxr-xr-x   5 root  wheel   170 Feb 25  2016 bootstrap
> drwxr-xr-x  58 root  wheel  1972 Feb 25  2016 darwin_amd64
> drwxr-xr-x  57 root  wheel  1938 Sep  8  2015 darwin_amd64_race
> drwxr-xr-x   4 root  wheel   136 Sep  8  2015 include
> drwxr-xr-x   3 root  wheel   102 Feb 25  2016 obj
> drwxr-xr-x   3 root  wheel   102 Feb 25  2016 tool
>
>
> $ go install -installsuffix nocgo golang.org/x/tools/cmd/goimports
> $ echo $?
> 0
> $ echo $GOROOT
>
>
> $ ls -l /usr/local/go/pkg/
> total 0
> drwxr-xr-x   5 root  wheel   170 Feb 25  2016 bootstrap
> drwxr-xr-x  58 root  wheel  1972 Feb 25  2016 darwin_amd64
> drwxr-xr-x  57 root  wheel  1938 Sep  8  2015 darwin_amd64_race
> drwxr-xr-x   4 root  wheel   136 Sep  8  2015 include
> drwxr-xr-x   3 root  wheel   102 Feb 25  2016 obj
> drwxr-xr-x   3 root  wheel   102 Feb 25  2016 tool
>
>
> But on a linux machine, it fails:
>
> $ ls -l /usr/local/go/pkg/
> total 20
> drwxr-xr-x  2 root root 4096 Jan 13  2016 include
> drwxr-xr-x 29 root root 4096 Jan 13  2016 linux_amd64
> drwxr-xr-x 28 root root 4096 Jan 13  2016 linux_amd64_race
> drwxr-xr-x  3 root root 4096 Jan 13  2016 obj
> drwxr-xr-x  3 root root 4096 Jan 13  2016 tool
>
>
> $ GOPATH=`pwd`/go go install -installsuffix nocgo
> golang.org/x/tools/cmd/goimports
> go install runtime: mkdir /usr/local/go/pkg/linux_amd64_nocgo/: permission
> denied
>
>
> The obvious difference appears to be that on my Mac, the go tool isn't
> trying to write out .a files for the core lib packages that are compiled
> with the new installsuffix, whereas on Linux it is trying to do so.

I doubt this has anything to do with Mac vs. GNU/Linux.  I suspect
there is something about the way that Go is installed on your
GNU/Linux system that makes the standard packages appear out of date.
By default the go tool will not attempt to reinstall the standard
packages, even if they appear out of date.  But when you specify
-installsuffix, the algorithm changes, and now it matters whether the
package is out of date or not.

To see the list of out-of-date packages, try running
    go list -f '{{.Name}} {{.Stale}}' std
It will print `true` for each package it thinks is out of date.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to