Skip to content

Commit fa1a18a

Browse files
committed
[GR-62552] Upgrade Ruby from 3.3.5 to 3.3.7
PullRequest: truffleruby/4487
2 parents 369466f + 53edfbd commit fa1a18a

File tree

505 files changed

+7520
-3651
lines changed

Some content is hidden

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

505 files changed

+7520
-3651
lines changed

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.5
1+
3.3.7

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Bug fixes:
88

99
Compatibility:
1010

11+
* Updated to Ruby 3.3.7 (@andrykonchin).
1112
* Implement `StringScanner#{peek_byte,scan_byte,scan_integer,named_captures}` methods (#3788, @andrykonchin).
1213
* Support String patterns in `StringScanner#{exist?,scan_until,skip_until,check_until,search_full}` methods (@andrykonchin).
1314
* Implement `ObjectSpace::WeakKeyMap` (#3681, @andrykonchin).

README.md

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

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

@@ -193,4 +193,4 @@ For further licensing information, see [LICENCE](LICENCE.md), [3rd_party_license
193193

194194
## Attribution
195195

196-
TruffleRuby includes infrastructure code from [JRuby](https://github.com/jruby/jruby) (e.g. parser, JCodings, Joni), core library code from the [Rubinius](https://github.com/rubinius/rubinius) project, as well as code from the standard implementation of Ruby, [MRI](https://github.com/ruby/ruby).
196+
TruffleRuby includes infrastructure code from [JRuby](https://github.com/jruby/jruby) (e.g. JCodings, Joni), core library code from the [Rubinius](https://github.com/rubinius/rubinius) project, as well as code from the standard implementation of Ruby, [MRI](https://github.com/ruby/ruby).

doc/contributor/updating-ruby.md

+36-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,43 @@ To update a specific default gem to a newer version than in the MRI release, run
2727
```
2828
cd ruby
2929
git checkout -b truffleruby-updates-$VERSION vn_n_n
30+
cd ..
31+
git clone [email protected]:ruby/<gem>.git
32+
cd <gem>
33+
git checkout v<gem-version>
34+
cd ../ruby
3035
ruby tool/sync_default_gems.rb $GEM
3136
3237
git push -u eregon HEAD
3338
```
3439
to update the default gem in MRI.
3540
Then follow the instructions below to reimport MRI files and to update default gems.
3641

42+
Another way to update a gem to a specific version is to pass a commits range:
43+
44+
```
45+
ruby tool/sync_default_gems.rb <gem-name> <sha1-of-currently-imported-version>..<sha1-of-a-new-version>
46+
```
47+
48+
Run `ruby tool/sync_default_gems.rb --help` to get other ways to run the script.
49+
50+
## Updating a specific bundled gem
51+
52+
Set new version of the bundled gem in `gems/bundled_gems` in a Ruby source code directory.
53+
54+
Build Ruby (currently supported version) with the following commands:
55+
56+
```
57+
./autogen.sh
58+
mkdir ~/.rubies
59+
./configure --prefix="${HOME}/.rubies/ruby-$VERSION-updated-gems" --disable-install-doc
60+
make -j8 install-nodoc
61+
```
62+
63+
Use `~/.rubies/ruby-$VERSION-updated-gems` directory as a source for copying a new bundled gem version.
64+
65+
Follow instructions how to update default and bundled gems.
66+
3767
## Setup
3868

3969
Set the environment variable `$VERSION` to the target version:
@@ -166,8 +196,9 @@ Update all of these:
166196

167197
* Update `.ruby-version`, `TruffleRuby.LANGUAGE_VERSION`
168198
* Reset `truffleruby-abi-version.h` to `$RUBY_VERSION.1` and `lib/cext/ABI_check.txt` to `1` if `RUBY_VERSION` was updated.
199+
* use `$RUBY_VERSION.$GRAALVM_VERSION.1` for releases in `truffleruby-abi-version.h`
169200
* Update `versions.json`
170-
* with bundled gem versions provided by `cat ../ruby/gems/bundled_gems | sort`,
201+
* with bundled gem versions provided by `cat ../ruby/gems/bundled_gems | sort` (ensure the target Ruby version is checked out in the `../ruby` directory),
171202
* default gem versions provided by `ls -l lib/gems/specifications/default`
172203
* and `gem` gem version provided by `grep 'VERSION =' lib/mri/rubygems.rb`
173204
* Also update version numbers for `debug`, `racc`, and `rbs` in `src/main/c/Makefile`, `mx.truffleruby/suite.py` and `lib/gems/gems/debug-*/ext/debug/extconf.rb`.
@@ -176,9 +207,11 @@ Update all of these:
176207
* Copy and paste the TruffleRuby `--help` output to `doc/user/options.md` (e.g., with `jt ruby --help | xsel -b`)
177208
* Update `doc/user/compatibility.md` and `README.md`
178209
* Update `doc/legal/legal.md`, notably the `Bundled gems` section
179-
* Update method lists - see `spec/truffle/methods_spec.rb`
210+
* Update method lists (see `spec/truffle/methods_spec.rb`)
211+
* run `jt -u ruby test spec/truffle/methods_spec.rb` to add new methods
212+
* run `jt purge spec/truffle/methods_spec.rb` to remove tags for implemented methods
180213
* Build TruffleRuby (`jt build`).
181-
* Run `jt test gems default-bundled-gems`
214+
* Run `jt test gems default-bundled-gems` and commit generated `Gemfile` and `Gemfile.lock` files
182215
* Get `jt test spec/truffle/rubygems/default_gems_list_spec.rb` to pass
183216
* Grep for the old Ruby version with `git grep -F x.y.z`
184217
* Grep for the old Bundler version with `git grep -F x.y.z`

doc/legal/bundled_gems

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ minitest 5.20.0 https://github.com/minitest/minitest
99
power_assert 2.0.3 https://github.com/ruby/power_assert
1010
rake 13.1.0 https://github.com/ruby/rake
1111
test-unit 3.6.1 https://github.com/test-unit/test-unit
12-
rexml 3.3.6 https://github.com/ruby/rexml
12+
rexml 3.3.9 https://github.com/ruby/rexml
1313
rss 0.3.1 https://github.com/ruby/rss
1414
net-ftp 0.3.4 https://github.com/ruby/net-ftp
15-
net-imap 0.4.9.1 https://github.com/ruby/net-imap
15+
net-imap 0.4.19 https://github.com/ruby/net-imap
1616
net-pop 0.1.2 https://github.com/ruby/net-pop
1717
net-smtp 0.4.0.1 https://github.com/ruby/net-smtp
1818
matrix 0.4.2 https://github.com/ruby/matrix
1919
prime 0.1.2 https://github.com/ruby/prime
2020
rbs 3.4.0 https://github.com/ruby/rbs
2121
typeprof 0.21.9 https://github.com/ruby/typeprof
22-
debug 1.9.1 https://github.com/ruby/debug
22+
debug 1.9.2 https://github.com/ruby/debug
2323
racc 1.7.3 https://github.com/ruby/racc

doc/legal/legal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ See `epl-2.0.txt`, `gpl-2.txt`, `lgpl-2.1.txt`.
1818
## MRI
1919

2020
The standard implementation of Ruby is MRI. TruffleRuby contains code from MRI
21-
version 3.3.5, including:
21+
version 3.3.7, including:
2222

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

doc/user/compatibility.md

+1-1
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.3.5, [including C extensions](#c-extension-compatibility).
10+
Ruby, MRI, version 3.3.7, [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.

lib/cext/ABI_check.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9
1+
1

lib/cext/include/truffleruby/truffleruby-abi-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
// $RUBY_VERSION must be the same as TruffleRuby.LANGUAGE_VERSION.
2121
// $ABI_NUMBER starts at 1 and is incremented for every ABI-incompatible change.
2222

23-
#define TRUFFLERUBY_ABI_VERSION "3.3.5.11"
23+
#define TRUFFLERUBY_ABI_VERSION "3.3.7.1"
2424

2525
#endif

lib/gems/gems/debug-1.9.1/ext/debug/debug_version.h

-1
This file was deleted.

lib/gems/gems/debug-1.9.1/Gemfile lib/gems/gems/debug-1.9.2/Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ gem "rake-compiler"
77
gem "test-unit", "~> 3.0"
88
gem "test-unit-rr"
99
gem "json-schema"
10+
gem "test-unit-launchable"
File renamed without changes.

lib/gems/gems/debug-1.9.1/README.md lib/gems/gems/debug-1.9.2/README.md

+33-9
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ New debug.rb has several advantages:
1313
* TCP/IP
1414
* Integration with rich debugger frontends
1515

16-
Frontend | [Console](https://github.com/ruby/debug#invoke-as-a-remote-debuggee) | [VSCode](https://github.com/ruby/debug#vscode-integration) | [Chrome DevTool](#chrome-devtool-integration) |
17-
---|---|---|---|
18-
Connection | UDS, TCP/IP | UDS, TCP/IP | TCP/IP |
19-
Requirement | No | [vscode-rdbg](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) | Chrome |
16+
| Frontend | [Console](https://github.com/ruby/debug#invoke-as-a-remote-debuggee) | [VSCode](https://github.com/ruby/debug#vscode-integration) | [Chrome DevTool](#chrome-devtool-integration) |
17+
| ----------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------- |
18+
| Connection | UDS, TCP/IP | UDS, TCP/IP | TCP/IP |
19+
| Requirement | No | [vscode-rdbg](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) | Chrome |
2020

2121
* Extensible: application can introduce debugging support in several ways:
2222
* By `rdbg` command
@@ -289,10 +289,10 @@ You can run your application as a remote debuggee, and the remote debugger conso
289289

290290
There are multiple ways to run your program as a debuggee:
291291

292-
Stop at program start | [`rdbg` option](https://github.com/ruby/debug#rdbg---open-or-rdbg--o-for-short) | [require](https://github.com/ruby/debug#require-debugopen-in-a-program) | [debugger API](https://github.com/ruby/debug#start-by-method)
293-
---|---|---|---|
294-
Yes | `rdbg --open` | `require "debug/open"` | `DEBUGGER__.open`
295-
No | `rdbg --open --nonstop` | `require "debug/open_nonstop"` | `DEBUGGER__.open(nonstop: true)`
292+
| Stop at program start | [`rdbg` option](https://github.com/ruby/debug#rdbg---open-or-rdbg--o-for-short) | [require](https://github.com/ruby/debug#require-debugopen-in-a-program) | [debugger API](https://github.com/ruby/debug#start-by-method) |
293+
| --------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------- |
294+
| Yes | `rdbg --open` | `require "debug/open"` | `DEBUGGER__.open` |
295+
| No | `rdbg --open --nonstop` | `require "debug/open_nonstop"` | `DEBUGGER__.open(nonstop: true)` |
296296

297297
#### `rdbg --open` (or `rdbg -O` for short)
298298

@@ -713,7 +713,7 @@ The `<...>` notation means the argument.
713713
* `eval <expr>`
714714
* Evaluate `<expr>` on the current frame.
715715
* `irb`
716-
* Invoke `irb` on the current frame.
716+
* Activate and switch to `irb:rdbg` console
717717

718718
### Trace
719719

@@ -784,6 +784,30 @@ The `<...>` notation means the argument.
784784
* Show help for the given command.
785785

786786

787+
### Using IRB as the Debug Console
788+
789+
Starting from version `v1.9`, you can now use IRB as the debug console. This integration brings additional features such as:
790+
791+
* Autocompletion
792+
* Support for multi-line input
793+
* Access to commands not available in `debug`, like `show_source` or `show_doc`
794+
* [Configurable command aliases](https://docs.ruby-lang.org/en/master/IRB.html#module-IRB-label-Command+Aliases)
795+
796+
To switch to the IRB console, simply use the `irb` command in the debug console.
797+
798+
Once activated, you'll notice the prompt changes to:
799+
800+
```txt
801+
irb:rdbg(main):001>
802+
```
803+
804+
If you want to make IRB the default console for all sessions, configure the `irb_console` setting by either:
805+
806+
* Setting the `RUBY_DEBUG_IRB_CONSOLE=true` environment variable
807+
* Or adding `config set irb_console 1` to your `~/.rdbgrc`
808+
809+
To disable the IRB console in the current session, execute `config set irb_console 0` in the console.
810+
787811
## Debugger API
788812

789813
### Start debugging
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/gems/gems/debug-1.9.1/ext/debug/debug.c lib/gems/gems/debug-1.9.2/ext/debug/debug.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ static VALUE rb_mDebugger;
88

99
// iseq
1010
typedef struct rb_iseq_struct rb_iseq_t;
11+
const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
1112
VALUE rb_iseq_realpath(const rb_iseq_t *iseq);
1213

1314
static VALUE
1415
iseq_realpath(VALUE iseqw)
1516
{
16-
rb_iseq_t *iseq = DATA_PTR(iseqw);
17-
return rb_iseq_realpath(iseq);
17+
return rb_iseq_realpath(rb_iseqw_to_iseq(iseqw));
1818
}
1919

2020
static VALUE rb_cFrameInfo;
@@ -121,26 +121,26 @@ frame_depth(VALUE self)
121121

122122
// iseq
123123

124-
const struct rb_iseq *rb_iseqw_to_iseq(VALUE iseqw);
124+
const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
125125

126126
#ifdef HAVE_RB_ISEQ_TYPE
127-
VALUE rb_iseq_type(const struct rb_iseq *);
127+
VALUE rb_iseq_type(const rb_iseq_t *);
128128

129129
static VALUE
130130
iseq_type(VALUE iseqw)
131131
{
132-
const struct rb_iseq *iseq = rb_iseqw_to_iseq(iseqw);
132+
const rb_iseq_t *iseq = rb_iseqw_to_iseq(iseqw);
133133
return rb_iseq_type(iseq);
134134
}
135135
#endif
136136

137137
#ifdef HAVE_RB_ISEQ_PARAMETERS
138-
VALUE rb_iseq_parameters(const struct rb_iseq *, int is_proc);
138+
VALUE rb_iseq_parameters(const rb_iseq_t *, int is_proc);
139139

140140
static VALUE
141141
iseq_parameters_symbols(VALUE iseqw)
142142
{
143-
const struct rb_iseq *iseq = rb_iseqw_to_iseq(iseqw);
143+
const rb_iseq_t *iseq = rb_iseqw_to_iseq(iseqw);
144144
VALUE params = rb_iseq_parameters(iseq, 0);
145145
VALUE ary = rb_ary_new();
146146

@@ -167,12 +167,12 @@ iseq_parameters_symbols(VALUE iseqw)
167167
#endif
168168

169169
#ifdef HAVE_RB_ISEQ_CODE_LOCATION
170-
void rb_iseq_code_location(const struct rb_iseq *, int *first_lineno, int *first_column, int *last_lineno, int *last_column);
170+
void rb_iseq_code_location(const rb_iseq_t *, int *first_lineno, int *first_column, int *last_lineno, int *last_column);
171171

172172
static VALUE
173173
iseq_first_line(VALUE iseqw)
174174
{
175-
const struct rb_iseq *iseq = rb_iseqw_to_iseq(iseqw);
175+
const rb_iseq_t *iseq = rb_iseqw_to_iseq(iseqw);
176176
int line;
177177
rb_iseq_code_location(iseq, &line, NULL, NULL, NULL);
178178
return INT2NUM(line);
@@ -181,7 +181,7 @@ iseq_first_line(VALUE iseqw)
181181
static VALUE
182182
iseq_last_line(VALUE iseqw)
183183
{
184-
const struct rb_iseq *iseq = rb_iseqw_to_iseq(iseqw);
184+
const rb_iseq_t *iseq = rb_iseqw_to_iseq(iseqw);
185185
int line;
186186
rb_iseq_code_location(iseq, NULL, NULL, &line, NULL);
187187
return INT2NUM(line);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define RUBY_DEBUG_VERSION "1.9.2"
File renamed without changes.

lib/gems/gems/debug-1.9.1/lib/debug/config.rb lib/gems/gems/debug-1.9.2/lib/debug/config.rb

+16
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,22 @@ def update conf
158158
SESSION.set_no_sigint_hook old, new
159159
end
160160
end
161+
162+
if_updated old_conf, conf, :irb_console do |old, new|
163+
if defined?(SESSION) && SESSION.active?
164+
# irb_console is switched from true to false
165+
if old
166+
SESSION.deactivate_irb_integration
167+
# irb_console is switched from false to true
168+
else
169+
if CONFIG[:open]
170+
SESSION.instance_variable_get(:@ui).puts "\nIRB is not supported on the remote console."
171+
else
172+
SESSION.activate_irb_integration
173+
end
174+
end
175+
end
176+
end
161177
end
162178

163179
private def if_updated old_conf, new_conf, key

lib/gems/gems/debug-1.9.1/lib/debug/console.rb lib/gems/gems/debug-1.9.2/lib/debug/console.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def history
143143
rescue LoadError
144144
def readline prompt
145145
print prompt
146-
gets
146+
$stdin.gets
147147
end
148148

149149
def history

lib/gems/gems/debug-1.9.1/lib/debug/irb_integration.rb lib/gems/gems/debug-1.9.2/lib/debug/irb_integration.rb

+10
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,14 @@ def activate_irb_integration
2424
IRB::Context.prepend(IrbPatch)
2525
end
2626
end
27+
28+
class Session
29+
def deactivate_irb_integration
30+
Reline.completion_proc = nil
31+
Reline.output_modifier_proc = nil
32+
Reline.autocompletion = false
33+
Reline.dig_perfect_match_proc = nil
34+
reset_ui UI_LocalConsole.new
35+
end
36+
end
2737
end

lib/gems/gems/debug-1.9.1/lib/debug/prelude.rb lib/gems/gems/debug-1.9.2/lib/debug/prelude.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Put the following line in your login script (e.g. ~/.bash_profile) with modified path:
77
#
8-
# export RUBYOPT="-r /path/to/debug/prelude $(RUBYOPT)"
8+
# export RUBYOPT="-r /path/to/debug/prelude ${RUBYOPT}"
99
#
1010
module Kernel
1111
def debugger(*a, up_level: 0, **kw)

0 commit comments

Comments
 (0)