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

v0.45.3 doesn't build with go 1.15 #11684

Closed
4 tasks
crodriguezvega opened this issue Apr 19, 2022 · 8 comments
Closed
4 tasks

v0.45.3 doesn't build with go 1.15 #11684

crodriguezvega opened this issue Apr 19, 2022 · 8 comments

Comments

@crodriguezvega
Copy link

Summary of Bug

The go.mod of v0.45.3 requires go version equal or above 1.15, but building with go 1.15 fails with error:

# github.com/cosmos/cosmos-sdk/x/upgrade/keeper
x/upgrade/keeper/keeper.go:380:9: undefined: "os".WriteFile

It looks like this PR changed ioutil.WriteFile to os.WriteFile, but os.WriteFile was only introduced in go 1.16. The CI that run for that PR used go 1.16, so I guess that's why this went unnoticed.

This problem was found while trying to bump the SDK version in the v1.4.x and v2.2.x release lines of ibc-go (both of them require go version equal or above 1.15)

Version

0.45.3

Steps to Reproduce

  • Check out 0.45.3.
  • Make sure go version is 1.15.
  • make build.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

alexanderbez commented Apr 19, 2022

Interesting. I would think go.mod would catch this somehow? But I guess not. In any case, there's no reason whatsoever to use go 1.15, so just update your go version to 1.17 or 1.18.

We can update v0.45.x to state go 1.17 as a min version. This is what I'd do. Thoughts @AmauryM or @marbar3778 ?

@amaury1093
Copy link
Contributor

We can update v0.45.x to state go 1.17 as a min version.

SGTM.

@tac0turtle
Copy link
Member

SGTM

@crodriguezvega
Copy link
Author

crodriguezvega commented Apr 19, 2022

Sorry, but wouldn't it be easier to just revert this change and put back ioutil.WriteFile? That way you can keep go 1.15 in go.mod, and then ibc-go doesn't need to change its minimum required go version. We are facing this problem in existing release branches (v1.4.x and v2.2.x), so we cannot change the minimum required go version, because that's for us an API breaking change requiring a major version bump.

@alexanderbez
Copy link
Contributor

alexanderbez commented Apr 19, 2022

It's preferable to keep up to date with the latest Go versions. Why would bumping the min Go version require a breaking API change? Unless you're relying on a Go API that broke, e.g. ioutil, then it's not breaking.

@crodriguezvega
Copy link
Author

Because in patch or minor releases our promise with developers/integrators is that they can just swap the version of ibc-go they have without having to change any of their code or environment setup. So if we have, e.g. v1.4.0 with minimum required go version 1.15, and then we release 1.4.1 (with the next SDK 0.45.x) with minimum required go version 1.17, we would be breaking our promise.

@alexanderbez
Copy link
Contributor

But changing the environment is an OK thing to do. The code will operate as expected w/o breaking APIs, which is what semver is about. I'm personally against sticking with 1.15

@crodriguezvega
Copy link
Author

Closed by #11686.

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

No branches or pull requests

4 participants