Skip to content

cmd/go: package continues to be stale after go install #23818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dmitshur opened this issue Feb 13, 2018 · 8 comments
Closed

cmd/go: package continues to be stale after go install #23818

dmitshur opened this issue Feb 13, 2018 · 8 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dmitshur
Copy link
Member

What version of Go are you using (go version)?

$ go version
go version go1.10rc2 darwin/amd64

Does this issue reproduce with the latest release?

Haven't checked yet.

What operating system and processor architecture are you using (go env)?


GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/Dmitri/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/tmp/emptygopath"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/tw/kgz4v2kn4n7d7ryg5k_z3dk40000gn/T/go-build834347091=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

~ $ export GOPATH=/tmp/emptygopath
~ $ go get -u -v github.com/kisielk/gotool
github.com/kisielk/gotool (download)
created GOPATH=/tmp/emptygopath; see 'go help gopath'
github.com/kisielk/gotool/internal/load
github.com/kisielk/gotool
~ $ go list -f '{{.Stale}} {{.StaleReason}}'  github.com/kisielk/gotool
true stale dependency: github.com/kisielk/gotool/internal/load
~ $ go install -v github.com/kisielk/gotool
~ $ go list -f '{{.Stale}} {{.StaleReason}}'  github.com/kisielk/gotool
true stale dependency: github.com/kisielk/gotool/internal/load
~ $ go install -v github.com/kisielk/gotool/internal/load
~ $ go list -f '{{.Stale}} {{.StaleReason}}'  github.com/kisielk/gotool
false 

Note that at the time of this issue report, github.com/kisielk/gotool is at revision https://github.com/kisielk/gotool/tree/d6ce6262d87e3a4e153e86023ff56ae771554a41.

What did you expect to see?

~ $ export GOPATH=/tmp/emptygopath
~ $ go get -u -v github.com/kisielk/gotool
github.com/kisielk/gotool (download)
created GOPATH=/tmp/emptygopath; see 'go help gopath'
github.com/kisielk/gotool/internal/load
github.com/kisielk/gotool
~ $ go list -f '{{.Stale}} {{.StaleReason}}'  github.com/kisielk/gotool
false 
~ $ go install -v github.com/kisielk/gotool
~ $ go list -f '{{.Stale}} {{.StaleReason}}'  github.com/kisielk/gotool
false 
~ $ go install -v github.com/kisielk/gotool/internal/load
~ $ go list -f '{{.Stale}} {{.StaleReason}}'  github.com/kisielk/gotool
false 

What did you see instead?

As shown in "What did you do?" section, the package github.com/kisielk/gotool was being reported as "stale" with the reason that there was a stale dependency github.com/kisielk/gotool/internal/load. Doing go install did not make the package fresh, even though it should've.

To me, this looks like the same issue as #23797, and it's related to the new build cache of Go 1.10 (/cc @mvdan @bradfitz @rsc). However, I figured I'd report it anyway for an extra test case, since it was so easily reproducible. There's a small chance it's not exactly the same issue, but easy to verify after #23797 is resolved.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 13, 2018
@bradfitz bradfitz added this to the Go1.10 milestone Feb 14, 2018
@bradfitz bradfitz modified the milestones: Go1.10, Go1.10.1 Feb 14, 2018
@bradfitz
Copy link
Contributor

We decided in the release meeting to think about this for Go 1.10.1.

@andybons
Copy link
Member

Bumping to 1.10.2 since there's no fix yet.

@ysmolski
Copy link
Member

ysmolski commented Mar 30, 2018

@bradfitz @andybons what was the decision about it on the meeting? I am wondering about the expected behaviour.

I am trying to fix cmd/go test which uses this functionality and I came to this weird solution: https://go-review.googlesource.com/c/go/+/103675 - it does smell fishy with "-i" flags over there.

Thanks!

@bradfitz
Copy link
Contributor

@ysmolsky, everything that was decided was posted above:

to think about this for Go 1.10.1.

But that didn't happen. Perhaps @rsc can take a look soon.

@rsc
Copy link
Contributor

rsc commented Apr 18, 2018

Almost duplicate of #24558 (that's about binaries, this is about packages).

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/107957 mentions this issue: cmd/go: fix go list .Stale computation

@FiloSottile
Copy link
Contributor

@gopherbot please file this for backport against 1.10.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #25032 (for 1.10).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@FiloSottile FiloSottile modified the milestones: Go1.10.2, Go1.11 Apr 24, 2018
@golang golang locked and limited conversation to collaborators Apr 25, 2019
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

7 participants