-
Notifications
You must be signed in to change notification settings - Fork 105
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
Enable Go Modules for tool dependencies #65
Conversation
ff7fb3e
to
d4a3511
Compare
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.
@itchyny The idea looks good but make credits
stops working.
tools.go
Outdated
_ "github.com/Songmu/gocredits" | ||
_ "github.com/golang/mock/mockgen" | ||
_ "github.com/jessevdk/go-assets-builder" | ||
_ "github.com/jpillora/go-tcp-proxy" |
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.
It looks that this breaks make credits
because it lacks license file. Should we somehow exclude license files of tools since they are not included in the generated binary?
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.
It's better to include in the CREDITS file even if it is a tool dependency. I just opened jpillora/go-tcp-proxy#13 and wait for the information.
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.
I understand that tool dependencies should be listed but I don't think tool (or test library) licenses should be included because we are not redistributing them. Including them might be even misleading to users.
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.
Okay, but we can't distinguish them from single go.mod file so maybe we can either
- create
_tools/go.mod
and always change the working directory to_tools
on installing them inMakefile
- or change the working directory to a temporary directory (or just
cd &&
which I often use in my project) and give up locking the versions of tools dependencies.
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.
_tools/go.mod
sounds good.
d4a3511
to
751df59
Compare
751df59
to
04e9c72
Compare
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.
@itchyny LGTM
Thank you. |
Currently the Makefile disables Go Modules for tools but this is dangerous. Many Go tools are tested locking their dependencies with Go Modules. But disabling Go Modules on installing them can break easily when the tools' dependencies are updated without compatibility in the master.
See https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module.