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

yarn test leaves a changed go.mod file as debris #1253

Closed
FUDCo opened this issue Jul 2, 2020 · 6 comments
Closed

yarn test leaves a changed go.mod file as debris #1253

FUDCo opened this issue Jul 2, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@FUDCo
Copy link
Contributor

FUDCo commented Jul 2, 2020

Running a yarn test that tests cosmic-swingset (i.e., either the cosmic-swingset directory or running all the tests globally) modifies packages/cosmic-swingset/go.mod, which then keeps sneaking into my commits. Please make it stop doing this.

@FUDCo FUDCo added the bug Something isn't working label Jul 2, 2020
@FUDCo
Copy link
Contributor Author

FUDCo commented Jul 2, 2020

@michaelfig

@michaelfig
Copy link
Member

This is inevitable, if your version of Go disagrees enough with what everybody else is using. If the disagreement causes a different go.mod to be generated, then we'll just fight back and forth with what is checked in.

I have:

$ go version
go version go1.14.2 darwin/amd64
$ 

What do you have?

@michaelfig
Copy link
Member

(I can add a flag to prevent Go from modifying the go.mod, but then your builds and tests will fail. Let me know if that is better.)

@FUDCo
Copy link
Contributor Author

FUDCo commented Jul 3, 2020

I have:

$ go version
go version go1.14.2 darwin/amd64
$ 

What do you have?

The machine it says go version go1.13.5 darwin/amd64

Was there something that should have told me that upgrading go was called for? How would I have suspected that this was the problem?

If there was some kind of tickler that would tell me to upgrade it, I would. Having a build fail once with a warning that I needed to upgrade would be fine. One build failure is less hassle than constantly having to edit commits to take this file out.

Also, how do I upgrade it?

@michaelfig
Copy link
Member

I don't understand why the tickler didn't work. The go.mod has a version requirement of go 1.14 (on line 3), but your compiler didn't squawk at it?

Also, how do I upgrade it?

https://golang.org/dl/

@michaelfig
Copy link
Member

I don't understand why the tickler didn't work. The go.mod has a version requirement of go 1.14 (on line 3), but your compiler didn't squawk at it?

Ah, it doesn't do what it says on the tin. The version isn't used unless within a "build tag". golang/go#23969 (comment)

I've made a PR, and tested that it fails compilation if the version is wrong (i.e. lower than the specified).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants