-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Is there a deterministic way of checking whether bundle exec is necessary? #486
Comments
All except That big an overhead for |
I see, that's exactly the answer I was looking for. What if we were using postmodern's Sure, I'll file an issue there. I first noticed this when someone else mentioned it happening with them as well in an attempt to improve rubocop boot time. |
IMHO gemset tools are pretty much useless nowadays. Having a dedicated gem_home for an app to avoid bundle exec would only work if you wipe out the entire gem home every time you update a gem in Gemfile/Gemfile.lock and then reinstall everything, and only if there are no extra gems installed in the default gem home. Basically, very messy and won't be practical I think. It would also not work if the a default/bundled gems of that Ruby is more recent than what you use (would pick that version instead). |
It might be possible to check if I've been using this bash alias to selectively make certain common executables "bundle aware". It would be nice if rubygems handled this automatically in it's own binstubs which are generated when you install a gem with executables. |
yeah, I'm trying to avoid I went from greater than 2s running rubocop on 1 staged file to 190ms (with some other tweaks), but Maybe instead of trying to genericize for all commands, I'll write a specific wrapper for Rubocop. If the Rubocop server is running, then the files have been loaded already and there shouldn't be a need for |
Sort of related to #433, I've recently found out that
bundle exec
adds a significant amount of time to commands as opposed to the naked command when the binstub doesn't exist. This is especially important when running linters as a pre-commit hook.I posted on lefthook's discussion board about this, but our team mostly uses
chruby
in local environments because it's in our onboarding guide, and y'all seem to more likely to know the answer to this: is there a deterministic or even near-deterministic way of checking whetherbundle exec
is necessary?I came up with this pretty naive
exec-wrapper
script:rubocop --server ...
bin/exec-wrapper rubocop --server ...
chruby-exec 3.1.2 -- rubocop --server ...
bundle exec rubocop ...
I would like to commit this pretty significant quality of life change, but I don't want to break anyone's machine by missing something in this script.
The text was updated successfully, but these errors were encountered: