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: mod download doesn't work with commit hash #27947

Closed
marpio opened this Issue Sep 30, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@marpio
Copy link

marpio commented Sep 30, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

yes

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

amd64/linux

What did you do?

GO111MODULE=on go mod download -json  github.com/pkg/errors@30136e27e2ac8d167177e8a583aa4c3fea5be833

What did you expect to see?

the same as executing go mod download using the pseudo version v0.8.1-0.20180127015812-30136e27e2ac

GO111MODULE=on go mod download -json  github.com/pkg/errors@v0.8.1-0.20180127015812-30136e27e2ac
go: finding github.com/pkg/errors v0.8.1-0.20180127015812-30136e27e2ac
{
        "Path": "github.com/pkg/errors",
        "Version": "v0.8.1-0.20180127015812-30136e27e2ac",
        "Info": "/home/piotr/go/pkg/mod/cache/download/github.com/pkg/errors/@v/v0.8.1-0.20180127015812-30136e27e2ac.info",
        "GoMod": "/home/piotr/go/pkg/mod/cache/download/github.com/pkg/errors/@v/v0.8.1-0.20180127015812-30136e27e2ac.mod",
        "Zip": "/home/piotr/go/pkg/mod/cache/download/github.com/pkg/errors/@v/v0.8.1-0.20180127015812-30136e27e2ac.zip",
        "Dir": "/home/piotr/go/pkg/mod/github.com/pkg/errors@v0.8.1-0.20180127015812-30136e27e2ac",
        "Sum": "h1:rgnLNKoftJ8uXF4TZoSr7Ik9jeW2E5fztPrAvJoyuAA=",
        "GoModSum": "h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0="
}

I expect the mod to be downloaded to the cache directory.

What did you see instead?

go: finding github.com/pkg/errors 30136e27e2ac8d167177e8a583aa4c3fea5be833
{
        "Path": "github.com/pkg/errors",
        "Version": "v0.8.1-0.20180127015812-30136e27e2ac",
        "Error": "not in cache"
}

@agnivade agnivade changed the title go mod download doesn't work with commit hash cmd/go: mod download doesn't work with commit hash Oct 1, 2018

@agnivade agnivade added this to the Go1.12 milestone Oct 1, 2018

@agnivade

This comment has been minimized.

Copy link
Member

agnivade commented Oct 1, 2018

@fedepaol fedepaol referenced this issue Oct 5, 2018

Closed

Golist #744

marwan-at-work added a commit to marwan-at-work/go that referenced this issue Oct 5, 2018

cmd/go: mod download should accept @hash/branch
Go get in mod-enabled packages lets you do go get pkg@<hash> or pkg@<branch>.
Go internally will switch the hash or branch into a pseudo version.
Go mod download should do the same. The bug lied in the fact that the disk cache
was not being written when Go converted the hash/branch into a pseduo version.
Fixes golang#27947

marwan-at-work added a commit to marwan-at-work/go that referenced this issue Nov 5, 2018

cmd/go: accept @hash/branch in mod download
Go get in mod-enabled packages lets you do go get "pkg@<hash>" or "pkg@<branch>".
Go internally will switch the hash or branch into a pseudo version.
Go mod download should do the same. The bug lied in the fact that the disk cache
was not being written when Go converted the hash/branch into a pseduo version.

Fixes golang#27947

Change-Id: Ib5b376c65406173c3cd8739254b37a919dff8e8f
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Nov 5, 2018

Change https://golang.org/cl/140257 mentions this issue: cmd/go: accept @hash/branch in mod download

@bcmills bcmills added the NeedsFix label Nov 15, 2018

@gopherbot gopherbot removed the NeedsFix label Nov 15, 2018

marwan-at-work added a commit to marwan-at-work/go that referenced this issue Nov 16, 2018

Go get in mod-enabled packages lets you do go get "pkg@" or "pkg@".
Go internally will switch the hash or branch into a pseudo version.
Go mod download should do the same. The bug lay in the fact that the disk cache
was not being written when Go converted the hash/branch into a pseudo version.

Fixes golang#27947

Change-Id: I55810a544ef4410f93c5b7ccbe7e2cad7c78b26f

@gopherbot gopherbot closed this in 6157dda Nov 16, 2018

bradfitz pushed a commit that referenced this issue Nov 21, 2018

cmd/go: accept @hash/branch in mod download
Go get in mod-enabled packages lets you do go get "pkg@<hash>" or "pkg@<branch>".
Go internally will switch the hash or branch into a pseudo version.
Go mod download should do the same. The bug lay in the fact that the disk cache
was not being written when Go converted the hash/branch into a pseudo version.

Fixes #27947

Change-Id: I94c29a5c95f69ab18a9cd7a2ecade128047c5e36
GitHub-Last-Rev: 668634b
GitHub-Pull-Request: #28042
Reviewed-on: https://go-review.googlesource.com/c/140257
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment