Skip to content

cmd/go: yet another case where time stamps lead us astray #5064

@4a6f656c

Description

@4a6f656c
When building packages outside of the GOROOT (i.e. GOPATH != GOROOT), go may still
attempt to rebuild packages in the GOROOT if they depend on a package in the GOROOT that
appears to be stale.

This is easily reproduced as follows:

$ sudo tar -C /usr/local -xzf go1.0.3.linux-amd64.tar.gz
$ sudo touch /usr/local/go/pkg/linux_amd64/reflect.a
$ echo $GOPATH
/home/jsing/src/mygo
$ cat example/example.go 
package example

import _ "encoding/binary"
$ go install example
go install encoding/binary: open /usr/local/go/pkg/linux_amd64/encoding/binary.a:
permission denied

In the above case, encoding/binary is marked as stale and go attempts to rebuild it
since reflect is considered stale, even though encoding/binary is under the GOROOT. This
results in problems when users are not able to write to GOROOT; the packaging comments
from issue/4106 are also applicable here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions