Commit graph

16692 commits

Author SHA1 Message Date
Rick Blommers
610375edfc [ruby/timeout] Don't move the timer_thread when it's enclosed
Don't move the timer_thread to ThreadGroup::Default, when it's
created in an enclosed ThreadGroup.
Prevents the exception: "add" can't move from the enclosed thread group"

eb889d2c8b
2023-02-15 19:25:05 +00:00
dependabot[bot]
e5e506095c [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.61 to 0.9.64.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.61...v0.9.64)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-14 13:59:32 +00:00
Nobuyoshi Nakada
45f0e3a673
[Bug #19259] Data#with should call initialize method 2023-02-14 12:02:07 +09:00
tomoya ishida
f313514563 [ruby/irb] Fix colorize backtick symbol
(https://github.com/ruby/irb/pull/508)

dd7f25cd45

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-02-12 20:27:32 +00:00
Koichi Sasada
be94808282 use correct svar even if env is escaped
This patch is follo-up of 0a82bfe.
Without this patch, if env is escaped (Proc'ed), strange svar
can be touched.

This patch tracks escaped env and use it.
2023-02-10 17:55:25 +09:00
Satadru Pramanik, DO, MPH, MEng
94aed6ece5 [ruby/fileutils] Add mkdir_p to FileUtils.install
(https://github.com/ruby/fileutils/pull/104)

* Add mkdir_p to FileUtils.install

* Adjust raise message.

* adjust raise language

* handle trailing slash in dest

* simplify

* Add tests
2023-02-10 03:37:39 +00:00
Mike Perham
194520f80e [ruby/logger] Add Logger#with_level{...} for block-scoped log level.
(https://github.com/ruby/logger/pull/85)

* Update lib/logger/severity.rb

7aabb0b4aa
2023-02-10 01:08:49 +00:00
eileencodes
b9e6580135 Copy cvar table on clone
When a class with a class variable is cloned we need to also copy the
cvar cache table from the original table to the clone. I found this bug
while working on fixing [Bug #19379]. While this does not fix that bug
directly it is still a required change to fix another bug revealed by
the fix in https://github.com/ruby/ruby/pull/7265

This needs to be backported to 3.2.x and 3.1.x.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-02-09 11:24:32 -08:00
Stan Lo
970e7cdec3 [ruby/irb] Make tests more compatible with TruffleRuby
(https://github.com/ruby/irb/pull/514)

* Improve encoding error test case

The test input IRB currently uses happen to hit a compatibility bug in
TruffleRuby, which has been documented in
https://github.com/oracle/truffleruby/issues/2848

Although it'll eventually be fixed, we can make the test case support TruffleRuby
now by tweaking it just a little bit.

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>

* Remove redundant TruffleRuby omits/pends

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>

* Use a different way to test warning emission

The test case was added in d08ef68d2d
to verify that IRB emits Ruby warning as expected.

But the subject it uses relies on CRuby's regexp engine, which isn't always
used in other language implementations, like TruffleRuby. That's why we
ended up skipping TruffleRuby in this test case.

Since the test isn't about regexp itself, we can change the testing subject
and just remove the special condition for TruffleRuby.

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>

---------

6fdf4f3e97

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
2023-02-09 15:33:37 +00:00
Nobuyoshi Nakada
da4464b824
[Bug #19426] Fix endless Range#step with #succ method 2023-02-09 20:37:34 +09:00
Jean byroot Boussier
8ce2fb9bbb Only emit circular dependency warning for owned thread shields
[Bug #19415]

If multiple threads attemps to load the same file concurrently
it's not a circular dependency issue.

So we check that the existing ThreadShield is owner by the current
fiber before warning about circular dependencies.
2023-02-08 09:50:00 +01:00
Jean Boussier
3ab3455145 Add RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS to pre-init pools granularly
The old RUBY_GC_HEAP_INIT_SLOTS isn't really usable anymore as
it initalize all the pools by the same factor, but it's unlikely
that pools will need similar sizes.

In production our 40B pool is 5 to 6 times bigger than our 80B pool.
2023-02-08 09:26:07 +01:00
Jean Boussier
1e71143976 Use more agressive RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR for GC tests 2023-02-07 22:33:12 +01:00
dependabot[bot]
c84184d50b [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.58 to 0.9.61.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.58...v0.9.61)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 23:38:12 +00:00
zzak
773d56b1c1 [ruby/rdoc] Add test coverage for -C flag
564be08f4b
2023-02-06 23:09:06 +00:00
Jean byroot Boussier
c19defd026 Revert "Only emit circular dependency warning for owned thread shields"
This reverts commit fa49651e05.
2023-02-06 23:30:35 +01:00
Jean Boussier
fa49651e05 Only emit circular dependency warning for owned thread shields
[Bug #19415]

If multiple threads attemps to load the same file concurrently
it's not a circular dependency issue.

So we check that the existing ThreadShield is owner by the current
fiber before warning about circular dependencies.
2023-02-06 19:35:38 +01:00
Jemma Issroff
28da990984 Limit maximum number of IVs on a shape on T_OBJECTS
Create SHAPE_MAX_NUM_IVS (currently 50) and limit all shapes of
T_OBJECTS to that number of IVs. When a shape with a T_OBJECT has more than 50 IVs, fall back to the
obj_too_complex shape which uses hash lookup for ivs.

Note that a previous version of this commit
78fcc9847a was reverted in
88f2b94065 because it did not account for
non-T_OBJECTS
2023-02-06 08:40:51 -08:00
tompng
91f353b1c3 [ruby/reline] Fix line rendering when newline is added at the end of the buffer
7d61b3df9a
2023-02-06 14:23:59 +00:00
Sorah Fukumori
8a29419b7f [ruby/reline] test_dumb_terminal: "ruby" command is not always available
Fixes the same issue at https://github.com/ruby/ruby/pull/5417

`ruby` is not always available in certain build environments and
configure options (e.g. --program-suffix)

This patch tries to choose an appropriate command line for spawning a
fresh Ruby process, based on EnvUtil implementation in ruby/ruby's test
suite.

Plus when this library is directly mirrored into ruby/ruby, prefer EnvUtil
available there over the implementation in this library's test suite.

278327d2e9
2023-02-05 20:31:37 +00:00
Stan Lo
295fc59eda [ruby/irb] Add tests for workspaces commands
(https://github.com/ruby/irb/pull/512)

874dbcad81
2023-02-04 22:31:17 +00:00
Nobuyoshi Nakada
0a02c51a06 [rubygems/rubygems] Ensure that TempIO is closed
0cbb7b5370
2023-02-04 19:38:55 +00:00
Nobuyoshi Nakada
e37bf46ed5 [rubygems/rubygems] Fix Tempfile leaks
f95d1a87ce
2023-02-04 19:38:55 +00:00
zzak
e04d20bc48 [ruby/rdoc] Add rdoc:coverage default task
157fbaf575
2023-02-03 23:41:06 +00:00
Martin Emde
0853703ec6 [rubygems/rubygems] Test to show non-standard behavior of zero byte files in archive
Added more tests for some of the other behavior as well.
Tests were missing for readpartial with a buffer, and reading
remaining bytes after a partial read, using StringIO as reference.

d600a657b1
2023-02-02 17:17:33 +00:00
Takashi Kokubun
1c5bd01363
Add a test for svar #7225 (#7228) 2023-02-01 21:47:45 -08:00
Nobuyoshi Nakada
fad48fefe1 [Bug #19399] Parsing invalid heredoc inside block parameter
Although this is of course invalid as Ruby code, allow to just parse
and tokenize.
2023-02-02 12:20:10 +09:00
Peter Zhu
c6f84e9189 [Bug #19398] Memory leak in WeakMap
There's a memory leak in ObjectSpace::WeakMap due to not freeing
the `struct weakmap`. It can be seen in the following script:

```
100.times do
  10000.times do
    ObjectSpace::WeakMap.new
  end

  # Output the Resident Set Size (memory usage, in KB) of the current Ruby process
  puts `ps -o rss= -p #{$$}`
end
```
2023-02-01 13:23:55 -05:00
Hiroshi SHIBATA
375f527ded [rubygems/rubygems] Introduce to specify deprecated version for rubygems_deprecate_command.
We sometimes to remove minor command without bumping major version. This feature
  helps this deprecation process.

41301cd2a8
2023-02-01 16:44:55 +00:00
Takashi Kokubun
e11067ebbf
YJIT: Fix BorrowMutError on BOP invalidation (#7212) 2023-01-31 15:26:56 -05:00
Charles Oliver Nutter
29133794a3
[ruby/psych] Update for stricter 1.2 syntax
This allows these tests to pass on SnakeYAML Engine -- which is a
1.2-only YAML library -- while still passing on libyaml 1.1.

f44269fc9b
2023-01-31 13:14:05 +09:00
David Rodríguez
022acb9593 [rubygems/rubygems] Don't load Bundler from RubyGems tests
c2e4cb7b5e
2023-01-31 10:49:08 +09:00
Nobuyoshi Nakada
3a7367ccc3 mkconfig: Map includedir only for system ruby
Only when installing to the system path on macOS, prepend '$(SDKROOT)'
and remap `includedir`.
Fix https://github.com/rbenv/ruby-build/discussions/2123
2023-01-31 06:33:16 +09:00
Takashi Kokubun
2e0f3b5546
YJIT: Fix BorrowMutError on GC.compact (#7176)
YJIT: Fix BorrowMutError
2023-01-30 11:16:33 -08:00
Mat Sadler
b4defea362 [rubygems/rubygems] install rust extensions into expected directory nesting
85ea86d348
2023-01-30 17:39:47 +00:00
Mat Sadler
ca951f6719 [rubygems/rubygems] use cargo to get crate name
the final copying of the extension into place has been slimmed
down, reflecting that it only needs to copy a single file, rather
than replicating the more involved process used for a C ext

this also refactors #build so that #cargo_crate_name only needs
to be called once, and hopefully the build flow is easier to
understand

5a0d7f2e6c
2023-01-30 17:39:47 +00:00
Mat Sadler
0c2b43462f [rubygems/rubygems] remove unused files in cargo builder test fixtures
233847513b
2023-01-30 17:39:46 +00:00
Jeremy Evans
eccfc978fd Fix parsing of regexps that toggle extended mode on/off inside regexp
This was broken in ec3542229b. That commit
didn't handle cases where extended mode was turned on/off inside the
regexp.  There are two ways to turn extended mode on/off:

```
/(?-x:#y)#z
/x =~ '#y'

/(?-x)#y(?x)#z
/x =~ '#y'
```

These can be nested inside the same regexp:

```
/(?-x:(?x)#x
(?-x)#y)#z
/x =~ '#y'
```

As you can probably imagine, this makes handling these regexps
somewhat complex. Due to the nesting inside portions of regexps,
the unassign_nonascii function needs to be recursive.  In
recursive mode, it needs to track both opening and closing
parentheses, similar to how it already tracked opening and
closing brackets for character classes.

When scanning the regexp and coming to `(?` not followed by `#`,
scan for options, and use `x` and `i` to determine whether to
turn on or off extended mode.  For `:`, indicting only the
current regexp section should have the extended mode
switched, recurse with the extended mode set or unset. For `)`,
indicating the remainder of the regexp (or current regexp portion
if already recursing) should turn extended mode on or off, just
change the extended mode flag and keep scanning.

While testing this, I noticed that `a`, `d`, and `u` are accepted
as options, in addition to `i`, `m`, and `x`, but I can't see
where those options are documented.  I'm not sure whether or not
handling  `a`, `d`, and `u` as options is a bug.

Fixes [Bug #19379]
2023-01-30 08:51:12 -08:00
Jean Boussier
3f54d09a5b bignum.c: rb_int_parse_cstr handle 0 strings
[Bug #19390]

We shouldn't check the string length when skipping zeros, as the
string might only contains zero characters, resulting in an empty string.
2023-01-30 14:42:40 +01:00
Hiroshi SHIBATA
b432867429
Skip OpenSSL::TestHMAC#test_dup when running with RHEL9 2023-01-30 16:55:14 +09:00
Nobuyoshi Nakada
21dced8b01 [ruby/stringio] [Bug #19389] Fix chomping with longer separator
eb322a9716
2023-01-28 13:00:08 +00:00
Benoit Daloze
47b66a5acd [ruby/bigdecimal] Add truffleruby in CI
5a25e26e08
2023-01-27 11:07:06 +00:00
Hiroshi SHIBATA
967dec5d61
[ruby/openssl] Added CoreAssertions
520601e11d

  This commits swtich to use ruby/ruby's envutil.rb instead of
  vendored in openssl repo.
2023-01-27 11:30:13 +09:00
Andrew Konchin
5afc830130
[ruby/openssl] Do not require test file in a forked process in tests
ae784673d7
2023-01-27 11:30:13 +09:00
Samuel Giddins
70829928cb [rubygems/rubygems] Deprecate Gem::List
It is unused, we will remove it in the next major version

c3f6c27d6d
2023-01-26 21:41:48 +00:00
Nobuyoshi Nakada
5a73e131d7 Add tests for variables in END block shared with the toplevel 2023-01-24 16:36:33 +09:00
dependabot[bot]
98081ac7cc [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.56 to 0.9.58.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.56...v0.9.58)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-24 01:35:42 +00:00
dependabot[bot]
e23e8f4a6b [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.56 to 0.9.58.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.56...v0.9.58)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-23 22:14:19 +00:00
Jean Boussier
8fded5f5d1 [ruby/psych] Fix RestrictedYAMLTree allowing the Symbol class should allow all symbols
Ref: https://github.com/ruby/psych/pull/495

That's how it works for `safe_load`:
```ruby
>> YAML.safe_load(':foo', permitted_classes: [Symbol])
=> :foo
```

So `safe_dump` should mirror that.

592a75a656
2023-01-23 02:07:23 +00:00
Kouhei Yanagita
20a85ab611
Fix Integer#ceildiv to respect #coerce (#7118)
Fixes [Bug #19343]
2023-01-22 18:53:02 +09:00