Chef and $PATH manipulation


#1

So a bug that ended up being somewhat unrelated brought up a question today: is it still a good idea to be adding the Ruby bindir and gemdir in out path sanity handling? How many places is it actually a good idea for a run-of-the-mill shell_out to call something in either of those folders? The two we could think of were using tar.exe for cookbook downloads on Windows (which needs to be ripped out because it keeps breaking) and possibly running the erubis CLI tool for template syntax checks. Are there are other places where this is happening? And more importantly, could we put those behind some kind of chef_internal flag on shell_out?


#2

For reference, that behavior was added in https://github.com/chef/chef/commit/4add85de44b70016a32cc29e1fdf1591460c60d6 around the time of 0.10.10. That commit references https://tickets.opscode.com/browse/CHEF-2681 which is specifically about the erubis thing. If that is the only place we need this, we can probably use a more fine-grained solution :slight_smile: