Skip to content

Commit c2f6805

Browse files
committed
Update instructions in the Updating our version of Ruby document
1 parent 55a07ad commit c2f6805

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

doc/contributor/updating-ruby.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
# Updating our version of Ruby
22

3-
Before you do anything, check with Benoit Daloze for clearance to upgrade.
3+
> [!IMPORTANT]
4+
> Before you do anything, check with Benoit Daloze for clearance to upgrade.
5+
6+
TruffleRuby contains some MRI source code files e.g. default gems source code,
7+
some C headers that define public API, etc. Some of them are modified to provide
8+
TruffleRuby-specific implementation or disable some functionality. During
9+
importing new MRI version source code files these patches should be also preserved.
410

511
The workflow below will allow you to see and reapply the modifications that we
612
have to MRI source code while updating.
713

14+
The approach is the following:
15+
- create a TruffleRuby branch with currently supported MRI version imported files
16+
(and without any TruffleRuby-specific patches, so it actually undoes the patches)
17+
- create a TruffleRuby branch with the target MRI version imported files
18+
- apply the patches (the difference between the first branch and TruffleRuby master)
19+
to the second branch
20+
821
You can re-run these instructions at any time to compare against unmodified
922
MRI files.
1023

@@ -39,6 +52,8 @@ ruby-install --no-install-deps -r ~/tmp ruby $VERSION
3952
rm -rf ~/tmp/ruby-$VERSION
4053
```
4154

55+
Ensure that currently supported MRI version is installed this way too.
56+
4257
`ruby-build` does not keep the build directory
4358
(required as `RUBY_BUILD_DIR` for `tool/import-mri-files.sh`),
4459
so one needs the extra `ruby-install` command when using `ruby-build`.
@@ -47,8 +62,8 @@ See [these docs](../../doc/user/ruby-managers.md#ruby-install-and-chruby) for de
4762

4863
## Create reference branches
4964

50-
For both the current version of Ruby you're using, and the new version, create
51-
reference branches that include unmodified MRI sources.
65+
For both the current version of Ruby you're using and the new version create
66+
reference branches (in the TruffleRuby repository) that include unmodified MRI sources.
5267

5368
Check out the version of Ruby you want to create the branch for in `../ruby`, e.g.:
5469

@@ -143,7 +158,10 @@ Update all of these:
143158

144159
* Update `.ruby-version`, `TruffleRuby.LANGUAGE_VERSION`
145160
* Reset `truffleruby-abi-version.h` to `$RUBY_VERSION.1` and `lib/cext/ABI_check.txt` to `1` if `RUBY_VERSION` was updated.
146-
* Update `versions.json` (with gem versions provided by `cat ../ruby/gems/bundled_gems | sort`, `ls -l lib/gems/specifications/default` and `grep 'VERSION =' lib/mri/rubygems.rb`)
161+
* Update `versions.json`
162+
* with bundled gem versions provided by `cat ../ruby/gems/bundled_gems | sort`,
163+
* default gem versions provided by `ls -l lib/gems/specifications/default`
164+
* and `gem` gem version provided by `grep 'VERSION =' lib/mri/rubygems.rb`
147165
* Also update version numbers for `debug` and `rbs` in `src/main/c/Makefile`, `mx.truffleruby/suite.py` and `lib/gems/gems/debug-*/ext/debug/extconf.rb`.
148166
* Copy and paste `-h` and `--help` output to `RubyLauncher` (instructions are in the end of the file `src/launcher/java/org/truffleruby/launcher/RubyLauncher.java`)
149167
* This is a good time to get `jt build` working.
@@ -166,6 +184,8 @@ For a new major version:
166184
* Update the docs for next version specs in [workflow.md](workflow.md).
167185
* Update the versions in the `ruby/spec on CRuby` job of `.github/workflows/ci.yml`.
168186

187+
Use "Update versions" for a commit message.
188+
169189
## Last step
170190

171-
* Request the new MRI version on Jira, then update `ci.jsonnet` to use the corresponding MRI version for benchmarking.
191+
* Request the new MRI version on Jira, then update `ci/common.jsonnet` to use the corresponding MRI version for benchmarking.

0 commit comments

Comments
 (0)