Skip to content

Commit 0ec0310

Browse files
committed
Update instructions to update Ruby
1 parent e0ad790 commit 0ec0310

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

doc/contributor/updating-ruby.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ To update a specific default gem to a newer version than in the MRI release, run
1515
cd ruby
1616
git checkout -b truffleruby-updates-$VERSION vn_n_n
1717
ruby tool/sync_default_gems.rb $GEM
18+
19+
git push -u eregon HEAD
1820
```
1921
to update the default gem in MRI.
2022
Then follow the instructions below to reimport MRI files and to update default gems.
@@ -26,6 +28,20 @@ Set the environment variable `$VERSION` to the target version:
2628
export VERSION=n.n.n
2729
```
2830

31+
Re-install the target MRI version using the commands, to have a clean set of gems:
32+
```
33+
rm -rf ~/.rubies/ruby-$VERSION
34+
ruby-install ruby $VERSION
35+
# OR
36+
rm -rf ~/.rubies/ruby-$VERSION
37+
bin/ruby-build $VERSION ~/.rubies/ruby-$VERSION
38+
ruby-install -r ~/tmp ruby $VERSION
39+
```
40+
41+
`ruby-build` does not keep the build directory
42+
(required as `RUBY_BUILD_DIR` for `tool/import-mri-files.sh`),
43+
so one needs the extra `ruby-install` command when using `ruby-build`.
44+
2945
## Create reference branches
3046

3147
For both the current version of Ruby you're using, and the new version, create
@@ -48,18 +64,14 @@ update.
4864

4965
## Update MRI with modifications
5066

51-
Re-install the target MRI version using the commands, to have a clean set of gems:
52-
```
53-
rm -rf ~/.rubies/ruby-$VERSION
54-
ruby-install ruby $VERSION
55-
```
56-
57-
In your working branch you can import MRI files again, and you can re-apply
58-
old patches using the old reference branch.
67+
In your working branch you can cherry-pick the new reference branch,
68+
and then re-apply old patches using the old reference branch.
5969

6070
```bash
61-
tool/import-mri-files.sh
62-
git revert vNN
71+
# Commit message: Import files from MRI n.n.n
72+
git cherry-pick vNew
73+
# Commit message: Re-apply changes on top of n.n.n files
74+
git revert vOld
6375
```
6476

6577
You'll usually get some conflicts to work out.
@@ -140,9 +152,9 @@ ruby tool/patch-default-gemspecs.rb
140152
## Updating bin/ executables
141153

142154
```
143-
rm -rf bin
144-
cp -R ~/.rubies/ruby-$VERSION/bin .
145-
rm -f bin/ruby
155+
rm -rf exe
156+
cp -R ~/.rubies/ruby-$VERSION/bin exe
157+
rm -f exe/ruby
146158
ruby tool/patch_launchers.rb
147159
```
148160

@@ -151,7 +163,8 @@ ruby tool/patch_launchers.rb
151163
In a separate commit, update all of these:
152164

153165
* Update `.ruby-version`, `TruffleRuby.LANGUAGE_VERSION`
154-
* Update `versions.json` (from `../ruby/gems/bundled_gems`)
166+
* Reset `lib/cext/ABI_version.txt` and `lib/cext/ABI_check.txt` to `1` if `RUBY_VERSION` was updated.
167+
* Update `versions.json` (from `cat ../ruby/gems/bundled_gems`, `ls -l lib/gems/specifications/default` and `jt gem --version`)
155168
* Copy and paste `-h` and `--help` output to `RubyLauncher`
156169
* Copy and paste the TruffleRuby `--help` output to `doc/user/options.md`
157170
* Update `doc/user/compatibility.md` and `README.md`
@@ -161,7 +174,6 @@ In a separate commit, update all of these:
161174
* Grep for the old version with `git grep -F x.y.z`
162175
* If `tool/id.def` or `lib/cext/include/truffleruby/internal/id.h` has changed, `jt build core-symbols` and check for correctness.
163176
* Update the list of `:next` specs and change the "next version" in `spec/truffleruby.mspec`.
164-
* Reset `lib/cext/ABI_version.txt` and `lib/cext/ABI_check.txt` to `1` if `RUBY_VERSION` was updated.
165177

166178
## Last step
167179

0 commit comments

Comments
 (0)