Skip to content

Commit 66ca27b

Browse files
committed
[GR-45621] Ruby 3.2.2 import
PullRequest: truffleruby/3934
2 parents 341e210 + 3408558 commit 66ca27b

File tree

1,937 files changed

+74819
-35585
lines changed

Some content is hidden

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

1,937 files changed

+74819
-35585
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/CHANGELOG.md merge=union
44

5-
/spec/truffleruby.next-specs merge=union
6-
75
# Rules for GitHub's Linguist language-classification system. We're abusing the
86
# 'vendored' attribute to exclude files as a lot of this isn't really vendored,
97
# and a whole lot of actually vendored code isn't listed! What we want to do is

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ bench/psd.rb/psd_native/ext/psd_native/Makefile
4242
lib/gems/extensions
4343
lib/gems/gems/*/ext/*/Makefile
4444
lib/gems/gems/*/ext/*/.*.time
45+
lib/gems/gems/debug-*/ext/debug/debug_version.h
4546

4647
src/main/c/*/Makefile
4748
!src/main/c/spawn-helper/Makefile

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require:
66
- ./tool/rubocop-truffleruby/cop/replace_with_primitive_true_and_false_predicates.rb
77

88
AllCops:
9-
TargetRubyVersion: 3.1
9+
TargetRubyVersion: 3.2
1010
DisabledByDefault: true
1111
DisplayCopNames: true
1212
ExtraDetails: true

.ruby-version

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

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
New features:
44

5+
* Updated to Ruby 3.2.2 (#3039, @eregon, @andrykonchin).
56

67
Bug fixes:
78

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ See the [contributor workflow](doc/contributor/workflow.md) document if you wish
118118
We recommend that people trying TruffleRuby on their gems and applications [get in touch with us](#contact) for any help they might need.
119119

120120
TruffleRuby runs Rails and is compatible with many gems, including C extensions.
121-
TruffleRuby is not 100% compatible with MRI 3.1 yet. Please [report](https://github.com/oracle/truffleruby/issues) any compatibility issues you might find.
121+
TruffleRuby is not 100% compatible with MRI 3.2 yet. Please [report](https://github.com/oracle/truffleruby/issues) any compatibility issues you might find.
122122
TruffleRuby [passes around 97% of ruby/spec](https://eregon.me/rubyspec-stats/),
123123
more than any other alternative Ruby implementation.
124124

doc/contributor/updating-ruby.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ ruby-install ruby $VERSION
3636
rm -rf ~/.rubies/ruby-$VERSION
3737
ruby-build $VERSION ~/.rubies/ruby-$VERSION
3838
ruby-install --no-install-deps -r ~/tmp ruby $VERSION
39+
rm -rf ~/tmp/ruby-$VERSION
3940
```
4041

4142
`ruby-build` does not keep the build directory
@@ -143,15 +144,17 @@ Update all of these:
143144

144145
* Update `.ruby-version`, `TruffleRuby.LANGUAGE_VERSION`
145146
* Reset `lib/cext/ABI_version.txt` 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`, `ls -l lib/gems/specifications/default` and `jt gem --version`)
147+
* 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`)
147148
* Also update version numbers in `src/main/c/Makefile`.
148149
* 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`)
150+
* This is a good time to get `jt build` working.
149151
* Copy and paste the TruffleRuby `--help` output to `doc/user/options.md` (e.g., with `jt ruby --help | xsel -b`)
150152
* Update `doc/user/compatibility.md` and `README.md`
151-
* Update `doc/legal/legal.md`
153+
* Update `doc/legal/legal.md`, notably the `Bundled gems` section
152154
* Update method lists - see `spec/truffle/methods_spec.rb`
153155
* Build TruffleRuby (`jt build`).
154156
* Run `jt test gems default-bundled-gems`
157+
* Get `jt test spec/truffle/rubygems/default_gems_list_spec.rb` to pass
155158
* Grep for the old Ruby version with `git grep -F x.y.z`
156159
* Grep for the old Bundler version with `git grep -F x.y.z`
157160
* If `tool/id.def` or `lib/cext/include/truffleruby/internal/id.h` has changed, then run `jt build core-symbols` and check for correctness.
@@ -160,7 +163,7 @@ Update all of these:
160163

161164
For a new major version:
162165
* Update `TargetRubyVersion` in `.rubocop.yml`
163-
* Update the list of `:next` specs.
166+
* Update `spec/truffleruby.next-specs` and remove `/spec/truffleruby.next-specs merge=union` in `.gitattributes`
164167
* Update the docs for next version specs in [workflow.md](workflow.md).
165168
* Update the versions in the `ruby/spec on CRuby` job of `.github/workflows/ci.yml`.
166169

doc/contributor/workflow.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,16 @@ exception.
303303
When the spec is fixed the `untag` command will remove the tag and you can
304304
commit the fix and the removal of the tag.
305305

306-
## Running specs for Ruby 3.2 features
306+
## Running specs for Ruby 3.3 features
307307

308-
TruffleRuby currently targets Ruby 3.1. However, we welcome pull requests for
309-
Ruby 3.2 features as long as they don't conflict significantly with
310-
Ruby 3.1 semantics.
308+
TruffleRuby currently targets Ruby 3.2. However, we welcome pull requests for
309+
Ruby 3.3 features as long as they don't conflict significantly with
310+
Ruby 3.2 semantics.
311311

312-
It is possible to run specs for Ruby 3.2 features by setting
313-
`PRETEND_RUBY_VERSION`:
312+
It is possible to run specs for Ruby 3.3 features by setting `PRETEND_RUBY_VERSION`:
314313

315314
```bash
316-
PRETEND_RUBY_VERSION=3.2.0 jt test spec/ruby/.../some_spec.rb
315+
PRETEND_RUBY_VERSION=3.3.0 jt test spec/ruby/.../some_spec.rb
317316
```
318317

319318
This also works for `jt tag`/`jt untag`.

doc/legal/bundled_gems

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# gem-name version-to-bundle repository-url [optional-commit-hash-to-test-or-defaults-to-v-version]
2+
minitest 5.16.3 https://github.com/seattlerb/minitest
3+
power_assert 2.0.3 https://github.com/ruby/power_assert
4+
rake 13.0.6 https://github.com/ruby/rake
5+
test-unit 3.5.7 https://github.com/test-unit/test-unit
6+
rexml 3.2.5 https://github.com/ruby/rexml
7+
rss 0.2.9 https://github.com/ruby/rss
8+
net-ftp 0.2.0 https://github.com/ruby/net-ftp
9+
net-imap 0.3.4 https://github.com/ruby/net-imap
10+
net-pop 0.1.2 https://github.com/ruby/net-pop
11+
net-smtp 0.3.3 https://github.com/ruby/net-smtp
12+
matrix 0.4.2 https://github.com/ruby/matrix
13+
prime 0.1.2 https://github.com/ruby/prime
14+
rbs 2.8.2 https://github.com/ruby/rbs
15+
typeprof 0.21.3 https://github.com/ruby/typeprof
16+
debug 1.7.1 https://github.com/ruby/debug

doc/legal/legal.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ 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 3.1.3, including:
22+
version 3.2.2, including:
2323

2424
* the standard library in `lib/mri`,
2525
* Ruby C extension API in `lib/cext/include` and `src/main/c/cext`,
26-
* C extensions in `src/main/c/{etc,nkf,openssl,psych,rbconfig-sizeof,syslog,zlib}`
26+
* C extensions in `src/main/c/{bigdecimal,date,etc,io-console,nkf,openssl,psych,rbconfig-sizeof,ripper,syslog,zlib}`
2727

2828
MRI is copyright Yukihiro Matsumoto. It is made available under the terms of the
2929
2-clause BSD licence `ruby-bsdl.txt`, or a custom licence `ruby-licence.txt`.
@@ -96,47 +96,69 @@ are copyright 2013 Brian Shirai and are licensed under the 3-clause BSD license.
9696
In some cases this code is just code from MRI, and covered by their licence. In
9797
some cases we have modified this code.
9898

99-
# Included gems
99+
# Bundled gems
100100

101+
This list is from [bundled_gems](bundled_gems) and `grep licenses lib/gems/specifications/*.gemspec`.
101102
Versions as used in MRI unless otherwise specified.
102103

103-
#### did_you_mean
104+
#### debug
104105

105-
did_you_mean is copyright 2014 Yuki Nishijima and is available under an MIT
106-
licence (see `mit.txt`).
106+
debug is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).
107+
108+
#### matrix
109+
110+
matrix is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).
107111

108112
#### minitest
109113

110-
minitest is copyright Ryan Davis and is available under an MIT licence (see
111-
`mit.txt`).
114+
minitest is copyright Ryan Davis and is available under an MIT licence (see `mit.txt`).
112115

113-
#### net-telnet
116+
#### net-ftp, net-imap, net-pop, net-smtp
114117

115-
net-telnet is under the same copyright and licence as MRI.
118+
These 4 bundled gems are under the same copyright and licence as MRI (see `ruby-bsdl.txt`).
116119

117120
#### power_assert
118121

119-
power_assert copyright Kazuki Tsujimoto, but available under the same licence as
120-
MRI.
122+
power_assert is copyright Kazuki Tsujimoto and is available under the same licence as MRI (see `ruby-bsdl.txt`).
121123

122-
#### Rake
124+
#### prime
123125

124-
Rake is copyright Jim Weirich and is available under an MIT licence (see
125-
`mit.txt`).
126+
prime is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).
127+
128+
#### rake
129+
130+
Rake is copyright Jim Weirich and is available under an MIT licence (see `mit.txt`).
131+
132+
#### rbs
133+
134+
rbs is copyright Soutaro Matsumoto and is available under the same licence as MRI (see `ruby-bsdl.txt`).
135+
136+
#### rexml
137+
138+
rexml is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).
139+
140+
#### rss
141+
142+
rss is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).
126143

127144
#### test-unit
128145

129-
test-unit is copyright Kouhei Sutou, Ryan Davis, and Nathaniel Talbott and is
130-
available under the terms of the GPL 2 (see `gpl-2.txt`), or the same custom
131-
licence as MRI (see `ruby-licence.txt`).
146+
test-unit is copyright Sutou Kouhei, Ryan Davis, and Nathaniel Talbott
147+
and is available under the same licence as MRI (see `ruby-bsdl.txt`).
148+
149+
#### typeprof
150+
151+
typeprof is copyright Yusuke Endoh and is available under an MIT licence (see `mit.txt`).
152+
153+
# Other gems
132154

133-
#### JSON
155+
#### json
134156

135-
The JSON gem is available under the same licence as MRI.
157+
The json gem is available under the same licence as MRI (see `ruby-bsdl.txt`).
136158

137159
#### RDoc
138160

139-
It's part of the standard library, not an included gem, but RDoc is copyright
161+
It's part of the standard library, not a bundled gem. RDoc is copyright
140162
Dave Thomas and Eric Hodel and is available under the terms of the GPL 2 (see
141163
`gpl-2.txt`), or the same custom licence as MRI (see `ruby-licence.txt`). Some
142164
other files in RDoc have different, but compatible, licences detailed in the

doc/user/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permalink: /reference-manual/ruby/Compatibility/
77
# Compatibility
88

99
TruffleRuby aims to be fully compatible with the standard implementation of
10-
Ruby, MRI, version 3.1.3, [including C extensions](#c-extension-compatibility).
10+
Ruby, MRI, version 3.2.2, [including C extensions](#c-extension-compatibility).
1111
TruffleRuby is still in development, so it is not 100% compatible yet.
1212

1313
TruffleRuby can run Rails and is compatible with many gems, including C extensions.

doc/user/options.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Usage: truffleruby [switches] [--] [programfile] [arguments]
3333
set warning level; 0=silence, 1=medium, 2=verbose
3434
-x[directory] strip off text before #!ruby line and perhaps cd to directory
3535
--copyright print the copyright
36-
--enable={rubyopt|...}[,...], --disable={rubyopt|...}[,...]
36+
--enable={jit|rubyopt|...}[,...], --disable={jit|rubyopt|...}[,...]
3737
enable or disable features. see below for available features
3838
--external-encoding=encoding, --internal-encoding=encoding
3939
specify the default external or internal character encoding
@@ -45,7 +45,9 @@ Usage: truffleruby [switches] [--] [programfile] [arguments]
4545
4646
Features:
4747
gems rubygems (only for debugging, default: enabled)
48+
error_highlight error_highlight (default: enabled)
4849
did_you_mean did_you_mean (default: enabled)
50+
syntax_suggest syntax_suggest (default: enabled)
4951
rubyopt RUBYOPT environment variable (default: enabled)
5052
frozen-string-literal
5153
freeze all string literals (default: disabled)
@@ -66,13 +68,14 @@ Runtime options:
6668
--help Print this help message.
6769
--help:vm Print options for the host VM.
6870
--help:engine Print engine options.
71+
--help:compiler Print engine compiler options.
6972
--help:all Print all options.
7073
--version:graalvm Print GraalVM version information and exit.
7174
--show-version:graalvm Print GraalVM version information and continue execution.
7275
7376
Languages:
7477
[id] [name] [website]
75-
llvm LLVM https://www.graalvm.org/22.1/reference-manual/llvm/
78+
llvm LLVM https://www.graalvm.org/dev/reference-manual/llvm/
7679
ruby Ruby https://www.graalvm.org/ruby/
7780
7881
Tools:

exe/gem

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ exec "$(dirname $SELF_PATH)/ruby" "$SELF_PATH" "$@"
2424
# See LICENSE.txt for permissions.
2525
#++
2626

27-
require 'rubygems'
28-
require 'rubygems/gem_runner'
29-
require 'rubygems/exceptions'
30-
31-
required_version = Gem::Requirement.new ">= 1.8.7"
32-
33-
unless required_version.satisfied_by? Gem.ruby_version then
34-
abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
35-
end
36-
37-
args = ARGV.clone
38-
39-
begin
40-
Gem::GemRunner.new.run args
41-
rescue Gem::SystemExitException => e
42-
exit e.exit_code
43-
end
27+
require "rubygems/gem_runner"
4428

29+
Gem::GemRunner.new.run ARGV.clone

lib/cext/ABI_check.txt

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

lib/cext/ABI_version.txt

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

lib/cext/include/ccan/build_assert/build_assert.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define CCAN_BUILD_ASSERT_H
44

55
/**
6-
* BUILD_ASSERT - assert a build-time dependency.
6+
* CCAN_BUILD_ASSERT - assert a build-time dependency.
77
* @cond: the compile-time condition which must be true.
88
*
99
* Your compile will fail if the condition isn't true, or can't be evaluated
@@ -15,15 +15,15 @@
1515
* static char *foo_to_char(struct foo *foo)
1616
* {
1717
* // This code needs string to be at start of foo.
18-
* BUILD_ASSERT(offsetof(struct foo, string) == 0);
18+
* CCAN_BUILD_ASSERT(offsetof(struct foo, string) == 0);
1919
* return (char *)foo;
2020
* }
2121
*/
22-
#define BUILD_ASSERT(cond) \
22+
#define CCAN_BUILD_ASSERT(cond) \
2323
do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
2424

2525
/**
26-
* BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
26+
* CCAN_BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
2727
* @cond: the compile-time condition which must be true.
2828
*
2929
* Your compile will fail if the condition isn't true, or can't be evaluated
@@ -32,9 +32,9 @@
3232
* Example:
3333
* #define foo_to_char(foo) \
3434
* ((char *)(foo) \
35-
* + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
35+
* + CCAN_BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
3636
*/
37-
#define BUILD_ASSERT_OR_ZERO(cond) \
37+
#define CCAN_BUILD_ASSERT_OR_ZERO(cond) \
3838
(sizeof(char [1 - 2*!(cond)]) - 1)
3939

4040
#endif /* CCAN_BUILD_ASSERT_H */

0 commit comments

Comments
 (0)