Git Product home page Git Product logo

Comments (23)

pierrec avatar pierrec commented on June 6, 2024 9

Sorry about the inconvenience. Working on a fix ASAP.

from lz4.

slaterx avatar slaterx commented on June 6, 2024 3

@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.

slaterx avatar slaterx commented on June 6, 2024 3

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.

deberth avatar deberth commented on June 6, 2024 2

Actually I'm also getting the same error with go version go1.10 linux/amd64

from lz4.

pierrec avatar pierrec commented on June 6, 2024 2

@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.

kjelle avatar kjelle commented on June 6, 2024 1

Building Shopify/sarama now fails because go get github.com/pierrec/lz4 fails.

I also run go1.10

from lz4.

pierrec avatar pierrec commented on June 6, 2024

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.

laurikoobas avatar laurikoobas commented on June 6, 2024

Ok, that helped. Would be cool to have a mention of it somewhere :)

from lz4.

deberth avatar deberth commented on June 6, 2024

Works with 1.11

from lz4.

laurikoobas avatar laurikoobas commented on June 6, 2024

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.

xxx7xxxx avatar xxx7xxxx commented on June 6, 2024

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.

mundrapiyush avatar mundrapiyush commented on June 6, 2024

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.

pierrec avatar pierrec commented on June 6, 2024

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.

dayadev avatar dayadev commented on June 6, 2024

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.

nvnobelen avatar nvnobelen commented on June 6, 2024

FYI: The change also breaks 1.10.1-r0 in alpine

from lz4.

snowzach avatar snowzach commented on June 6, 2024

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.

myusuf3 avatar myusuf3 commented on June 6, 2024

this is breaking our build, what needs to happen here for golang1.9?

from lz4.

slaterx avatar slaterx commented on June 6, 2024

@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.

pierrec avatar pierrec commented on June 6, 2024

@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.

snowzach avatar snowzach commented on June 6, 2024

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.

pierrec avatar pierrec commented on June 6, 2024

@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.

pierrec avatar pierrec commented on June 6, 2024

Closing.

from lz4.

bcmills avatar bcmills commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.