Skip to content

Document examples of using custom defs #2537

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

Merged
merged 1 commit into from
May 24, 2025

Conversation

jasonkarns
Copy link
Member

Add examples of passing a custom build definition file in place of a 'known' ruby version. This is meant to more clearly document how users might use a custom build definition for a recently-released ruby that is not yet bundled in ruby-build.

This is primarily intended as a piece of documentation we can point to in Issues, wiki or to downstream tooling (like asdf-ruby) for how to use ruby-build to install additional builds of ruby. My hope is that with a few examples, more folks self-service with just-released rubies.

Additionally, document in the readme how to use RUBY_BUILD_DEFINITIONS path environment variable to provide a collection of custom build definitions. This is meant to give guidance on how an organization might share multiple custom build definitions, or downstream users of ruby-build (like asdf-ruby) might publish unreleased rubies for installation.

nit/quibbling over wording: custom build defs are recognized by ruby-build, just not bundled or available out of the box.

@eregon
Copy link
Member

eregon commented May 22, 2025

The docs look good to me.

The reasons given in the description confuse me though:

My hope is that with a few examples, more folks self-service with just-released rubies.

I think this is unlikely to happen and not that useful, first because CRuby releases are added very quickly here and second because if people want to do it themselves it's better they fork this repo, add the definition and make a PR, than just creating a file on their disk and not share it with others (while being not much more effort).
In fact IIRC for CRuby releases it's even automated: https://github.com/rbenv/ruby-build/blob/master/.github/workflows/update-ruby.yml

downstream users of ruby-build (like asdf-ruby) might publish unreleased rubies for installation.

ruby-build already provides many *-dev definitions, so I don't really see a real-world use-case for this.
It would be better contributed to ruby-build directly.

Actually it sounds to me like whatever you are using is lagging a few ruby-build releases behind, is that the case?

@jasonkarns
Copy link
Member Author

jasonkarns commented May 23, 2025

The push for this PR was a result of #2535. Ruby 3.4.4 had been added right away, but we hadn't released a new version of ruby-build. I cut the release but it was a few days after 3.4.4 had been added to ruby-build.

(I think a related improvement might be to automate the release ruby-build itself so there isn't a lag between when a ruby is added to ruby-build, and when ruby-build itself is released. But that's separate from this PR.)

When they referenced the asdf-ruby plugin asdf-vm/asdf-ruby#454, I wanted to link them to documentation that showed how users don't have to wait until ruby-build is released to take advantage of build definition files.

Add examples of passing a custom build definition file in place of a
'known' ruby version. This is meant to more clearly document how users
might use a custom build definition for a recently-released ruby that is
not yet bundled in ruby-build.

Additionally, document in the readme how to use `RUBY_BUILD_DEFINITIONS`
path environment variable to provide a _collection_ of custom build
definitions. This is meant to give guidance on how an organization might
share multiple custom build definitions, or downstream users of
ruby-build (like asdf-ruby) might publish unreleased rubies for
installation.

- quibbling over wording: custom build defs _are_ recognized by
  ruby-build, just not bundled or available out of the box.
@jasonkarns jasonkarns merged commit c21b26f into rbenv:master May 24, 2025
4 checks passed
@eregon
Copy link
Member

eregon commented May 24, 2025

Thanks for context.
I think for asdf and other Ruby installers using ruby-build the best workaround in that case is to just use master, as shown in asdf-vm/asdf-ruby#454 (comment).
Because the definition was already there, so the easiest is to just pick it up using master vs a release.

But yeah it would be good to solve this CRuby auto update but no release issue.
Whenever I add a TruffleRuby version I do a release, so there is no such issue.
I think we could do a release on every commit of ruby-build if that's an easier way to automate things.

Alternatively requiring only a workflow dispatch for a release would make it more convenient, that's what I do in setup-ruby:
https://github.com/ruby/setup-ruby/blob/master/.github/workflows/release.yml

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

Successfully merging this pull request may close these issues.

2 participants