Граф коммитов

82143 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun b266890dab
YJIT: Add --yjit-disable to help and reorder it (#9230) 2023-12-13 13:29:37 -08:00
Martin Emde 7f4b271a61 [rubygems/rubygems] Store Checksum::Store indexed by spec.lock_name
https://github.com/rubygems/rubygems/commit/34d6c6c72f
2023-12-13 20:28:37 +00:00
Takashi Kokubun 14c7895c21 Fix a typo in yjit.md 2023-12-13 11:50:35 -08:00
Ufuk Kayserilioglu 31c0ea20e5 [PRISM] Add a test with a non-static-literal hash key 2023-12-13 14:15:09 -05:00
Samuel Giddins 6aa26af683 [rubygems/rubygems] Add 3.4 as a supported ruby version
Since ruby trunk will be 3.4 very soon

https://github.com/rubygems/rubygems/commit/36dd9a35dc
2023-12-13 19:02:24 +00:00
eileencodes 110dbf62ac [Prism] Fix InterpolatedMatchLastLine Instructions
I looked at this at RubyConf with Kevin, and we noticed that there was a
`putobject` empty string missing from the instructions. I just got back
around to implementing this and pushing a PR and while doing that
noticed that we also have a `getspecial` when we want a `getglobal`.

This change adds the `putobject` instruction and replaces the
`getspecial` with a `getglobal`. If we look at the parsetree for the
following code:

```ruby
$pit = '.oo'; if /"#{$pit}"/mix; end
```

We can see it has a `NODE_GVAR` and the [Ruby
compiler](a4b43e9264/compile.c (L10024-L10030)) shows that should
use `getglobal.

```
 @ NODE_SCOPE (id: 14, line: 1, location: (1,0)-(22,36))
 +- nd_tbl: (empty)
 +- nd_args:
 |   (null node)
 +- nd_body:
     @ NODE_BLOCK (id: 12, line: 22, location: (22,0)-(22,36))
     +- nd_head (1):
     |   @ NODE_GASGN (id: 0, line: 22, location: (22,0)-(22,12))*
     |   +- nd_vid: :$pit
     |   +- nd_value:
     |       @ NODE_STR (id: 1, line: 22, location: (22,7)-(22,12))
     |       +- nd_lit: ".oo"
     +- nd_head (2):
         @ NODE_IF (id: 11, line: 22, location: (22,14)-(22,36))*
         +- nd_cond:
         |   @ NODE_MATCH2 (id: 10, line: 22, location: (22,14)-(22,36))
         |   +- nd_recv:
         |   |   @ NODE_DREGX (id: 2, line: 22, location: (22,17)-(22,31))
         |   |   +- nd_lit: "\""
         |   |   +- nd_next->nd_head:
         |   |   |   @ NODE_EVSTR (id: 4, line: 22, location: (22,19)-(22,26))
         |   |   |   +- nd_body:
         |   |   |       @ NODE_GVAR (id: 3, line: 22, location: (22,21)-(22,25))
         |   |   |       +- nd_vid: :$pit
         |   |   +- nd_next->nd_next:
         |   |       @ NODE_LIST (id: 7, line: 22, location: (22,26)-(22,27))
         |   |       +- as.nd_alen: 1
         |   |       +- nd_head:
         |   |       |   @ NODE_STR (id: 6, line: 22, location: (22,26)-(22,27))
         |   |       |   +- nd_lit: "\""
         |   |       +- nd_next:
         |   |           (null node)
         |   +- nd_value:
         |       @ NODE_GVAR (id: 9, line: 22, location: (22,14)-(22,36))
         |       +- nd_vid: :$_
         +- nd_body:
         |   @ NODE_BEGIN (id: 8, line: 22, location: (22,32)-(22,32))
         |   +- nd_body:
         |       (null node)
         +- nd_else:
             (null node)
```

I'm struggling with writing a failing test, but the before/after
instructions show that `getglobal` is correct here. I compared the
instructions for the  other `InterpolatedMatchLastLine` node tests
and they also used `getglobal`. I've edited the existing
`InterpolatedLastMatchLineNode` test so that it will use that instruction when
copied out of the test. Without the quotes it thinks it's just a
`MatchLastLineNode`.

Incorrect instructions:

```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(22,36)>
0000 putstring                              ".oo"                     (  22)[Li]
0002 setglobal                              :$pit
0004 putobject                              "\""
0006 getglobal                              :$pit
0008 dup
0009 objtostring                            <calldata!mid:to_s, argc:0, FCALL|ARGS_SIMPLE>
0011 anytostring
0012 putobject                              "\""
0014 toregexp                               7, 3
0017 getglobal                              :$_
0019 send                                   <calldata!mid:=~, argc:1, ARGS_SIMPLE>, nil
0022 branchunless                           30
0024 jump                                   26
0026 putnil
0027 jump                                   31
0029 pop
0030 putnil
0031 leave

"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:21 (21,0)-(21,36)>
0000 putstring                              ".oo"                     (  21)[Li]
0002 setglobal                              :$pit
0004 putobject                              "\""
0006 getglobal                              :$pit
0008 dup
0009 objtostring                            <calldata!mid:to_s, argc:0, FCALL|ARGS_SIMPLE>
0011 anytostring
0012 putobject                              "\""
0014 toregexp                               7, 3
0017 getspecial                             0, 0
0020 send                                   <calldata!mid:=~, argc:1, ARGS_SIMPLE>, nil
0023 branchunless                           31
0025 jump                                   27
0027 putnil
0028 jump                                   32
0030 pop
0031 putnil
0032 leave
```

Fixed instructions:

```
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(22,36)>
0000 putstring                              ".oo"                     (  22)[Li]
0002 setglobal                              :$pit
0004 putobject                              "\""
0006 getglobal                              :$pit
0008 dup
0009 objtostring                            <calldata!mid:to_s, argc:0, FCALL|ARGS_SIMPLE>
0011 anytostring
0012 putobject                              "\""
0014 toregexp                               7, 3
0017 getglobal                              :$_
0019 send                                   <calldata!mid:=~, argc:1, ARGS_SIMPLE>, nil
0022 branchunless                           30
0024 jump                                   26
0026 putnil
0027 jump                                   31
0029 pop
0030 putnil
0031 leave

"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:21 (21,0)-(21,36)>
0000 putstring                              ".oo"                     (  21)[Li]
0002 setglobal                              :$pit
0004 putobject                              "\""
0006 getglobal                              :$pit
0008 dup
0009 objtostring                            <calldata!mid:to_s, argc:0, FCALL|ARGS_SIMPLE>
0011 anytostring
0012 putobject                              "\""
0014 toregexp                               7, 3
0017 getglobal                              :$_
0019 send                                   <calldata!mid:=~, argc:1, ARGS_SIMPLE>, nil
0022 branchunless                           30
0024 jump                                   26
0026 putnil
0027 jump                                   31
0029 pop
0030 putnil
0031 leave
```
2023-12-13 13:42:17 -05:00
Takashi Kokubun ea4a4c302c [PRISM] Fix a -Wformat-zero-length warning
../prism_compile.c: In function ‘pm_compile_node’:
../prism_compile.c:2330:20: warning: zero-length gnu_printf format string [-Wformat-zero-length]
 2330 |             rb_bug("");
      |                    ^~
2023-12-13 10:28:20 -08:00
John Hawthorn 02528f647d [PRISM] Use xcalloc for iseq id table
We use xfree on the other end, so we need to use a form of xmalloc here.

Co-authored-by: Matthew Draper <matthew@trebex.net>
2023-12-13 10:20:11 -08:00
John Hawthorn b55de590f3 [PRISM] Fix st_table memory leak
Co-authored-by: Matthew Draper <matthew@trebex.net>
2023-12-13 10:20:11 -08:00
Alan Wu a3b48ac9ad Fix memory leak in Hash#compare_by_identity
We didn't free the old ST before overwriting it which caused a leak.
Found with RUBY_FREE_ON_EXIT.

Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2023-12-13 09:43:09 -08:00
Takashi Kokubun cc86fa8416 Skip an unstable test on MinGW
This test fails fairly frequently on MinGW:
https://github.com/ruby/ruby/actions/runs/7195712496/job/19598924253#step:11:168
https://github.com/ruby/ruby/actions/runs/7191246799/job/19585627182#step:11:168

and we aren't actively working on stabilizing tests for MinGW.
2023-12-13 09:40:54 -08:00
Takashi Kokubun 0f1c7e3bcb
RJIT: Just skip generating code for aarch64/arm64 (#9221) 2023-12-13 09:36:06 -08:00
tomoya ishida c83a648fc8 [ruby/irb] Remove unused lvar in mesure command test
(https://github.com/ruby/irb/pull/814)

https://github.com/ruby/irb/commit/320178b120
2023-12-13 17:05:35 +00:00
David Rodríguez a4b43e9264 [rubygems/rubygems] Add missing resolv, timeout, and net-protocol licenses
https://github.com/rubygems/rubygems/commit/00694651a3
2023-12-13 15:47:43 +00:00
Peter Zhu f8ddcecbdf [Bug #20061] Clear mark bits when rb_free_on_exit
When compiling with cppflags=-DRGENGC_CHECK_MODE, the following crashes:

```
$ RUBY_FREE_ON_EXIT=1 ./miniruby -e 0
-e: [BUG] obj_free: RVALUE_MARKED(0x0000000103570020 [3LM    ] T_CLASS (anon)) != FALSE
```

This commit clears the mark bits when rb_free_on_exit is enabled.
2023-12-13 10:39:06 -05:00
Jeremy Evans 0d53dba7ce Make String#chomp! raise ArgumentError for 2+ arguments if string is empty
String#chomp! returned nil without checking the number of passed
arguments in this case.
2023-12-13 07:05:21 -08:00
Jeremy Evans c42e4a38e9 Fix tool/ln_sr.rb passing 2 arguments to String#chomp!
I'm guessing String#sub! was desired here.
2023-12-13 07:05:21 -08:00
Matt Valentine-House 9eba7a0892 [PRISM] Break nodes should add an entry to the parent catch table 2023-12-13 09:33:07 -05:00
Matt Valentine-House cb8a9851ca [PRISM] Remove errant NOP when redo_label is set 2023-12-13 09:33:07 -05:00
Matt Valentine-House 9267dbdd7a [PRISM] Generate instruction for when redo_label is set 2023-12-13 09:33:07 -05:00
Ufuk Kayserilioglu f390c51b15 [PRISM] Use `PM_KEYWORD_HASH_NODE_FLAGS_STATIC_KEYS` flag in compiler 2023-12-13 08:16:11 -05:00
Jemma Issroff 798a89fae1 [PRISM] If receiver on CallNode is SelfNode, use FCALL flags 2023-12-13 08:11:45 -05:00
eileencodes 1ad991c54d [PRISM] Fix attrset edge cases
In some cases code may look like an attrset ID but should actually
return the value of the method, not the passed values.

In ruby/prism#2051 a flag was added when we have a attribute write call.
I used this flag to add the proper instructions when we have a real
attrset instead of using `rb_is_attrset_id` which was kind of hacky
anyway.

The value that should be returned in the newly added test is 42, not 2.
Previously the changes we had made returned 2.

Related to ruby/prism#1715
2023-12-13 08:11:21 -05:00
Alex Koval 36ca99b343 [ruby/prism] fix typo in docs
https://github.com/ruby/prism/commit/d7fbc09345
2023-12-13 12:17:57 +00:00
tomoya ishida 745ab3e4c7 [ruby/irb] Warn and do nothing if block is passed to measure command
(https://github.com/ruby/irb/pull/813)

https://github.com/ruby/irb/commit/e79a90a1e6
2023-12-13 11:06:26 +00:00
Hiroshi SHIBATA a7ad9f3836
We need only one line for detecting caller gem name 2023-12-13 17:30:48 +09:00
Takashi Kokubun e282d7b880 Avoid warning --jit when only YJIT is enabled 2023-12-13 00:05:12 -08:00
Nobuyoshi Nakada 75f4a687ed
Fix a typo for `RJIT_TARGET_OK` (#8222) 2023-12-12 23:28:22 -08:00
Takashi Kokubun 20a09387d1 Skip a GC test for RJIT
It randomly fails like this:
https://github.com/ruby/ruby/actions/runs/7191443542/job/19586164973
2023-12-12 23:24:19 -08:00
git f49097c842 Update default gems list at 5f5f8dbbb6 [ci skip] 2023-12-13 06:12:18 +00:00
Hiroshi SHIBATA 5f5f8dbbb6 [ruby/resolv] Bump up 0.3.0
https://github.com/ruby/resolv/commit/22153c2a45
2023-12-13 15:11:21 +09:00
git a66d083bbf Update default gems list at 39023792db [ci skip] 2023-12-13 05:59:13 +00:00
Hiroshi SHIBATA 39023792db [ruby/io-console] Bump up 0.7.0
https://github.com/ruby/io-console/commit/3e5586e632
2023-12-13 05:58:25 +00:00
git caef4e98cb Update default gems list at 06edde22f4 [ci skip] 2023-12-13 05:43:52 +00:00
Hiroshi SHIBATA 06edde22f4 [ruby/io-nonblock] Bump up 0.3.0
https://github.com/ruby/io-nonblock/commit/501e2ffea3
2023-12-13 05:42:58 +00:00
git 02f0aa6137 Update default gems list at 5cabe1e9cc [ci skip] 2023-12-13 05:11:39 +00:00
Hiroshi SHIBATA 5cabe1e9cc [ruby/io-wait] Bump up 0.3.1
https://github.com/ruby/io-wait/commit/5ec3db36c8
2023-12-13 05:10:54 +00:00
git 8a8fd32e13 Update default gems list at 12c775c942 [ci skip] 2023-12-13 05:02:01 +00:00
Hiroshi SHIBATA 12c775c942 [ruby/etc] Bump up 1.4.3
https://github.com/ruby/etc/commit/743c26086d
2023-12-13 05:01:16 +00:00
David Rodríguez ac939d9ca3 [rubygems/rubygems] Improve default gem handling
If a gem is specified in the Gemfile (or resolved as a transitive
dependency), it's always resolved from remote/installed sources. Default
gems are only used as a fallback for gems not included in the bundle.

I believe this leads to more consistent behavior and more portable apps,
since all gems will be installed to the configured bundle path,
regardless of whether they are default gems or not.

https://github.com/rubygems/rubygems/commit/091b4fcf2b
2023-12-13 13:02:22 +09:00
David Rodríguez 1a7aa5560f [rubygems/rubygems] Refactor `bundle info`
https://github.com/rubygems/rubygems/commit/0e919eaa87
2023-12-13 13:02:22 +09:00
David Rodríguez 70428247c6 [rubygems/rubygems] Remove dead code
https://github.com/rubygems/rubygems/commit/fad186df39
2023-12-13 13:02:21 +09:00
David Rodríguez 6b3c9cebe9 Normalize bundler bindir
This makes bundler consistent with all other gems, and makes the default
installation of Bundler in the release package look like any other
bundler installation.

Before (on preview3, for example), Bundler executable is installed at:

lib/ruby/gems/3.3.0+0/gems/bundler-2.5.0.dev/libexec/bundle

Now it's installed in the standard location:

lib/ruby/gems/3.3.0+0/gems/bundler-2.5.0.dev/exe/bundle
2023-12-13 12:59:23 +09:00
Hiroshi SHIBATA 866b6fcd69 RubyGems 3.5+ will use vendored net-http 2023-12-13 12:16:55 +09:00
Hiroshi SHIBATA 5015481e53 Removed duplicated LICENSE file 2023-12-13 12:16:55 +09:00
Vít Ondruch befbcfd90c [rubygems/rubygems] Explain the 3 states `options[:user_install]` can have.
This was issue previously, so hopefully this comment tries to state this
explicitly for future readers.

https://github.com/rubygems/rubygems/commit/8ccd830f85
2023-12-13 12:16:55 +09:00
Vít Ondruch 1fa5dd883e [rubygems/rubygems] Test if the user dir is used for auto user installation
This is mainly to align this test case with the
`test_process_options_does_not_fallback_to_user_install_when_gem_home_
not_writable_and_no_user_install`, where the `install_dir` is checked
already.

https://github.com/rubygems/rubygems/commit/02b1884b61
2023-12-13 12:16:55 +09:00
Vít Ondruch 402fd96ddc [rubygems/rubygems] Make sure `--no-user-install` is respected for auto user installation
The `options[:user_install]` might have three states:
* `true`: `--user-install`
* `false`: `--no-user-install` and
* `nil`: option was not specified

However, this had not been respected previously and the `false` and `nil`
were treated the same. This could lead to auto user installation despite
`--no-user-install` being specified on the command line.

Fixes https://github.com/rubygems/rubygems/pull/7237

https://github.com/rubygems/rubygems/commit/9281545474
2023-12-13 12:16:55 +09:00
David Rodríguez 844759ccdb [rubygems/rubygems] Add a spec to cover what vendoring timeout fixes
https://github.com/rubygems/rubygems/commit/2662e45d75
2023-12-13 12:16:55 +09:00
David Rodríguez 5323935f57 [rubygems/rubygems] Remove no longer needed gem install during test
https://github.com/rubygems/rubygems/commit/bdb78d8289
2023-12-13 12:16:55 +09:00