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

Add experimental support for skipping Ruby install #130

Closed
wants to merge 2 commits into from

Commits on Mar 10, 2023

  1. Add experimental support for skipping Ruby install

    Allows user or another buildpack to set `HEROKU_USE_SYSTEM_RUBY`. This will:
    
    - Skip our logic for installing ruby
    - Trigger a `which ruby` command to run, if it returns non-zero exit the build will not proceed
    - Trigger a `ruby -v` command to run, if it returns non-zero exit the build will not proceed
    - Includes a warning message stating that turning this on effectively disables any guarantees of support
    
    The main driver is allowing for experimentation of replacing a Ruby binary.
    schneems committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    5f1c0a4 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2023

  1. Allow * stacks, add guard, refactor RubyVersion

    ## Allow `*` stacks
    
    As stacks are going away, we can begin to remove the hard requirement that this buildpack only be run with known stacks. To clarify support I added stack detection warning messages.
    
    
    ## Refactor Ruby and Bundler version logic
    
    I've learned a lot since I wrote this original code. I like the way Ed modeled https://github.com/heroku/buildpacks-python/blob/main/src/python_version.rs. 
    
    This refactor allows us to represent the difference between a build where we are responsible for installing Ruby and one where we're not. We need to be able to bust layer caches based on these versions no matter what so I introduced a `RubyCacheKey` which is not guaranteed to also be an installable `RubyVersion`.
    
    The logic in `commons/gemfile_lock.rs` was not great, and it contained structs that seemed like they would better live somewhere else.
    
    Functions in `steps/` for bundler and ruby versions (download and install) were very small logically work better if grouped with their associated version logic.
    
    ## Updated section variables in main.rs
    
    Update variables used for logging runtime duration to match the thing they're measuring. This reads better and helps understand what header is being closed by `done()` calls.
    schneems committed Mar 12, 2023
    Configuration menu
    Copy the full SHA
    6988d42 View commit details
    Browse the repository at this point in the history