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

make v4 the default branch until v5 is stable #266

Open
jdub opened this issue Jun 10, 2020 · 7 comments
Open

make v4 the default branch until v5 is stable #266

jdub opened this issue Jun 10, 2020 · 7 comments

Comments

@jdub
Copy link

jdub commented Jun 10, 2020

Hello again… further to #264,

Due to the way "old" go get resolution works, The v4 branch should be named master until v5 is stable.

Thanks,
Jeff

@vmihailenco
Copy link
Owner

What is broken and what such change would solve?

@jdub
Copy link
Author

jdub commented Jun 11, 2020

Old go get only checks go.mod on the default branch. If the module line contains the version it expects, it will check out and use the default branch as if it is that version.

This is the way the Go devs intend to allow for some non-modules backwards compatibility without having to create ugly versioned subdirectories.

Right now, the default branch is v5 with module github.com/vmihailenco/msgpack/v5. If you change the default branch to v4 (which you could rename to master if you found it neater) with module github.com/vmihailenco/msgpack/v4, then non-modules projects will work as expected… at least while it is the stable version.

(I notice you're juggling branches to test this now – thanks!)

@vmihailenco
Copy link
Owner

It is not clear which Go version is broken - I guess it is something before Go 1.11. We only support last 3 stable Go versions - at the moment that is Go 1.12+.

I don't see the point with juggling with default git branch - that is too unreliable and eventually will be broken anyway. The v5 is the default because

  • PRs should be submitted against v5
  • I want some beta users

@jdub
Copy link
Author

jdub commented Jun 12, 2020

It's not a broken of Go, it's any (relatively recent) version of Go using non-modules resolution. (As you can see from the commit, they backported the change all the way back to Go 1.9.)

Without fixing the default branch, msgpack will be broken for Go users who haven't yet migrated to modules.

(By the way, I don't think this is ideal. But it's the way the Go devs decided it should work.)

@dolmen
Copy link

dolmen commented Jun 24, 2020

So this is about the Git default branch while the the issue text says this is about the naming of the branch (master).

Please fix the issue description as it is misleading (particularly in the context where some projects are moving away from the master name).

I propose: "make v4 the default branch until v5 is stable" as title.

@jdub jdub changed the title v4 branch should be master until v5 is stable make v4 the default branch until v5 is stable Jun 24, 2020
@jdub
Copy link
Author

jdub commented Jul 7, 2020

I have come up with an alternative solution for non-modules users: use gopkg.in/vmihailenco/msgpack.v4 as your import path instead, c.f. honeycombio/libhoney-go#79.

@lizthegrey
Copy link

Unfortunately this doesn't work with go1.12, it fails to build, complaining

go: gopkg.in/vmihailenco/msgpack.v4@v4.3.11: go.mod has non-....v4 module path "github.com/vmihailenco/msgpack/v4" at revision v4.3.11
go: error loading module requirements

See golang/go#33154 (fixed in go1.13+ but not in go1.12)

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