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

Upgrade go compiler 1.13.4 -> 1.14.3 #6359

Merged
merged 1 commit into from
Jun 2, 2020
Merged

Upgrade go compiler 1.13.4 -> 1.14.3 #6359

merged 1 commit into from
Jun 2, 2020

Conversation

ryboe
Copy link
Contributor

@ryboe ryboe commented May 12, 2020

  • update go to version 1.14.3
  • simplify make test command
  • remove GO111MODULE=on and GOFLAGS=-mod=vendor env vars, which are no longer necessary in Go 1.14
    • GO111MODULE=on is the default behavior now
    • We don't have to pass a flag to tell go build and go test to use vendor/. It will use vendor/ if the directory is present

This is a resubmit of #6223.

@ghost ghost added the size/s label May 12, 2020
@ghost ghost requested a review from nat-henderson May 12, 2020 23:31
@ghost ghost added the dependencies label May 12, 2020
GNUmakefile Outdated Show resolved Hide resolved
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
go test $(TESTARGS) -timeout=30s $(TEST)
Copy link
Contributor Author

@ryboe ryboe May 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to pipe the list of packages to xargs. I was told parallelism was being limited to 4 for CI reasons, but I'm skeptical of that. Unless you have some very weird CI situation, limiting parallelism just slows down your tests a little. If a higher parallelism causes test failures, then you've got race conditions in your tests and they should be fixed or parallelism should be set to 1.

vendor/modules.txt Outdated Show resolved Hide resolved
@@ -24,4 +24,4 @@ require (
google.golang.org/api v0.22.0
)

go 1.13
go 1.14
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line doesn't prevent recent Go 1.13 compilers from building the plugin. It just says "use the latest modules behavior." Keeping this up-to-date can prevent some dependency headaches.

@nat-henderson nat-henderson requested a review from megan07 May 12, 2020 23:51
@nat-henderson
Copy link
Contributor

Similarly handing off to @megan07 - related to the vendor removal work. :)

@nat-henderson
Copy link
Contributor

It is very likely we will want to block this on the removal of vendor - We probably want one big change to the build environment at a time! :)

@ryboe
Copy link
Contributor Author

ryboe commented May 13, 2020

@ndmckinley Is that going to merge soon?

EDIT: I see that #6368 merged. I've updated this PR to remove the vendor/ changes.

@ghost ghost added size/xs and removed size/s labels May 13, 2020
@ryboe ryboe mentioned this pull request May 13, 2020
@nat-henderson
Copy link
Contributor

Great. I'm not 100% sure whether this is going to require a change to magic-modules - I think probably not - but investigating that will take a while, and we'll also need to copy this change to the beta provider. Is this urgent for you? If not, we'll probably schedule that work through our normal sprint planning process.

@ryboe
Copy link
Contributor Author

ryboe commented May 13, 2020

Nope. This is not urgent. It's just a stepping stone to some other PRs I'd like to submit.

@nat-henderson
Copy link
Contributor

Great, in that case I will let this get triaged and prioritized the normal way!

Also simplify `make test` command.
Remove `GO111MODULE=on` and `GOFLAGS=-mod=vendor` env vars, which are no
longer necessary in Go 1.14.
@ryboe ryboe changed the title Upgrade go compiler 1.13.4 -> 1.14.2 Upgrade go compiler 1.13.4 -> 1.14.3 May 18, 2020
Copy link
Contributor

@megan07 megan07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ryboe! Sorry for the delay, we had some other prioritized work ahead of this. But this looks good, thanks for contributing! Would you like to make the same changes to https://github.com/terraform-providers/terraform-provider-google-beta? If you don't have the time, that's fine, please let me know and I will make those changes for you.
Once the changes are in terraform-provider-google-beta as well I will merge this one and take a look at the other PR.
Thanks again!

@ryboe
Copy link
Contributor Author

ryboe commented Jun 1, 2020

Thanks, can you please apply this to terraform-provider-google-beta? I tried to cherry-pick the commit, but couldn't get it to work.

@@ -2,15 +2,13 @@ TEST?=$$(go list ./...)
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=google

GO111MODULE=on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so sorry. As I'm making these changes in beta, I saw this and I wonder if it does any harm leaving this in? I'm thinking in case the current environment already has it set, it might be nice to have this here to override it specifically for this makefile. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I don't think there are too many people who have GO111MODULE=off in their shell configs. That would break too many things. The only time I've seen in set to off is when you're want the old go get behavior, e.g.

GO111MODULE=off go get github.com/foo/bar/cmd/baz

I could be wrong, though.

My preference is to embrace the new default behavior, and let people disable it inline (like the snippet above), but I'll leave it up to you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! We'll try it and if we get any feedback we can always add it back in. That sounds find to me! Thanks!

@megan07 megan07 merged commit aecf30a into hashicorp:master Jun 2, 2020
@ghost
Copy link

ghost commented Jul 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants