-
Notifications
You must be signed in to change notification settings - Fork 1k
installing development tools #221
Comments
I've been thinking about this one lately. We had a CI dependency which was being pulled with |
This could solve that, but in the longterm there could be other solutions. Assuming The thing I find odd about my suggestion here is that At least with |
First, there's two cases here to delineate:
(I talked in greater detail about this difference in this glide issue: Masterminds/glide#418 (comment)) We have to separate these cases because only the former demands some way of signaling to the solver that a main package be incorporated when computing the depgraph. (Being So, that's the first bit. The second is what you're directly interested in - fetching and building a supporting tool. I do believe this is an important feature to include, but it also significantly expands scope. Right now, dep deals strictly with the management of source code - it does not touch compilation or binaries, at all. Also, you've noted, this is basically just a more version-aware reimplementation of Basically, while discussion now is ofc fine, before really moving on any implementation we need to wait for #154 :) And we're working on it! |
npm does put a .bin folder under its vendor folder. Its great thing because if a project rely on some binaries, it matters that the version remains consistent across all the builds. |
Npm adds node_modules/.bin to PATH when running scripts in package.json (https://docs.npmjs.com/misc/scripts#path) using npm run. The other common solution is to install a tool globally and also install it locally as a dependency of the package. The two versions might be wildly different, so if you invoke the global version (which is in your PATH), it'll complain but still run (gulp does this), or the global version is smart enough to load the local version instead. There's a helper library for the latter: https://github.com/js-cli/js-liftoff |
Fyi, there are some concerns over security with a global bin path. https://groups.google.com/forum/#!topic/golang-dev/fZ_maFYY9nU |
lets summarize, q1
I can t really understand that. Should unreasonable behaviors be a stop to the creation and delivery Said differently, cars can kill, but people still uses it, irl the benefit is larger than the risk. q2
This is a pure problem of setup, i don t see what prevent I might be missing enough vision about those two Qs, A real question, to me, is how to avoid naming collision. Regarding this thread, if no special strategy is applied to I m sure and certain that collisions will happen, On the other side of the coin, if we d include the One idea is to not install those binaries into an accessible folder to PATH,
Where
|
Interesting: https://github.com/twitchtv/retool |
Just wanted to post the tool here that I've been working on to solve this at my company which integrates with dep: https://github.com/GetStream/vg After installation you can run |
I wrote something that helps with this: https://github.com/vektah/gorunpkg The idea is rather than installing you just check the code out in vendor, then use
gorunpkg will resolve the package, first looking in vendor, then in your gopath, build, and run, without installing globally. This is closer to how npm/composer/etc work by being able to run binaries out of ./node-modules/.bin/ in the version defined in the lock. The problem ive hit is because go dep only looks at imports there is no way to add |
So if I want to install testify (but only on dev version, since I don't test it on production), is there a way to do that with dep (like npm's devDependencies)? Is this issue being worked on? Can I help with anything? |
retool, gorunpkg, vg are neat and all, but this is something that a modern package manager is reasonably expected to handle, without requiring yet another external tool to accomplish this, and of course yet another set of shell commands to actually get retool/gorunpkg/vg installed themselves! Cabal has solved this. Ruby has solved this with Bundler. NPM has mostly solved this with I wouldn't even mind global collisions between |
Now we only need a postinstall or something like that. |
@kevinburke why was this closed? Has it been decided that We use code generation in a few places and I agree that it would be nice to vendor and manage these with |
One thing the import graph doesn't provide is an easy way to install the tools used to work with a particular project.
Maybe this is worth considering as a future enhancement to dep. A list of dependencies in the manifest that aren't imported, but have binaries that the project uses.
In projects I've worked on, this is just a sequence of
go get
commands in a Makefile, which certainly is good enough if something like this isn't warranted.slightly related to #220
The text was updated successfully, but these errors were encountered: