-
Notifications
You must be signed in to change notification settings - Fork 8
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
Binary order is incorrect #380
Comments
@schneems For Python I ended up changing the layer name to get the ordering I needed (and have integration test coverage of the (Also, prior to an upstream fix the |
Note that this places `/layers/heroku_ruby/gems/bin` before `/layers/heroku_ruby/binruby` on the path. Related to, but doesn't entirely fix #380.
It's common and expected that Rails applications will include a `bin` directory containing "binstubs" of executables their app depends on. For example https://github.com/heroku/ruby-getting-started/tree/5e7ce01610a21cf9e5381daea66f79178e2b3c06/bin. They're largely used to ensure that bundler is invoked/used so that you can run `bin/rails` rather than needing to use `bundle exec rails`. However it's not strictly limited to only that. This change: Adds the `bin` folder in the root of the workspace to the PATH and changes the layer to `venv` so it is loaded after other layers (and takes precedence in the case of a PATH prepend). This fixes the previously committed failing test. Close #380
Note that this places `/layers/heroku_ruby/gems/bin` before `/layers/heroku_ruby/binruby` on the path. Related to, but doesn't entirely fix #380.
It's common and expected that Rails applications will include a `bin` directory containing "binstubs" of executables their app depends on. For example https://github.com/heroku/ruby-getting-started/tree/5e7ce01610a21cf9e5381daea66f79178e2b3c06/bin. They're largely used to ensure that bundler is invoked/used so that you can run `bin/rails` rather than needing to use `bundle exec rails`. However it's not strictly limited to only that. This change: Adds the `bin` folder in the root of the workspace to the PATH and changes the layer to `venv` so it is loaded after other layers (and takes precedence in the case of a PATH prepend). This fixes the previously committed failing test. Close #380
Report
Expected: If I put a version of rake in a
Gemfile.lock
then I should get that same version when I run my app.Actual: Using this app https://github.com/heroku/ruby-getting-started/blob/5e7ce01610a21cf9e5381daea66f79178e2b3c06/Gemfile.lock#L188
Using the Ruby getting started guide running
rake
fails because it loads the version that ships with Ruby rather than the version installed via bundlerWhile technically
bundle exec
will fix it, it's not the root cause and is different between the two:Classic
The binstubs take ultimate precedence
In addition, it doesn't put the original location of the binaries on the path, instead it symlinks the binstub directory to these location:
Notes
In CNBs the spec says that naming is the only mechanism (at this time) to control ordering https://github.com/buildpacks/spec/blob/f3fd7555c8320a9da8101f52e6e952e9679fa150/buildpack.md#L773
We can rename layers to adjust their order, however, layer names are visible to end users so it is awkward to have a layer like
zgems
. It's also worth noting that "alphabetically ascending" is not a rigorous specification layer names are not limited to ASCII characters https://github.com/buildpacks/spec/blob/f3fd7555c8320a9da8101f52e6e952e9679fa150/buildpack.md?plain=1#L592-L593 so it's possibly an implementation dependent concern. (though ASCII character ordering a-z is likely very consistent).Moving forward
./bin/
binstubs to the path, this should be loaded last (takes precedence). We could call this something likeuser_binstubs
ruby
tobinary_ruby
.GUS-W-17544084
The text was updated successfully, but these errors were encountered: