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 a suitable .ruby-version #229

Merged
merged 1 commit into from May 19, 2024
Merged

Conversation

bbrcknl
Copy link
Contributor

@bbrcknl bbrcknl commented Feb 29, 2024

The doc site currently uses some old Jekyll plugins that only support Ruby version 2.

The .ruby-version file works with rvm and rbenv to force the use of a suitable Ruby version. Version 2.7.8 is the last version of Ruby 2, which is now past end-of-life.

Even for folks who don't use rvm or rbenv, the .ruby-version file is a useful indicator of which version of Ruby to use.

@bbrcknl bbrcknl force-pushed the birg/ruby-version branch 2 times, most recently from 3c4b2fa to 630e49c Compare February 29, 2024 23:29
.ruby-version.license Outdated Show resolved Hide resolved
@Indanz
Copy link
Contributor

Indanz commented Mar 2, 2024

What is the advantage of using .ruby-version compared to specifying it in the Gemfile?

@bbrcknl
Copy link
Contributor Author

bbrcknl commented Mar 3, 2024

What is the advantage of using .ruby-version compared to specifying it in the Gemfile?

@mbrcknl Can you pls comment

@mbrcknl
Copy link
Member

mbrcknl commented Mar 4, 2024

What is the advantage of using .ruby-version compared to specifying it in the Gemfile?

Ah, I did not realise that a Gemfile could specify a Ruby version. In that case, it would be worth adding a ruby specification there, with a less rigid specification, e.g. ruby "~> 2.7" (or a lower version if it's known to work).

Even so, the Gemfile ruby version is just an assertion that fails if the currently active ruby is outside the spec. Whereas .ruby-version actually selects the given version to be the active one if you're using rbenv or rvm to manage your Ruby installations. So they're probably both useful. I'll work with @bbrcknl to update the PR.

@Indanz
Copy link
Contributor

Indanz commented Mar 4, 2024

Perhaps keep the new file and add ruby file: ".ruby-version", to get the best of both.

@lsf37
Copy link
Member

lsf37 commented May 19, 2024

Perhaps keep the new file and add ruby file: ".ruby-version", to get the best of both.

I played around with this locally a bit and there is a catch: specifying the ruby version in the Gemfile makes it an error if a different version is used, which means the change would break current CI. I also got an error message for 2.7.8 -- it seems to not recognise itself (Your Ruby version is 2.7.8, but your Gemfile specified (no version), whereas is fails correctly when run from a different ruby version.)

It'd be possible, of course, (and maybe better) to specify the ruby version in CI manually and make sure that it is the one in .ruby-version, but that is a slightly larger change, and I still haven't figured out how to get around the self recognition error.

I suspect we should upgrade ruby to a more recent version, make sure everything works well with that, and then specify it in the Gemfile as you suggest + update the build instructions.

The doc site currently uses some old Jekyll plugins that only
support Ruby version 2.

The .ruby-version file works with `rvm` and `rbenv` to force the
use of a suitable Ruby version. Version 2.7.8 is the last version
of Ruby 2, which is now past end-of-life.

Even for folks who don't use `rvm` or `rbenv`, the .ruby-version
file is a useful indicator of which version of Ruby to use.

Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
@lsf37 lsf37 merged commit 1f039c4 into seL4:master May 19, 2024
8 checks passed
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.

None yet

4 participants