Support for bundler binstubs
Describe the Enhancement
Allow us to save a few keystrokes and stop typing in bundle exec on interactive shell sessions.
Possible Solution
Introduce a new bundler-binstubs buildpack that contributes binstubs for all gems installed and pushes them to app's $PATHs. We could start by only pushing them to launch layers unless ppl feel there's a need for them at build time as well.
Motivation
Less typing is always better :smile:
@fgrehm as discussed on Slack, I was wondering if there was a way we could implement this inside of the bundle install buildpack. It would involve running the bundle binstub command for each of the installed launch gems (perhaps if an environment variable is set?). I'm not sure if this would muddy the waters too much of the Bundle Install buildpack's job but it does seem like making the gems available for direct execution would be a part of bundler's job.
Works for me!
Looks like we could do something like bundle binstubs --path={{ .layer.Path}}/binstubs --all around here and layer.LaunchEnv.Prepend("PATH", filepath.Join(layer.Path, "binstubs")) afterwards later in the build
What do you think? That should be enough and we could enable the behavior by setting the BP_BUNDLER_BINSTUBS=true flag
this seems like a valid path forward to me! @paketo-buildpacks/ruby-maintainers feel free to chime in if you have any concerns. I also don't feel like the new environment variable needs an RFC especially because it's not default behaviour, but we should make sure we document it well so people know about it.
we should make sure we document it well so people know about it
Sure! I can make note of it on the README and https://paketo.io/docs/reference/ruby-reference/ :smile:
I'm not too familiar with binstubs but this approach sounds reasonable to me. I don't think it needs an RFC as we have approval (implicit and explicit) from other ruby maintainers to support this optional feature.
I agree with the approach of adding it to bundle-install rather than making a new buildpack - assuming that is possible.