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

Golang 1.17 upgrade #15

Merged
merged 4 commits into from
May 9, 2022

Conversation

Eric-Warehime
Copy link
Contributor

Migrate writing build headers from //+build to //go:build.

This change was made in go1.17 which means it will be backwards incompatible with anything older than that. I have go upgrades for all of go-sdk, go-algorand, and indexer in PR so that shouldn't be a problem.

I also removed all of the _generated tests from the Makefile since they cause make test to fail.
Additionally, I've added coverage output and a unit test for the function I've updated which is currently uncovered (possibly because the _generated tests no longer work.

Copy link

@winder winder left a comment

Choose a reason for hiding this comment

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

Seems fine, I just have a couple questions.


require (
golang.org/x/mod v0.2.0 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
Copy link

Choose a reason for hiding this comment

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

Why is this in a separate require block? did go mod tidy create it this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it was from running tidy. I left it that way since I liked the fact that direct deps were being separated from indirect. Not aware of whether this is a convention or something we don't do in other repos.

@@ -4,8 +4,6 @@
# Installation can still be performed with a
# normal `go install`.

# generated integration test files
GGEN = ./_generated/generated.go ./_generated/generated_test.go
Copy link

Choose a reason for hiding this comment

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

What was the failure that made it so this needed to be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assume there will be a lot of them. The code these tests use was ripped out. For example, https://github.com/algorand/msgp/blob/master/_generated/convert_test.go#L13
uses https://github.com/tinylib/msgp/blob/43b487371e0cdd1a3fe1be9a7802d8bce917a1af/msgp/write.go#L118 from the original repository which was removed from our fork in this commit 546fb5f

Copy link

@winder winder left a comment

Choose a reason for hiding this comment

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

LGTM, assuming you're able to generate the desired code on go-algorand let's go ahead and merge. We'll need to create a tag on this repo and update go-algorand to use the new version.

printer/print.go Outdated Show resolved Hide resolved
@Eric-Warehime
Copy link
Contributor Author

I tested that the generated */msgp_gen_test.go files using this commit match what is in PR in algorand/go-algorand#3919

Going to merge this in and create tag v1.1.51 for go-algorand to use.

@Eric-Warehime Eric-Warehime merged commit 998a2ac into algorand:master May 9, 2022
@Eric-Warehime Eric-Warehime deleted the golang-1.17-upgrade branch May 9, 2022 20:23
@cce cce mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants