Skip to content

Comments

go.mod: update minimum version to go1.17#64

Merged
jeffwidman merged 1 commit intovishvananda:masterfrom
thaJeztah:update_minimum_go_version
Jan 13, 2023
Merged

go.mod: update minimum version to go1.17#64
jeffwidman merged 1 commit intovishvananda:masterfrom
thaJeztah:update_minimum_go_version

Conversation

@thaJeztah
Copy link
Contributor

golang.org/x/sys now requires go1.17 as a minimum, and otherwise fails:

Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall.go:83:16: undefined: unsafe.Slice
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:2256:9: undefined: unsafe.Slice
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice

unsafe.Slice was added in go1.17; https://pkg.go.dev/unsafe#Slice

Now that go1.17 is the minimum version, we cal also replace the deprecated io/ioutil package (which was deprecated in go1.16).

golang.org/x/sys now requires go1.17 as a minimum, and otherwise
fails:

    Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall.go:83:16: undefined: unsafe.Slice
    Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:2256:9: undefined: unsafe.Slice
    Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
    Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice

unsafe.Slice was added in go1.17; https://pkg.go.dev/unsafe#Slice

Now that go1.17 is the minimum version, we cal also replace the deprecated io/ioutil
package (which was deprecated in go1.16).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@jeffwidman
Copy link
Collaborator

Oh interesting, I was looking at golang/sys@0981d60 when I merged #58:

Note that this does not prevent users with earlier go versions from successfully building packages from this module.

Didn't consider the fact that newer stuff would creep in.

@jeffwidman
Copy link
Collaborator

jeffwidman commented Jan 13, 2023

I looked at dropping us back to v0.1.0, but even that still uses unsafe.Slice(): https://github.com/golang/sys/blame/v0.1.0/unix/syscall_unix.go#L118

Since old versions of this lib continue to work just fine, I'm 👍 on dropping support for go < 1.17 and will make our lives a little easier going forward... rather do that than revert all the way back to a non-tagged version.

@jeffwidman jeffwidman merged commit 9e0c817 into vishvananda:master Jan 13, 2023
@thaJeztah thaJeztah deleted the update_minimum_go_version branch January 14, 2023 10:45
@thaJeztah
Copy link
Contributor Author

Since old versions of this lib continue to work just fine, I'm 👍 on dropping support for go < 1.17 and will make our lives a little easier going forward... rather do that than revert all the way back to a non-tagged version.

Yes, I agree. Dropping < 1.17 seems very reasonable to me. I'm happy to see more activity again on this project (although the lack of activity but it being used by various important projects, without much issues, also shows that "lack of activity" isn't necessarily bad: perhaps it's just "mature and stable")

I think we have a "fairly good understanding" who the consumers are of this module; https://grep.app/search?q=github.com/vishvananda/netns

While that list may not be fully accurate, it's still a fairly short list. There will be many other projects getting it as indirect dependency, but I think most of the direct consumers are already requiring more current Go versions for other reasons. If there are issues with dropping < 1.17, I expect those projects to let that know. It's a small world; most of those projects are familiar with each other, and will know who to reach out to.

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.

2 participants