-
Notifications
You must be signed in to change notification settings - Fork 170
ChefDK should ONLY include git on windows #854
Comments
If we want to ship it on mac/linux it should be in the |
Would it make sense to include a shim that just calls the system git if it is an acceptable version, or the embedded git if the system git is not acceptable or not found? That way if someone doesn't use the ChefDK on a platform it won't mess anyone else up, while still providing an "override" for those that have the embedded bin in their path and don't have git or have such an old one that causes problems. Make sense? To be clear, the shim would be in the embedded bin directory also, so it would only use the system git if the PATH wasn't set to use the embedded bin directory, and even if it was would prefer the system git if it exists and is "acceptable." |
@chilicheech To help me understand your issues, what customizations have you made to @coderanger You are correct that |
@tyler-ball It is super unexpected that installing ChefDK would take over what version of git I'm running. On Windows it is an understandable convenience, but for Linux and OS X it is more likely to be a hindrance than a help. |
@tyler-ball we should take embedded/bin out of the PATH -- see #313 and #682 |
I would be fine with this is @tyler-ball
|
we need it first in the path so that we pick up our ruby first. the point of #313 is to move the ruby to /opt/chef/bin and put that first, then eliminate embedded/bin entirely. then if users don't want that, they should not use |
Why not just have the chef shim have a custom shebang similar to |
I too was surprised by this on Ubuntu Linux when I installed the latest ChefDK and ran into:
I worked around this by adding an alias to my |
Thanks for the workaround, @TonyFlint I was also very surprised by this behavior. I'd like to see this changed so I have control over my git version. |
A heads-up: We're working on fixing this, but it didn't get done in time to make the June ChefDK 0.15.x release. The fix will be included in the July release. |
Scenarios we want to still work if we go with @lamont-granquist's solution:
|
|
@charlesjohnson RVM + ChefDK is not remotely deadly poison any more than rbenv or chruby. The whole point is to fix the bad design decisions that initially split up the ruby+binstubs which confused rvm/rbenv/chruby needlessly. And I really think we need to think through the behavior of installing gems over the top of chef-dk and make it behave as close as possible to vanilla ruby, or at least minimize the amount of surprise. The entire root of this problem I think is that we're trying to engineer chef-dk to be 'different' which just leads to frustrated users, and us explaining how people can't do what they're trying to do because $REASONS. That is all incredibly poor UX. If we don't do this now we just kick the can down the road. And I'm really throwing down that we absolutely need to support the use case of slurping up /opt/chefdk/bin into rvm/rbenv/chruby just like it was a hand-built ruby install. The binary needs to be in there and the binstubs need to be in there so that switching just works. Since those users will not be running And we have always stated that using chef-dk as your ruby was supposed to be OPT-IN, it never was supposed to be the ONLY way to use chef-dk, but that alternative has always been broken which is what led to #313. We need to fix that bug, and we need to fix the embedded/bin bug, and the two things are very related and therefore need to be engineered together, otherwise we'll just wind up doing a bad job and having to fix this twice. |
Running |
I need to setup a VM to test what |
I'm an RVM user myself and would prefer to deal with the breaking change before 1.0 of ChefDK with the suggestions from @lamont-granquist to keep ruby environments from clashing with each other. I'd rather the chef universe be separate from my other environments so when installing gems into ChefDK they stay there and don't get mixed in with other environments, creating headaches for my team. Much of my team uses some kind of ruby environment switcher so if it could be compatible that would be much nicer overall. Do post your results of testing @tyler-ball because it may be helpful. I know another long-standing rubygems bug with Gemfiles is still out there and not resolved yet either. This bug can easily be triggered by ChefDK's current setup too if you happen to mix in a Gemfile with your cookbooks or Chef repo. |
@tyler-ball correct, some other things i thought about late yesterday: really what we're doing here is just engineering ruby-switching to work correctly. and what we're offering is either BYORS (bring-your-own-ruby-switcher: rvm, rbenv, chruby) or else use ours ( the i'm actually not sure we should worry too much about what happens to appbundled binaries when users do something like: rvm mount /opt/chefdk/bin/ruby -n chefdk
rvm use chefdk
rvmsudo gem install chef if so, i think it will all just work without being too surprising for anyone if we go down this road. |
and yeah, lets get this done while we still have the leading zero in the version number to hide behind. |
While I'm convinced the difference between 'embedded/bin' and 'bin' is a valid issue, it's also grown too big for a comment thread on an unrelated issue. We need a dedicated issue to scope this and understand the ramifications. Meanwhile, I need to re-focus this issue onto "Let's not put git into the path on non-windows hosts when |
Yes, but you have git in the path because we want to put ruby in the path, so that tightly couples the two issues together. Trying to isolate them is going to lead to bad engineering, or duplicated effort down the road. What we don't need to do is something like move everything other than ruby out of /opt/chefdk/embedded/bin to some other directory, and then later wind up moving ruby to /opt/chefdk/bin and now there's nothing in /opt/chefdk/embedded/bin which will be hugely confusing end state caused by only solving the problem in front of us. I understand you're trying to decouple tasks and project manage, but I'm convinced that will lead to substantially worse outcomes and much more work and much more confused users than just dealing with the holistic problem up front. |
This fix will go out in the |
ChefDK is embedding
git
on the OSX version even though the changelog says:Include git on windows.
referring to PR #814 ..As a user of ChefDK on OSX I run
brew install git
and make my customizations to it. I havechef shell-init
in my .bashrc so thatruby
,rake
,bundler
,foodcritic
, and others are available in my path and I don't have to prefix those commands withchef exec
.Please remove the embedded git from the OSX and Linux installers and keep it only on Windows as was the intention of PR #814 ..
The text was updated successfully, but these errors were encountered: