-
Notifications
You must be signed in to change notification settings - Fork 143
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
The latest commit (move stuff to v2) breaks package with go 1.10 and earlier #33
Comments
Modules are not supported by go versions < 1.10. |
Ok, that helped. Would be cool to have a mention of it somewhere :) |
@pierrec I understand your point, but I still would like to point out that this is a breaking change for anyone not running 1.10, or using modules, or doing plain go get instead of using dep, glide, etc. Could you please point out what would be the directions for everyone not ready to use modules? |
Actually I'm also getting the same error with go version go1.10 linux/amd64 |
Building Shopify/sarama now fails because go get github.com/pierrec/lz4 fails. I also run go1.10 |
Works with 1.11 |
Yup, fails with 1.10, works with 1.11. The sad thing is that AWS CodePipeline doesn't have golang image for 1.11 yet, so I'm only left with 'dep' here. Which is not a bad thing. |
Mac pro with golang1.11 failed in
|
Facing the same issue with Go 1.9 . How to solve ?
|
Sorry about the inconvenience. Working on a fix ASAP. |
For everyone doing plain go get, this was the workaround I've done while a fix is being developed: git clone -b 'v2.0.4' --single-branch --depth 1 https://github.com/pierrec/lz4.git $GOPATH/src/github.com/pierrec/lz4 |
As per https://github.com/golang/go/wiki/Modules#semantic-import-versioning: Since option 1 is not practicable (older releases of go may still be in use), and I don't think option 2 is satisfying, I believe that the change needs to be reverted. |
Option 2 is not bad. openzipkin/zipkin-go-opentracing fails due to reason that it cannot find package "github.com/pierrec/lz4/v2/internal/xxh32" |
FYI: The change also breaks 1.10.1-r0 in alpine |
If you change the default branch to v2.0.4 I think go get will check out the default branch and it will work until everyone is on go modules. |
this is breaking our build, what needs to happen here for golang1.9? |
@myusuf3 You need to upgrade 1.9 to 1.9.7. I have tested it successfully with this pkg at its current state. If no one objects to it, I will roll back the module support for now, until everyone is on a version of go that supports modules (that is 1.9.7+, 1.10.4+, 1.11 as we speak). Knowing when that happens may prove a challenge though... |
@pierrec is there a way you can apply the module update and not have the v2 in the import path? This way, both old and new go versions will be pleased. |
@slaterx this is what I have tried to figure out without luck. Changing the import path by suffixing it with the version (if that version is > 1) is the way it is implemented in go modules. |
I think the idea behind the major version number changes is that you increment from 1->2 when you have breaking changes in the library. This allows you to depend on versioned APIs github.com/blah/blah/v2 etc... In the case of this library, I think you can remove the /v2 from the end of the module path in go.mod. Yes your release version says v2.0.0 but I think it will still carry on working. If, down the road, you want to make breaking changes to the library, I would probably create a v3 branch and change the module to say /v3 at the end.. There would be no /v2 import path for this library in that case. The default import would be v2. All commits would go to the v3 branch and the release tag would point to that branch which is what go modules would use to find the right code. I'm just guessing here, but I'm pretty sure that's what needs to be done to get us all working again. |
@snowzach I think you have found the right solution. Testing it locally works for old versions of go as well as new ones that do support modules. |
Closing. |
I don't think that works. See https://golang.org/issue/25967#issuecomment-422828770 and golang/go#28336. |
Everything is in the name.
The text was updated successfully, but these errors were encountered: