Skip to content
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

cmd/go/internal/vcs: unnecessary git tree object required #65339

Closed
huww98 opened this issue Jan 29, 2024 · 1 comment
Closed

cmd/go/internal/vcs: unnecessary git tree object required #65339

huww98 opened this issue Jan 29, 2024 · 1 comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@huww98
Copy link
Contributor

huww98 commented Jan 29, 2024

Go version

go version go1.21.6 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/huww98/Library/Caches/go-build'
GOENV='/Users/huww98/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/huww98/go/pkg/mod'
GONOPROXY='gitlab.my-company.com'
GONOSUMDB='gitlab.my-company.com'
GOOS='darwin'
GOPATH='/Users/huww98/go'
GOPRIVATE='gitlab.my-company.com'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/huww98/go/src/github.com/kubernetes-sigs/alibaba-cloud-csi-driver/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/go-build2491385028=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

git clone --depth=1 https://github.com/kubernetes-sigs/alibaba-cloud-csi-driver.git test  # any repo should reproduce
git fetch --unshallow --filter=tree:0
git remote remove origin
LANG=C GOOS=linux go build -v

What did you see happen?

# cd /Users/huww98/go/src/github.com/kubernetes-sigs/test; git -c log.showsignature=false show -s --format=%H:%ct
fatal: unable to read tree 38f323b242d199e36b4db5924967c399a26b8e14
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.

What did you expect to see?

No error, git revision information is correctly embeded.

huww98 added a commit to huww98/go that referenced this issue Jan 29, 2024
"git show" will try to load the tree from previous commit even if -s is passed.

Fixes golang#65339
@gopherbot
Copy link

Change https://go.dev/cl/559075 mentions this issue: cmd/go/internal/vcs: use git log to avoid unnecessary tree object

huww98 added a commit to huww98/go that referenced this issue Jan 29, 2024
"git show" will try to load the tree from previous commit even if -s is
passed.

Fixes golang#65339
@bcmills bcmills added GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 29, 2024
@bcmills bcmills added this to the Backlog milestone Jan 29, 2024
@bcmills bcmills added the FixPending Issues that have a fix which has not yet been reviewed or submitted. label Jan 29, 2024
huww98 added a commit to huww98/go that referenced this issue Jan 30, 2024
"git show" by default shows the diff from the previous commit. "-s"
suppress all output from the diff machinery. But it will still try to
fetch the relevant objects, which may be unavailable if the repository
is a partial clone.

Use "git log" instead, which only needs the commit object.

Fixes golang#65339
huww98 added a commit to huww98/go that referenced this issue Jan 30, 2024
"git show" by default shows the diff from the previous commit. "-s"
suppress all output from the diff machinery. But it will still try to
fetch the relevant objects, which may be unavailable if the repository
is a partial clone.

Use "git log" instead, which only needs the commit object.

Fixes golang#65339
huww98 added a commit to huww98/go that referenced this issue Feb 8, 2024
"git show" by default shows the diff from the previous commit. "-s"
suppress all output from the diff machinery. But it will still try to
fetch the relevant objects, which may be unavailable if the repository
is a partial clone.

Use "git log" instead, which only needs the commit object.

Fixes golang#65339
huww98 added a commit to huww98/go that referenced this issue Feb 22, 2024
"git show" by default shows the diff from the previous commit. "-s"
suppress all output from the diff machinery. But it will still try to
fetch the relevant objects, which may be unavailable if the repository
is a partial clone.

Use "git log" instead, which only needs the commit object.

Fixes golang#65339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants