Skip to content
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

Support for bundler binstubs #836

Open
fgrehm opened this issue Sep 23, 2022 · 5 comments
Open

Support for bundler binstubs #836

fgrehm opened this issue Sep 23, 2022 · 5 comments

Comments

@fgrehm
Copy link

fgrehm commented Sep 23, 2022

Slack thread

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 😄

@sophiewigmore
Copy link
Member

@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.

@fgrehm
Copy link
Author

fgrehm commented Sep 29, 2022

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

@sophiewigmore
Copy link
Member

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.

@fgrehm
Copy link
Author

fgrehm commented Sep 30, 2022

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/ 😄

@robdimsdale
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants