Move install of dev tools from Makefile to a script#1811
Move install of dev tools from Makefile to a script#1811crosbymichael merged 1 commit intocontainerd:masterfrom
Conversation
|
Overall, the goal with this is to make the Makefile smaller. Remove bootstrap and setup scripts from the Makefile so that it is easier to reason about and maintain. |
66ae233 to
abc2027
Compare
Codecov Report
@@ Coverage Diff @@
## master #1811 +/- ##
=======================================
Coverage 47.33% 47.33%
=======================================
Files 91 91
Lines 8964 8964
=======================================
Hits 4243 4243
Misses 4022 4022
Partials 699 699
Continue to review full report at Codecov.
|
|
LGTM |
|
Not against the change, but I think it makes it harder to find dependencies, would vote for adding a |
|
I don't think we should pin dependencies for build tools. It too often leads to out of date build tools and removes the impetus for upgrading build tools and/or processes. The effect here is that developers that use containerd have no choice but to use this tool to install the containerd build dependencies, rather than using what is in their particular environment. If we do pin these deps, I'd prefer they be pinned through the vendor folder (per the TODO, that is getting removed here: "Install these from the vendor directory"). |
Sounds reasonable to me. While it probably does make it a bit harder to find I still think it's an improvement. Currently dependencies are scattered across a bunch of files: There is currently a |
SGTM, cheers. What's left in this PR is getting the values from the vendor.conf or defaulting to tip as per @stevvooe request then. |
What makes you think this is the case? Developers are free to use what they want. If they use some arbitrary version of a tool it may fail because the behaviour is different. So they are left trying to guess at what version they need. By pinning dependencies we make it explicit which version works, but it doesn't force anyone to use that version. If they have a version that works great! If they don't, they now have a convenient way to install a version that works. If they're new to the project and don't have any tools yet it's much easier for them to get started. I think it's important that people can use their own tools. #1819 should be careful to mention that the Without pinned versions the build could fail at any time when a tool decides to add new rules, or change behaviour.
I don't see how that is workable.
Dependency tools (
|
|
@dnephin can we just get the revision to build from out of |
|
It's possible, but why would we want to do that? All I see are disadvantages. It makes it more difficult to prune unused things from It may actually make running In |
|
@dnephin The main problem with this change is that it assumes that the Makefile owns GOPATH. It should not. There should be no mention of GOPATH. It should not checkout anything in GOPATH. GOPATH should be a passthrough to the underlying Go toolchain and that is it. This is a huge problem when developing moby and I don't want to replicate it here. Setting up the tools is a two second problem when you first develop then you never worry about it again. If the tool changes, it takes two seconds to fix the build or remove the tool. I really don't want to have a bomb buried in a Makefile twiddling the GOPATH without a care in the world. It just doesn't make sense to 10x the complexity to solve a problem that doesn't exist. The current build is a trade off for allowing many kinds of development environments, including those that actually follow How to Write Go Code. When we add things that make it "easier", it makes it harder to manage deps when you follow that approach. Yes, the build tools aren't pinned, but sacrificing simplicity of development environment is not a good trade off. |
What do you mean by "owns" ? Nothing in this PR sets A script does read
That is exactly what it's doing. I could use
There is nothing in this PR that should make anything more complex, or make https://golang.org/doc/code.html harder to follow. |
abc2027 to
5cbfc07
Compare
|
Updated to use |
|
ping @stevvooe does that work for you now? |
|
If the issue is that the script installs things into GOPATH/GOBIN, another alternative is to have the script use a tmpdir as the GOPATH (which it removes after it builds), and accept a positional arg for the install path. That way it's up to the user to tell it where to install, and it would touch GOPATH it all. |
|
Installing to GOPATH is fine, but checking out a project to a detached state is a problem if there is a local change. Either the script breaks due to the local changes or it overwrites them somehow (either stashing or force). I'm still against locking down dev tools. This will stagnate the build environment and let issues fester if we don't address them. Upgrading the build tools becomes a hindrance. |
|
I'm fine with always installing them from master. Especially since this is only used on CI, it'll force us to keep up. |
There was a problem hiding this comment.
Add -u so that it updates if it is already present.
There was a problem hiding this comment.
You can do the above or just use go get -u $pkg here.
There was a problem hiding this comment.
Actually, you'll need go get -u $pkg/...
Signed-off-by: Daniel Nephin <[email protected]>
5cbfc07 to
cc9216c
Compare
|
Doesn't Anyway, I've removed the version pinning. This is now just a |
|
LGTM
It doesn't cause any destruction. These scripts tend to lack discipline, so we can't say the same for them.
Which ones? |
|
LGTM |
cc @crosbymichael
With this change dependencies will be pinned to a specific sha instead of using latest.