-
-
Notifications
You must be signed in to change notification settings - Fork 390
Update github.com/pierrec/lz4 dependency to module version #192
Conversation
Updates dependency to use github.com/pierrec/lz4/v3 at version v3.0.1. This version is functionally equivalent to the previously specified dependency.
I verified locally that there is no code change between v2.0.5 and v3.0.1, so this should not change any functionality. Ran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thank you for the effort you've spent to improve this! Thanks for helping us stay up to date :)
This seems to break my CI/CD pipelines (using Go 1.13.4), although I'm unable to replicate this locally using the same Go version:
Any ideas? Thanks! |
@finferflu can you provide a link to the project/CI build, or is it internal? Happy to take a look. |
@nmiyake thanks for that, however, I’m afraid it’s a private project that I cannot share publicly. Is there anything else I can provide? I suppose I could provide you with snippets from my pipelines configuration, would that work? Thanks! |
Sure, no problem. One thing that looks a bit suspicious is that the error message seems to be trying to resolve the package using GOPATH mode, when it is actually a module. GOPATH resolution for If you're building a non-module project, then the quickest fix will likely be to pin your dependency for If you want to try to dig deeper/fix the issue with the newest code, knowing the answer to the following would be helpful for trouble-shooting:
|
@nmiyake Thanks very much for the detailed feedback. I'm quite new to Go, so I'm not sure I'll be able to provide you with exhaustive or 100% correct answers. I believe I'm building a non-module project, however, I'm not sure how to pin my dependency to a specific version. That would be the best short-term solution for me at this point as I just need to be able to build my project ASAP. I'm (unfortunately) using Bitbucket Pipelines as the CI system, with the ...
- source bitbucket-pipelines-go.sh
- SRC=$BITBUCKET_CLONE_DIR/src/project
- cd $SRC
- go get -t ./... # this is where it fails
... The export GOPATH=$BITBUCKET_CLONE_DIR
mkdir -p $GOPATH/src/project
mv $BITBUCKET_CLONE_DIR/cmd $BITBUCKET_CLONE_DIR/src/project
mv $BITBUCKET_CLONE_DIR/internal $BITBUCKET_CLONE_DIR/src/project
mv $BITBUCKET_CLONE_DIR/test $BITBUCKET_CLONE_DIR/src/project
mkdir -p $GOPATH/{bin,pkg}
export GOBIN=$GOPATH/bin
go get github.com/tebeka/go2xunit
mkdir $BITBUCKET_CLONE_DIR/test-reports To that file, I've tried to add the following lines, in my attempt to pin the version down to the previous release: GO111MODULE=on go get github.com/mholt/archiver@33320f6f730664f9896b05b777e53ae4c917f572 While that command didn't error out, I got the same error while running I'm unable to provide you with the output of Again, thank you very much for taking the time to respond to my query. |
Thanks for the extra information. If you're not using Go modules (if your project doesn't declare a I've tried a few different approaches, but unfortunately I think the set of circumstances that currently exist will not allow A slightly bigger issue here seems to be that your project doesn't appear to have a defined strategy for managing its dependencies -- even if you fix this issue, if you're depending on a "go get" to populate your GOPATH for dependencies, your build will be very fragile -- you won't be protected at all from possible breaks introduced by dependency updates in the future, and different developers may use different dependencies from each other (and from the build system). In GOPATH mode, most Go projects tend to use a "vendor" directory to manage their dependencies, and often use a dependency management tool like dep to help manage dependency versions. I would recommend the following: (1) Investigate the possibility of building your project as a Go module However, there is a larger issue here of the "go get" in GOPATH mode now being broken for this repository -- I'll file a new issue for that and allow the maintainer to decide how they want to handle this. |
Thanks very much for the detailed response, @nmiyake, it's really appreciated. I think I will go down the route of using a "vendor" directory, as it seems to be the most time-effective solution. Thanks! |
@nmiyake I've actually started using modules and it's worked flawlessly. Thanks again for your feedback. |
This needs to be reverted on master until the lz4 change it depends on is merged into lz4 master branch. |
This updates the module dependency -- the lz4 repository uses an unconventional (but valid) approach where they only add |
Updates dependency to use github.com/pierrec/lz4/v3 at version
v3.0.1. This version is functionally equivalent to the previously
specified dependency.