Skip to content

Commit c4303bb

Browse files
committed
[GR-30578] Update to Ruby 2.7.3
PullRequest: truffleruby/2632
2 parents 8a14609 + 035d1f2 commit c4303bb

File tree

124 files changed

+12998
-10600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+12998
-10600
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.2
1+
2.7.3

3rd_party_licenses.txt

Lines changed: 1132 additions & 212 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Bug fixes:
1313

1414
Compatibility:
1515

16+
* Updated to Ruby 2.7.3. The `resolv` stdlib was not updated (`resolv` in 2.7.3 has [bugs](https://bugs.ruby-lang.org/issues/17748)).
1617
* Make interpolated strings frozen for compatibility with Ruby 2.7 (#2304, @kirs).
1718
* `require 'socket'` now also requires `'io/wait'` like CRuby (#2326).
1819
* Support precision when formatting strings (#2281, @kirs).
@@ -39,6 +40,10 @@ Performance:
3940
Changes:
4041

4142

43+
Security:
44+
45+
* Updated to Ruby 2.7.3 to fix CVE-2021-28965 and CVE-2021-28966.
46+
4247
# 21.1.0
4348

4449
New features:

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

doc/legal/legal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See `epl-2.0.txt`, `gpl-2.txt`, `lgpl-2.1.txt`.
1919
## MRI
2020

2121
The standard implementation of Ruby is MRI. TruffleRuby contains code from MRI
22-
version 2.7.2, including:
22+
version 2.7.3, including:
2323

2424
* the standard library in `lib/mri`,
2525
* Ruby C extension API in `lib/cext/include` and `src/main/c/cext`,

doc/user/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Compatibility
22

33
TruffleRuby aims to be fully compatible with the standard implementation of
4-
Ruby, MRI, version 2.7.2, [including C extensions](#c-extension-compatibility).
4+
Ruby, MRI, version 2.7.3, [including C extensions](#c-extension-compatibility).
55
TruffleRuby is still in development, so it is not 100% compatible yet.
66

77
Any incompatibility with MRI is considered a bug, except for rare cases detailed below.

doc/user/known-cves.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Cross-reference with the details on [the MRI website](https://www.ruby-lang.org/
2727

2828
Number | Description | Their Mitigation | Test | Our Mitigation
2929
--- | --- | --- | --- | ---
30+
CVE-2021-28966 | Path traversal in Tempfile on Windows | Sanitization of paths in tmpdir.rb | In `test/mri/tests/test_tmpdir.rb` | Sanitization of paths in tmpdir.rb
31+
CVE-2021-28965 | XML round-trip vulnerability in REXML | Update to REXML 3.2.5 | In ruby/rexml | Update to REXML 3.2.5
3032
CVE-2020-10663 | Unsafe Object Creation Vulnerability in JSON (Additional fix) | [Fix](https://bugs.ruby-lang.org/issues/16698) | [Spec](https://github.com/ruby/spec/pull/764) | The pure Ruby version of JSON we use is safe
3133
CVE-2019-16255 | A code injection vulnerability of Shell#[] and Shell#test | [Fix](https://github.com/ruby/ruby/commit/d6adc68dc9c74a33b3ca012af171e2d59f0dea10) | MRI test | Same
3234
CVE-2019-16254 | HTTP response splitting in WEBrick (Additional fix) | [Fix](https://github.com/ruby/ruby/commit/3ce238b5f9795581eb84114dcfbdf4aa086bfecc) | MRI test | Same

doc/user/options.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Usage: truffleruby [switches] [--] [programfile] [arguments]
2121
-rlibrary require the library before executing your script
2222
-s enable some switch parsing for switches after script name
2323
-S look for the script using PATH environment variable
24-
-T[level=1] turn on tainting checks
2524
-v print the version number, then turn on verbose mode
2625
-w turn warnings on for your script
2726
-W[level=2|:category]
@@ -42,7 +41,7 @@ Features:
4241
rubyopt RUBYOPT environment variable (default: enabled)
4342
frozen-string-literal
4443
freeze all string literals (default: disabled)
45-
44+
4645
Warning categories:
4746
deprecated deprecated features
4847
experimental experimental features

lib/cext/ABI_check.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2
1+
1

lib/cext/include/ruby/defines.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ void rb_sparc_flush_register_windows(void);
486486
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
487487
defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
488488
defined(__powerpc64__) || \
489+
defined(__aarch64__) || \
489490
defined(__mc68020__)
490491
# define UNALIGNED_WORD_ACCESS 1
491492
# else

0 commit comments

Comments
 (0)