Commit graph

16692 commits

Author SHA1 Message Date
dependabot[bot]
382cde96fa [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.20 to 0.9.26.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.20...v0.9.26)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

fe76234cf1
2022-07-26 04:56:40 +09:00
dependabot[bot]
fab5a0e62a [rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.20 to 0.9.26.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.20...v0.9.26)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

8b1d0672a3
2022-07-26 01:53:02 +09:00
Nobuyoshi Nakada
f61dd38e5c
Wait the test thread to sleep
Revert "Synchronize the test thread sleep"

This reverts commit 307835fe31.
2022-07-25 18:50:08 +09:00
Nobuyoshi Nakada
307835fe31
Synchronize the test thread sleep 2022-07-25 12:01:09 +09:00
Ashley Ellis Pierce
244bda7efd [rubygems/rubygems] Display mfa warnings on gem signin
4dc77b7099

Co-authored-by: Jenny Shen <jenny.shen@shopify.com>
2022-07-23 03:42:59 +09:00
st0012
b3be030740 [ruby/reline] Rename dialog_pointer_* to dialog_highlight_*
"Pointer" is not what we usually use to describe a selected item.

"Highlight" is a more common word for the scenario so we should use it instead.

b4279d1557
2022-07-22 23:34:49 +09:00
Nobuyoshi Nakada
a4e890b93e [rubygems/rubygems] Use SystemExit#status as exit_code
No reasons to manage separately.

8ede5c886e
2022-07-22 21:01:31 +09:00
Takuya Noguchi
d7ffd3fea4
RubyGems: Enable Style/StringLiterals cop
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-07-22 12:07:23 +09:00
Nobuyoshi Nakada
cf7d07570f
Dump non-ASCII char as unsigned
Non-ASCII code may be negative on platforms plain char is signed.
2022-07-22 09:56:48 +09:00
Jeremy Evans
7223c0da15 Do not chomp trailing line separator IO#each with nil separator and chomp
nil separator means no sepator, so chomp should not remove a line
separator.

Partially Fixes [Bug #18770]
2022-07-21 12:55:24 -07:00
Jean byroot Boussier
f0ae583a3d Revert "objspace_dump.c: skip dumping method name if not pure ASCII"
This reverts commit 79406e3600.
2022-07-21 19:56:08 +02:00
Jean Boussier
79406e3600 objspace_dump.c: skip dumping method name if not pure ASCII
Sidekiq has a method named `❨╯°□°❩╯︵┻━┻`which corrupts
heap dumps.

Normally we could just dump is as is since it's valid UTF-8 and need
no escaping. But our code to escape control characters isn't UTF-8
aware so it's more complicated than it seems.

Ultimately since the overwhelming majority of method names are
pure ASCII, it's not a big loss to just skip it.
2022-07-21 18:43:45 +02:00
Jeremy Evans
203f179ce7 Revert "Do not chomp trailing line separator IO#each with nil separator and chomp"
This reverts commit 04f86ad0b5.

This is causing CI issues, reverting for now.
2022-07-21 08:29:50 -07:00
Jeremy Evans
12ac8971a3 Do not have class/module keywords look up ancestors of Object
Fixes case where Object includes a module that defines a constant,
then using class/module keyword to define the same constant on
Object itself.

Implements [Feature #18832]
2022-07-21 08:28:05 -07:00
Jeremy Evans
04f86ad0b5 Do not chomp trailing line separator IO#each with nil separator and chomp
nil separator means no sepator, so chomp should not remove a line
separator.

Partially Fixes [Bug #18770]
2022-07-21 08:13:40 -07:00
Jeremy Evans
423b41cba7 Make String#each_line work correctly with paragraph separator and chomp
Previously, it was including one newline when chomp was used,
which is inconsistent with IO#each_line behavior. This makes
behavior consistent with IO#each_line, chomping all paragraph
separators (multiple consecutive newlines), but not single
newlines.

Partially Fixes [Bug #18768]
2022-07-21 08:02:32 -07:00
Nobuyoshi Nakada
86b29ef877 [ruby/digest] Ignore test_ractor.rb on non-Ractor ruby
352b8c1636
2022-07-21 11:45:48 +09:00
Nobuyoshi Nakada
4a7ecc1bd9 [ruby/digest] Find an available digest algorithm to test
8844716793
2022-07-21 09:58:46 +09:00
Daniel Colson
32e406d6d3 Ensure _id2ref finds symbols with the correct type
Prior to this commit it was possible to call `ObjectSpace._id2ref` with
an offset static symbol object_id and get back a new, incorrectly tagged
symbol:

```
> sensible_sym = ObjectSpace._id2ref(:a.object_id)
=> :a
> nonsense_sym = ObjectSpace._id2ref(:a.object_id + 40)
=> :a
> sensible_sym == nonsense_sym
=> false
```

`nonsense_sym` ends up tagged with `RUBY_ID_INSTANCE` instead of
`RB_ID_LOCAL`. That means we can do silly things like:

```
> foo = Object.new
> foo.instance_variable_set(:a, 123)
(irb):2:in `instance_variable_set': `a' is not allowed as an instance variable name (NameError)
> foo.instance_variable_set(ObjectSpace._id2ref(:a.object_id + 40), 123)
=> 123
> foo.instance_variables
=> [:a]
```

This was happening because `get_id_entry` ignores the tag bits when
looking up the symbol. So `rb_id2str(symid)` would return a value and
then we'd continue on with the nonsense `symid`.

This commit prevents the situation by checking that the `symid` actually
matches what we get back from `get_id_entry`. Now we get a `RangeError`
for the nonsense id:

```
> ObjectSpace._id2ref(:a.object_id)
=> :a
> ObjectSpace._id2ref(:a.object_id + 40)
(irb):1:in `_id2ref': 0x000000000013f408 is not symbol id value (RangeError)
```

Co-authored-by: John Hawthorn <jhawthorn@github.com>
2022-07-20 10:38:44 -07:00
Noah Gibbs
6140edb5df
Match +YJIT in Ruby desc when testing segv (#6141)
In test_bug_reporter and test_rubyoptions we intentionally
test child processes that cause SEGV. We run them with YJIT
if the parent uses YJIT so that the text description
matches the parent RUBY_DESCRIPTION.
2022-07-20 10:48:58 -04:00
David Rodríguez
fa5724cca9 [rubygems/rubygems] Fix ruby setup.rb --destdir /foo modifying global specs
Running a command like that is actually removing any previous default
bundler specs in the default RubyGems installation (outside of destdir).
It should instead only modify destdir.

5ed275383c
2022-07-20 19:55:34 +09:00
David Rodríguez
fae0d60120 [rubygems/rubygems] Refactor destdir checks
ca956c0de2
2022-07-20 19:55:34 +09:00
David Rodríguez
fcfb3ce371 [rubygems/rubygems] More cleanup
6012800a20
2022-07-20 19:55:33 +09:00
David Rodríguez
bdef3c73fe [rubygems/rubygems] Unify common logic
e5434be14c
2022-07-20 19:55:33 +09:00
David Rodríguez
c0aa8ee947 [rubygems/rubygems] Fix casing typo when resetting RbConfig::CONFIG["ENABLE_SHARED"]
3d1ae0050b
2022-07-20 03:03:33 +09:00
Nobuyoshi Nakada
8f17591435 [Bug #18905] Check symbol name types more strictly 2022-07-20 00:23:38 +09:00
Nobuyoshi Nakada
ee1d2b276a [ruby/fileutils] Add an octal prefix to clarify to be octal
332025bc02

Co-Authored-By: David Rodríguez <deivid.rodriguez@riseup.net>
2022-07-19 17:33:44 +09:00
dependabot[bot]
3ac9956dee [rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.19 to 0.9.20.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.19...v0.9.20)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

2689b6b940
2022-07-19 04:46:16 +09:00
dependabot[bot]
c6fe11cf2c [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.19 to 0.9.20.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.19...v0.9.20)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

ee2facb8f2
2022-07-19 02:49:01 +09:00
Peter Zhu
dd362a786a [ruby/rdoc] Fix call-seq for aliased method with similar names
deduplicate_call_seq has a bug that skips call-seq for methods where the
alias is a prefix of the method name. For example, if the alias name is
"each" and the current method name is "each_line", then
deduplicate_call_seq will skip all call-seq for "each_line" since it
will believe that it is for the alias.

1148988ccc
2022-07-18 22:36:57 +09:00
David Rodríguez
a74634de10 [rubygems/rubygems] Fix upgrading RubyGems with a customized Gem.default_dir
16d01f9486
2022-07-18 19:07:55 +09:00
Nobuyoshi Nakada
68903df6f6
[Bug #18922] Normalize time at 24:00:00 UTC 2022-07-18 00:59:27 +09:00
Yuta Saito
fab8f3bde6 [rubygems/rubygems] Stop using /dev/null for silent ui for WASI platform
WASI doesn't guarantee that `/dev/null` is present.
So without this patch, we needed to mount host's `/dev` directory to WASI
guest process to avoid `ENOTCAPABLE` error while `require "bundler/setup"`

e9187ab61f
2022-07-17 19:44:51 +09:00
Nobuyoshi Nakada
d010eba2f4
Fix tests for ABI incompatible binary error messags 2022-07-17 10:18:08 +09:00
Nobuyoshi Nakada
5ae83151b1 [rubygems/rubygems] Drop support for old Gem::Specification versions
`specification_version` method was added before RubyGems 1.0, and
`add_runtime_dependency` method was before 1.2.  These seem aged
enough to remove.

92770c5cd9
2022-07-16 19:33:16 +09:00
Noah Gibbs
aed1539ec5
YJIT: Add send unit tests (#6143)
Add send unit tests for YJIT
2022-07-15 13:52:47 -04:00
st0012
36ca0e58b6 [ruby/reline] Use color name instead of code (integer) in dialog color APIs
As pointed out in the
[comment](https://github.com/ruby/reline/pull/413#issuecomment-1168033973),
the code is actually a control sequence and not only for colors.

To make the dialog color APIs safer to use, we should restrict its
usages and extract away the bg/fg concept from the input.

So in this commit, I made these changes:

1. The dialog_*_bg/fg_color APIs only takes and returns color names (symbol):
  - :black
  - :red
  - :green
  - :yellow
  - :blue
  - :magenta
  - :cyan
  - :white
2. Add additional dialog_*_bg/fg_color_sequence APIs to access the raw code.

b32a977766
2022-07-16 02:30:23 +09:00
Peter Zhu
7424ea184f Implement Objects on VWA
This commit implements Objects on Variable Width Allocation. This allows
Objects with more ivars to be embedded (i.e. contents directly follow the
object header) which improves performance through better cache locality.
2022-07-15 09:21:07 -04:00
Takashi Kokubun
439d31bc77
MJIT: Merge mjit_worker.c back to mjit.c (#6138)
Since #6006, we no longer avoid executing GC on mjit_worker.c and thus
there's no need to carefully change how we write code whether you're in
mjit.c or mjit_worker.c anymore.
2022-07-14 20:34:46 -07:00
Nobuyoshi Nakada
8b64e8f2ed [ruby/set] Get rid of use of Gem::Version
When retrying in ruby's test, it seems possible that `Gem` is not
loaded.

```
  1) Error:
TC_Set_Builtin#test_to_set:
NameError: uninitialized constant TC_Set_Builtin::Gem
    /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:844:in `should_omit?'
    /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:869:in `test_to_set'

  2) Error:
TC_Set_Builtin#test_Set:
NameError: uninitialized constant TC_Set_Builtin::Gem
    /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:844:in `should_omit?'
    /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:849:in
    `test_Set'
```

This is by `Gem::Version` only, just compare as array of integers
instead.

cde0a4bbc7
2022-07-14 17:13:52 +09:00
Jean Boussier
664c23db79 GVL Instrumentation: remove the EXITED count assertion
It's very flaky for some unknown reason. Something we have
an extra EXITED event. I suspect some other test is causing this.
2022-07-13 19:39:31 +02:00
Jean Boussier
268269687c thread/test_instrumentation_api: cleanup all existing threads in setup
We saw the following failure:
```
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/v3/src/trunk-random3/test/-ext-/thread/test_instrumentation_api.rb:25]:
Expected 0..3 to include 4.
```

Which shouldn't happen unless somehow there was a leaked thread.
2022-07-13 14:13:41 +02:00
Hiroshi SHIBATA
437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
Matt Valentine-House
067a5f1a00 [Feature #18901] Don't run size pool move tests without VWA 2022-07-12 08:50:33 -04:00
Matt Valentine-House
214ed4cbc6 [Feature #18901] Support size pool movement for Arrays
This commit enables Arrays to move between size pools during compaction.
This can occur if the array is mutated such that it would fit in a
different size pool when embedded.

The move is carried out in two stages:

1. The RVALUE is moved to a destination heap during object movement
   phase of compaction
2. The array data is re-embedded and the original buffer free'd if
   required. This happens during the update references step
2022-07-12 08:50:33 -04:00
Nobuyoshi Nakada
0f8a0c5f37 Refactor tests for ThreadInstrumentation counters
* Extracted some assertions.
* Assert counter values should be positive.
2022-07-12 19:43:11 +09:00
Nobuyoshi Nakada
a6e2f3fd8d Use IO.popen to fork and exit the child process without cleanup 2022-07-12 19:43:11 +09:00
dependabot[bot]
6e74c5c268 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.18 to 0.9.19.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.18...v0.9.19)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

962c717083
2022-07-12 04:57:50 +09:00
dependabot[bot]
ea956e5e68 [rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.18 to 0.9.19.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.18...v0.9.19)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

186d2b83f1
2022-07-12 02:52:17 +09:00
Yusuke Endoh
a871fc4d86 Fix a regression of b2e58b02ae
At that commit, I fixed a wrong conditional expression that was always
true.  However, that seemed to have caused a regression. [Bug #18906]

This change removes the condition to make the code always enabled.
It had been enabled until that commit, albeit unintentionally, and even
if it is enabled it only consumes a tiny bit of memory, so I believe it
is harmless. [Bug #18906]
2022-07-11 23:38:37 +09:00