Skip to content

Remove ruby-install dependency and build from Ruby source #5

@calebhailey

Description

@calebhailey

In the end, the trick which made this work was a Ruby make configure flag called load-relative which causes ruby to resolve load paths at runtime (dynamically): https://github.com/ruby/ruby/blob/d48783bb0236db505fe1205d1d9822309de53a36/configure.ac#L145-L147

The ruby-install project does provide some niceties in the form of features (and anti-features) as it describes in its readme:

## Features

* Supports installing arbitrary versions.
* Supports downloading the latest versions and checksums from [ruby-versions].
* Supports installing into `/opt/rubies/` for root and `~/.rubies/` for users
  by default.
* Supports installing into arbitrary directories.
* Supports downloading from arbitrary URLs.
* Supports downloading from mirrors.
* Supports downloading/applying patches.
* Supports specifying arbitrary `./configure` options.
* Supports downloading archives using `wget` or `curl`.
* Supports verifying downloaded archives using `md5sum`, `md5` or `openssl md5`.
* Supports installing build dependencies via the package manager:
  * [apt]
  * [dnf]
  * [yum]
  * [pacman]
  * [zypper]
  * [pkg]
  * [macports]
  * [brew]
* Has tests.

## Anti-Features

* Does not require updating every time a new Ruby version comes out.
* Does not require recipes for each individual Ruby version or configuration.
* Does not support installing trunk/HEAD.

...but we don't need all of these features. If we wanted to reduce ruby-install as an external dependency, we would likely need to refactor the Dockerfile to fetch and validate source SHAs, and recreate the required ./configure options (including --enable-load-relative).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions