Comments (23)
Sorry about the inconvenience. Working on a fix ASAP.
from lz4.
@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?
from lz4.
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
from lz4.
Actually I'm also getting the same error with go version go1.10 linux/amd64
from lz4.
@myusuf3 You need to upgrade 1.9 to 1.9.7. I have tested it successfully with this pkg at its current state.
@nvnobelen yes, anything 1.10 before 1.10.4 breaks because of having v2 in the import path.
@dayadev option2 would work but I dont think it is nice in the long run.
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...
from lz4.
Building Shopify/sarama now fails because go get github.com/pierrec/lz4 fails.
I also run go1.10
from lz4.
Modules are not supported by go versions < 1.10.
For go 1.9, you need to use this package version 2.0.4.
from lz4.
Ok, that helped. Would be cool to have a mention of it somewhere :)
from lz4.
Works with 1.11
from lz4.
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.
from lz4.
Mac pro with golang1.11 failed in glide install
with https://github.com/Shopify/sarama
.
[ERROR] Error scanning github.com/pierrec/lz4/v2/internal/xxh32: cannot find package "." in:
/Users/longyun/.glide/cache/src/https-github.com-pierrec-lz4/v2/internal/xxh32
from lz4.
Facing the same issue with Go 1.9 . How to solve ?
> ../../../github.com/pierrec/lz4/reader.go:9:2: cannot find package "github.com/pierrec/lz4/v2/internal/xxh32" in any of:
> /usr/local/go/src/github.com/pierrec/lz4/v2/internal/xxh32 (from $GOROOT)
> /home/dca-api/src/github.com/pierrec/lz4/v2/internal/xxh32 (from $GOPATH)
from lz4.
As per https://github.com/golang/go/wiki/Modules#semantic-import-versioning:
either we use a module compatible go version (1.9.7+, 1.10.4+ or 1.11+) or create a v2/ subdirectory.
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.
Thoughts?
from lz4.
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"
from lz4.
FYI: The change also breaks 1.10.1-r0 in alpine
from lz4.
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.
from lz4.
this is breaking our build, what needs to happen here for golang1.9?
from lz4.
@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.
from lz4.
@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.
The only option that preserves both sides is copying everything over to a v2/ subdirectory. This means duplicating all the code and having a v3/ if one comes out, which I am reluctant to do.
Still thinking over it.
from lz4.
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.
from lz4.
@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.
Thanks!
from lz4.
Closing.
from lz4.
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.
I don't think that works. See https://golang.org/issue/25967#issuecomment-422828770 and golang/go#28336.
from lz4.
Related Issues (20)
- Write after Flush writes 0 bytes, no error because state is closed.
- Java compress data can not be decompress HOT 5
- lz4 reader read block until buf is full? HOT 5
- Data race when using concurrency > 1
- [RSVP] What is the source of xxh32zero.go? HOT 2
- lz4: invalid source or destination buffer too short HOT 3
- jsonlz4: lz4: invalid source or destination buffer too short HOT 1
- I got error 403 HOT 1
- avoid uncompressed duplicates in testdata to make module smaller
- commit bc1239b broke decompressing legacy-compressed bytes in normal mode HOT 1
- Dictionary support in compression HOT 1
- [arm64] Performance regression from removal of 4x loop decoding HOT 2
- .unity3d lz4 compression and decompression HOT 1
- Invalid magic number when decompressing. Headers not added when compressing
- when i use lz4 compress and java use lz4 uncompress HOT 2
- Reader oriented encoder HOT 3
- CLI: Only compression level 0 supported, others give error "lz4: invalid compression level: 1" HOT 3
- Uncompressing quite slow in sparsely compressed data HOT 2
- Help decoding a lz4 block format HOT 4
- Slower than Snappy for smaller sizes. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lz4.