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: go install: don’t fail when go.mod can’t be updated on a read-only system #33326

Open
stapelberg opened this issue Jul 28, 2019 · 0 comments

Comments

@stapelberg
Copy link
Contributor

commented Jul 28, 2019

$ go version
go version go1.13beta1 linux/amd64

I talked about this issue with @bcmills over GopherCon 2019 and he recommended I file this issue for tracking.

I am using cmd/go in a build environment where the entire system is read-only, but I have a writable copy of the source tree I’m building (e.g. github.com/junegunn/fzf). The system provides a read-only module cache (at /ro/gopath/pkg/mod) which contains all the dependencies of the source tree.

I’m using replace directives to enforce that my environment’s module versions are used, which can be different from the versions listed in go.mod/go.sum. See #29410 (comment) for details.

When running go install, it fails to lock the module cache because it’s read-only:

go: failed to lock file at /ro/gopath/pkg/mod/cache/lock

So far so good—it’s reasonable to not continuing when the side lock can’t be acquired. But, when specifying -mod=readonly, I’m getting:

go: updates to go.mod needed, disabled by -mod=readonly

I don’t know that go install should error out here. Certainly it could just continue with whatever changes needed just being retained in memory? As a user, I’m interested in the binary installation, not the side effect updates.

Thanks for considering,

@bcmills bcmills added this to the Go1.14 milestone Jul 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.