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

16257 Коммитов

Автор SHA1 Сообщение Дата
Kazuki Yamaguchi b69d41e1c4 [ruby/openssl] pkey/ec: check existence of public key component before exporting
i2d_PUBKEY_bio() against an EC_KEY without the public key component
trggers a null dereference.

This is a regression introduced by commit https://github.com/ruby/openssl/commit/56f0d34d63fb ("pkey:
refactor #export/#to_pem and #to_der", 2017-06-14).

Fixes https://github.com/ruby/openssl/pull/527#issuecomment-1220504524
Fixes https://github.com/ruby/openssl/issues/369#issuecomment-1221554057

https://github.com/ruby/openssl/commit/f6ee0fa4de
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 0677b2fb87 [ruby/openssl] pkey: restore support for decoding "openssl ecparam -genkey" output
Scan through the input for a private key, then fallback to generic
decoder.

OpenSSL 3.0's OSSL_DECODER supports encoded key parameters. The PEM
header "-----BEGIN EC PARAMETERS-----" is used by one of such encoding
formats. While this is useful for OpenSSL::PKey::PKey, an edge case has
been discovered.

The openssl CLI command line "openssl ecparam -genkey" prints two PEM
blocks in a row, one for EC parameters and another for the private key.
Feeding the whole output into OSSL_DECODER results in only the first PEM
block, the key parameters, being decoded. Previously, ruby/openssl did
not support decoding key parameters and it would decode the private key
PEM block instead.

While the new behavior is technically correct, "openssl ecparam -genkey"
is so widely used that ruby/openssl does not want to break existing
applications.

Fixes https://github.com/ruby/openssl/pull/535

https://github.com/ruby/openssl/commit/d486c82833
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 10f93a8bd7 [ruby/openssl] pkey/dsa: let PKey::DSA.generate choose appropriate q size
DSA parameters generation via EVP_PKEY_paramgen() will not automatically
adjust the size of q value but uses 224 bits by default unless specified
explicitly. This behavior is different from the now-deprecated
DSA_generate_parameters_ex(), which PKey::DSA.generate used to call.

Fixes https://github.com/ruby/openssl/issues/483

Fixes: https://github.com/ruby/openssl/commit/1800a8d5ebaf ("pkey/dsa: use high level EVP interface to generate parameters and keys", 2020-05-17)

https://github.com/ruby/openssl/commit/0105975a0b
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 65bba0ef6f [ruby/openssl] hmac: use EVP_PKEY_new_raw_private_key() if available
Current OpenSSL 3.0.x release has a regression with zero-length MAC
keys. While this issue should be fixed in a future release of OpenSSL,
we can use EVP_PKEY_new_raw_private_key() in place of the problematic
EVP_PKEY_new_mac_key() to avoid the issue. OpenSSL 3.0's man page
recommends using it regardless:

> EVP_PKEY_new_mac_key() works in the same way as
> EVP_PKEY_new_raw_private_key().  New applications should use
> EVP_PKEY_new_raw_private_key() instead.

Fixes https://github.com/ruby/openssl/issues/369#issuecomment-1224912710

https://github.com/ruby/openssl/commit/4293f18b1f
2022-10-17 16:35:35 +09:00
madblobfish 79543b9a53 [ruby/openssl] ssl: enable generating keying material from SSL sessions
Add OpenSSL::SSL::SSLSocket#export_keying_material to support RFC 5705

https://github.com/ruby/openssl/commit/65530b887e
2022-10-17 16:35:35 +09:00
Nobuhiro IMAI a98096349e [ruby/openssl] Check if the option is an Hash in `pkey_ctx_apply_options0()`
causes SEGV if it is an Array or something like that.

https://github.com/ruby/openssl/commit/ef23525210
2022-10-17 16:35:35 +09:00
MSP-Greg c865e8d161 [ruby/openssl] [CI] TestHMAC#test_dup - remove 'pend' for OpenSSL 3
https://github.com/ruby/openssl/commit/626b0434a6
2022-10-17 16:35:35 +09:00
yui-knk e4191ac1ec Change a tab to spaces 2022-10-17 11:30:07 +09:00
Samuel Williams 52fcb3a724
Add missing `#close` call to `test_dup_timeout` test. (#6560) 2022-10-15 20:04:58 +13:00
Samuel Williams 8a420670a2
Introduce `Fiber::Scheduler#io_select` hook for non-blocking `IO.select`. (#6559) 2022-10-15 19:59:04 +13:00
Aaron Patterson cbd3d65574
Add a test for transition order
We only cache the destination shape id, but that can lead to false cache
hits.  This patch tests that we correctly handle false cache hits
2022-10-14 12:01:42 -07:00
Jonathan Hefner 6061003100 [ruby/delegate] Fix DelegateClass block "method redefined" warning
This commit prevents "method redefined" warnings when overriding methods
within a `DelegateClass` block, such as in the following example:

  ```ruby
  Base = Class.new do
    def foo
      "foo"
    end
  end

  Overridden = DelegateClass(Base) do
    def foo
      super + "!"
    end
  end
  ```

Fixes https://bugs.ruby-lang.org/issues/19047.

https://github.com/ruby/delegate/commit/214fae86de
2022-10-15 00:08:44 +09:00
Samuel Williams d416205341
Copy `IO#timeout` on `IO#dup`. (#6546) 2022-10-15 01:45:51 +13:00
manga_osyo 7b7e5153e8 [ruby/pp] [Feature #19045] Add support Data#pretty_print
https://github.com/ruby/pp/commit/343a20d721
2022-10-14 21:31:24 +09:00
Aaron Patterson e5058b58c2
Only expose Ruby Shape API if VM_CHECK_MODE is enabled 2022-10-13 13:11:01 -07:00
Nobuyoshi Nakada 4b1504ae0a [ruby/uri] Fix splitting relative URI
https://github.com/ruby/uri/commit/ffbab83de6
2022-10-13 16:24:53 +09:00
Samuel Williams 765ee822b5
Add missing `f.resume` to fiber test. (#6539) 2022-10-13 19:04:06 +13:00
NARUSE, Yui dd5118f852
URI.parse should set empty string in host instead of nil 2022-10-13 11:04:06 +09:00
Yusuke Endoh 504e388525 Suppress a "warning: method redefined" in test/ruby/test_method.rb 2022-10-12 21:51:23 +09:00
Yusuke Endoh 9cfc45d6e5 Suppress warnings in test/ruby/test_ast.rb
The tests for error tolerance printed some warnings. This change
suppresses them.
2022-10-12 21:48:28 +09:00
Samuel Williams 04d291a490
Simplify implementation of scheduler `io_read` and `io_write`. (#6527) 2022-10-12 15:56:35 +13:00
Kazuki Yamaguchi 4e29ca0c40
Add :ssl_min_version and :ssl_max_version options
Replace :ssl_version option with these two new options. These provide
access to OpenSSL::SSL::SSLContext#{min,max}_version=, which is the
recommended way to specify SSL/TLS protocol versions.
2022-10-12 10:36:51 +09:00
Samuel Williams ced1d17280
Improvements to IO::Buffer implementation and documentation. (#6525) 2022-10-12 12:59:05 +13:00
Jemma Issroff 913979bede
Make inline cache reads / writes atomic with object shapes
Prior to this commit, we were reading and writing ivar index and
shape ID in inline caches in two separate instructions when
getting and setting ivars. This meant there was a race condition
with ractors and these caches where one ractor could change
a value in the cache while another was still reading from it.

This commit instead reads and writes shape ID and ivar index to
inline caches atomically so there is no longer a race condition.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-10-11 08:40:56 -07:00
Jemma Issroff ad63b668e2
Revert "Revert "This commit implements the Object Shapes technique in CRuby.""
This reverts commit 9a6803c90b.
2022-10-11 08:40:56 -07:00
dependabot[bot] 5ffbb2be18 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.30 to 0.9.31.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.30...v0.9.31)

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

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

https://github.com/rubygems/rubygems/commit/4ad57bacea
2022-10-11 21:29:13 +09:00
dependabot[bot] ccf61c01d5 [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.30 to 0.9.31.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.30...v0.9.31)

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

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

https://github.com/rubygems/rubygems/commit/476490d529
2022-10-11 21:29:01 +09:00
Samuel Williams 1bafa4a59b
Ignore failure to set nonblock mode. (#6524) 2022-10-11 10:18:20 +13:00
Vladimir Dementyev 4954c9fc0f Add MatchData#deconstruct/deconstruct_keys 2022-10-10 12:41:13 +09:00
Nobuyoshi Nakada 546566d34b
Do not set `$!` to `SyntaxError` when error tolerant 2022-10-09 19:07:21 +09:00
Nobuyoshi Nakada d9e2ef6000 Extract `assert_error_tolerant` 2022-10-09 19:05:31 +09:00
Nobuyoshi Nakada f178ff3933
Allow abbreviated dump options with additional options 2022-10-09 16:27:34 +09:00
Nobuyoshi Nakada 43f692248e
Set AST prettyprint width to 80 explicitly
`PrettyPrint` results depend on the `COLUMNS` environment variable by
default.
2022-10-09 16:26:18 +09:00
Peter Zhu b22a2803a8 Fix flaky test test_thrashing_for_young_objects
The test could be flaky when a heap has below GC_HEAP_INIT_SLOTS number
of free slots because it would trigger a major GC and allocate more
pages.
2022-10-08 15:06:30 -04:00
Maciek Rząsa 0f231f2bab [ruby/optparse] Don't treat empty string as an option description
https://github.com/ruby/optparse/commit/078638ee6d
2022-10-08 19:30:34 +09:00
yui-knk 3531086095 "expr_value" can be error
So that "IF" node is kept in the case below

```
def m
  if
end
```

[Feature #19013]
2022-10-08 17:59:11 +09:00
yui-knk 4bfdf6d06d Move `error` from top_stmts and top_stmt to stmt
By this change, syntax error is recovered smaller units.
In the case below, "DEFN :bar" is same level with "CLASS :Foo"
now.

```
module Z
  class Foo
    foo.
  end

  def bar
  end
end
```

[Feature #19013]
2022-10-08 17:59:11 +09:00
yui-knk 4f24f3ea94 Treat "end" as reserved word with consideration of indent
"end" after "." or "::" is treated as local variable or method,
see `EXPR_DOT_bit` for detail.
However this "changes" where `bar` method is defined. In the example
below it is not module Z but class Foo.

```
module Z
  class Foo
    foo.
  end

  def bar
  end
end
```

[Feature #19013]
2022-10-08 17:59:11 +09:00
yui-knk 342d4c16d9 Generates "end" tokens if parser hits end of input
but "end" tokens are needed for correct language.

[Feature #19013]
2022-10-08 17:59:11 +09:00
yui-knk fbbdbdd891 Add error_tolerant option to RubyVM::AST
If this option is enabled, SyntaxError is not raised and Node is
returned even if passed script is broken.

[Feature #19013]
2022-10-08 17:59:11 +09:00
st0012 5b3079a8a5 [ruby/irb] Sort constant completion's candidates
https://github.com/ruby/irb/commit/ee9b33c817
2022-10-08 03:17:42 +09:00
st0012 7be5e9b971 [ruby/irb] Correct assert_equal's usage in completion tests
https://test-unit.github.io/test-unit/en/Test/Unit/Assertions.html#assert_equal-instance_method

https://github.com/ruby/irb/commit/00f90d40ad
2022-10-08 03:17:41 +09:00
st0012 afc1f4fba4 [ruby/irb] Add constant completion test
https://github.com/ruby/irb/commit/39f8fcb058
2022-10-08 03:17:40 +09:00
st0012 3e18bb916f [ruby/irb] Regroup completion tests
https://github.com/ruby/irb/commit/71631287c8
2022-10-08 03:17:39 +09:00
st0012 83a9b91522 [ruby/irb] Add tests for primitive types' method completion
https://github.com/ruby/irb/commit/2e12fac38e
2022-10-08 03:17:38 +09:00
Peter Zhu ad0def7f25 Add more debugging output to test_thrashing_for_young_objects 2022-10-07 09:39:07 -04:00
Samuel Williams e4f91bbdba
Add IO#timeout attribute and use it for blocking IO operations. (#5653) 2022-10-07 21:48:38 +13:00
Hiroshi SHIBATA 4f78560cf1
Add --with-libffi-source-dir feature and removed --enable-bundled-libffi option. (#113)
https://bugs.ruby-lang.org/issues/18571

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2022-10-07 15:20:11 +09:00
Sutou Kouhei 92f0c53934 [ruby/fiddle] test: don't use assert_true/assert_false
GitHub: GH-102

They aren't available in ruby/ruby.

https://github.com/ruby/fiddle/commit/ced671e43b
2022-10-07 15:18:54 +09:00
Sutou Kouhei 9f62768e51 [ruby/fiddle] test: ensure freeing closure
GitHub: GH-102

https://github.com/ruby/fiddle/commit/b2fef1770d
2022-10-07 15:18:53 +09:00
Sutou Kouhei 824c474c95 [ruby/fiddle] test: ensure freeing closure
GitHub: GH-102

This also improves freed closures assertions.

https://github.com/ruby/fiddle/commit/0495624caf
2022-10-07 15:18:53 +09:00
Sutou Kouhei dfca6a8799 [ruby/fiddle] test: don't use power-assert
It seems that we can't use it in ruby/ruby.

https://github.com/ruby/fiddle/commit/e1221297fb
2022-10-07 15:18:52 +09:00
Sutou Kouhei 7c33141293 [ruby/fiddle] test: ensure freeing closure
GitHub: GH-102

This also improves freed closures assertions.

https://github.com/ruby/fiddle/commit/f6431f3cf8
2022-10-07 15:18:52 +09:00
Sutou Kouhei 255e617bc3 [ruby/fiddle] Add Fiddle::Closure.create and Fiddle::Closure.free
GitHub: fix GH-102

It's for freeing a closure explicitly.

We can't use Fiddle::Closure before we fork the process. If we do it,
the process may be crashed with SELinux.

See https://github.com/ruby/fiddle/issues/102#issuecomment-1241763091
for details.

Reported by Vít Ondruch. Thanks!!!

https://github.com/ruby/fiddle/commit/a0ccc6bb1b
2022-10-07 15:18:51 +09:00
Sutou Kouhei 191b91f47a [ruby/fiddle] test: suppress a warning
test/fiddle/test_import.rb:138: warning:
    ambiguous first argument; put parentheses or a space even after `-' operator

https://github.com/ruby/fiddle/commit/060eef76ad
2022-10-07 15:18:51 +09:00
Aaron Patterson 0097c7f388 [ruby/fiddle] Add `sym_defined?` methods to test if a symbol is defined (https://github.com/ruby/fiddle/pull/108)
I would like to check if a symbol is defined before trying to access it.
Some symbols aren't available on all platforms, so instead of raising an
exception, I want to check if it's defined first.

Today we have to do:

```ruby
begin
  addr = Fiddle::Handle.sym("something")
  # do something
rescue Fiddle::DLError
end
```

I want to write this:

```ruby
if Fiddle::Handle.sym_defined?("something")
  addr = Fiddle::Handle.sym("something")
  # do something
end
```

https://github.com/ruby/fiddle/commit/9d3371de13

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2022-10-07 15:18:51 +09:00
Aaron Patterson 755d99e878 [ruby/fiddle] Move "type" constants to `Fiddle::Types` (https://github.com/ruby/fiddle/pull/112)
This helps to reduce repetition in code. Instead of doing "TYPE_*"
everywhere, you can do `include Fiddle::Types`, and write the type name
directly.

This PR is to help reduce repetition when writing Fiddle code. Right now
we have to type `TYPE_` everywhere, and you also have to include all of
`Fiddle` to access `TYPE_*` constants. With this change, you can just
include `Fiddle::Types` and it will shorten your code and also you only
have to include those constants.

Here is an example before:

```ruby
require "fiddle"

module MMAP
  # All Fiddle constants included
  include Fiddle

  def self.make_function name, args, ret
    ptr = Handle::DEFAULT[name]
    func = Function.new ptr, args, ret, name: name
    define_singleton_method name, &func.to_proc
  end

  make_function "munmap", [TYPE_VOIDP, # addr
                           TYPE_SIZE_T], # len
                           TYPE_INT

  make_function "mmap", [TYPE_VOIDP,
                         TYPE_SIZE_T,
                         TYPE_INT,
                         TYPE_INT,
                         TYPE_INT,
                         TYPE_INT], TYPE_VOIDP

  make_function "mprotect", [TYPE_VOIDP, TYPE_SIZE_T, TYPE_INT], TYPE_INT
end
```

After:

```ruby
require "fiddle"

module MMAP
  # Only type names included
  include Fiddle::Types

  def self.make_function name, args, ret
    ptr = Fiddle::Handle::DEFAULT[name]
    func = Fiddle::Function.new ptr, args, ret, name: name
    define_singleton_method name, &func.to_proc
  end

  make_function "munmap", [VOIDP, # addr
                           SIZE_T], # len
                           INT

  make_function "mmap", [VOIDP, SIZE_T, INT, INT, INT, INT], VOIDP

  make_function "mprotect", [VOIDP, SIZE_T, INT], INT
end
```

We only need to import the type names, and you don't have to type
`TYPE_` over and over. I think this makes Fiddle code easier to read.

https://github.com/ruby/fiddle/commit/49fa7233e5

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2022-10-07 15:18:50 +09:00
Aaron Patterson 48a6498406 [ruby/fiddle] Add constants for unsigned values (https://github.com/ruby/fiddle/pull/111)
This commit adds constants for unsigned values. Currently we can use `-`
to mean "unsigned", but I think having a specific name makes Fiddle more
user friendly. This commit continues to support `-`, but introduces
negative constants with "unsigned" names

I think this will help to eliminate [this
code](3a56bf0bcc/lib/mjit/c_type.rb (L31-L38))

https://github.com/ruby/fiddle/commit/2bef0f1082

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2022-10-07 15:18:49 +09:00
Sutou Kouhei 6d01b66764 [ruby/fiddle] test: ensure GC-ing closures
GitHub: fix GH-102

We can't use Fiddle::Closure before we fork the process. If we do it,
the process may be crashed with SELinux.

See https://github.com/ruby/fiddle/issues/102#issuecomment-1241763091
for details.

Reported by Vít Ondruch. Thanks!!!

https://github.com/ruby/fiddle/commit/1343ac7a95
2022-10-07 15:18:49 +09:00
Nobuyoshi Nakada 1b7c5c394f [ruby/date] Fix misplaced time zone offset checks
https://github.com/ruby/date/commit/d21c69450a
2022-10-07 14:41:31 +09:00
Nobuyoshi Nakada a87de5e3c1 [ruby/rdoc] Special characters are prohibited as filename on Windows
https://github.com/ruby/rdoc/commit/13b9da5932
2022-10-07 12:12:10 +09:00
Nobuyoshi Nakada a3cb09c7d1 [ruby/rdoc] Escape file names
https://hackerone.com/reports/1321358

https://github.com/ruby/rdoc/commit/8c07cc4657
2022-10-07 12:12:08 +09:00
Nobuyoshi Nakada 8d0b2162a0 [ruby/rdoc] Escape main title
https://hackerone.com/reports/1187156

https://github.com/ruby/rdoc/commit/5dedb5741d
2022-10-07 12:09:23 +09:00
Nobuyoshi Nakada 586e18b946 [ruby/rdoc] Escape HYPERLINKs
https://github.com/ruby/rdoc/commit/ac35485be6
2022-10-07 12:09:22 +09:00
Nobuyoshi Nakada 9e3ab9da7f [ruby/rdoc] Escape RDOCLINKs
https://hackerone.com/reports/1187156

https://github.com/ruby/rdoc/commit/7cecf1efae
2022-10-07 12:09:21 +09:00
Nobuyoshi Nakada deaa656608 [ruby/rdoc] Escape TIDYLINKs
https://hackerone.com/reports/1187156

https://github.com/ruby/rdoc/commit/1ad2dd3ca2
2022-10-07 12:09:20 +09:00
Peter Zhu 3df904d1a8 Add debug output to test_thrashing_for_young_objects
The test is failing only on trunk-repeat50@phosphorus-docker. This
commit adds some debugging output to debug the failure.
2022-10-06 13:46:31 -04:00
Nobuyoshi Nakada cf3056be69 [ruby/rdoc] Add center align
https://github.com/ruby/rdoc/commit/512cc55a0e
2022-10-06 23:22:02 +09:00
Nobuyoshi Nakada 28e24ce355 [ruby/rdoc] Allow spaces around pipes
https://github.com/ruby/rdoc/commit/3b3a583580
2022-10-06 23:21:16 +09:00
Nobuyoshi Nakada 7c03c82444 [ruby/rdoc] Allow escaped pipes in cells
https://github.com/ruby/rdoc/commit/333952a62d
2022-10-06 23:17:49 +09:00
Nobuyoshi Nakada f6c916c7ef [ruby/rdoc] Allow leading pipes to be ommitted
https://github.com/ruby/rdoc/commit/d263a2c9c4
2022-10-06 23:16:54 +09:00
Nobuyoshi Nakada a19bf47d03 [ruby/rdoc] Allow trailing pipes to be ommitted
https://github.com/ruby/rdoc/commit/1318048877
2022-10-06 23:14:29 +09:00
Samuel Williams e696ec67ac
Introduce `Fiber.blocking{}` for bypassing the fiber scheduler. (#6498) 2022-10-06 23:00:49 +13:00
Nobuyoshi Nakada 75a53f6be0 [ruby/rdoc] Allow RDoc markups in table cells
https://github.com/ruby/rdoc/commit/b16d3f1727
2022-10-06 18:24:44 +09:00
Nobuyoshi Nakada e929b0aac5 [ruby/rdoc] Add `RDoc::Markup::ToHtml#accept_table` test
https://github.com/ruby/rdoc/commit/0cb3df713b
2022-10-06 18:24:43 +09:00
Nishant Patel 43e925090b [ruby/open-uri] fix: added test case that validates that bad TLS version is silently ignored
https://github.com/ruby/open-uri/commit/4b91b11730
2022-10-06 18:00:58 +09:00
Nishant Patel cdbaac3f4b [ruby/open-uri] feat: allow option to pass version of SSL / TLS to use during communication. Allow versions are OpenSSL::SSL::SSLContext::METHODS
https://github.com/ruby/open-uri/commit/8729858517
2022-10-06 18:00:57 +09:00
Hiroshi SHIBATA 7f80ec47c3 [ruby/open-uri] Use omit instead of skip for test-unit
https://github.com/ruby/open-uri/commit/63f466d6ed
2022-10-06 17:15:27 +09:00
Hiroshi SHIBATA cc5313ceab [ruby/open-uri] Run global constant count test only under Ruby 3.2
https://github.com/ruby/open-uri/commit/a8f1605ae9
2022-10-06 17:15:26 +09:00
Jean Boussier d15b38d944 [ruby/open-uri] Avoid busting the global constant cache
`Object#extend(mod)` bump the global constant cache if the module
has constants of its own.

So by moving these constants outside of `Meta` we avoid bumping
the cache.

https://github.com/ruby/open-uri/commit/363c399bac
2022-10-06 16:55:44 +09:00
Imir Kiyamov 83a6213f31 [ruby/irb] Fixed sort of variables in completion
https://github.com/ruby/irb/commit/5842888255
2022-10-05 19:22:13 +09:00
Nobuyoshi Nakada cbd82f5250
Cannot `define` from defined `Data` class again 2022-10-03 23:28:01 +09:00
David Rodríguez b7a61cb485 [rubygems/rubygems] Revert "Cleaup unnecessary code"
Unclear why, but https://github.com/rubygems/rubygems/commit/2e05dadbc5de created some
warnings in ruby-core CI, so let's revert it.

https://github.com/rubygems/rubygems/commit/729ce3a6e1
2022-10-03 19:54:24 +09:00
osyo-manga 7b88ffb34f [ruby/irb] Change to explicit method call in completion (https://github.com/ruby/irb/pull/369)
Ensure that methods are called even when local variables are defined.
see: https://github.com/ruby/irb/issues/368

https://github.com/ruby/irb/commit/c34d54b8bb
2022-10-03 06:55:53 +09:00
Nobuyoshi Nakada de9c612d63
Also the tests should use the configured pkg-config 2022-10-02 15:19:14 +09:00
Aaron Patterson 9a6803c90b
Revert "This commit implements the Object Shapes technique in CRuby."
This reverts commit 68bc9e2e97d12f80df0d113e284864e225f771c2.
2022-09-30 16:01:50 -07:00
eileencodes 0ab0229c11 Fix frozen object inspect
In the rails/rails CI build for Ruby master we found that some tests
were failing due to inspect on a frozen object being incorrect.

An object's instance variable count was incorrect when frozen causing
the object's inspect to not splat out the object.

This fixes the issue and adds a test for inspecting frozen objects.

Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-09-30 13:57:59 -07:00
David Rodríguez f04d249e83 [rubygems/rubygems] Fix matching of eabihf platforms
https://github.com/rubygems/rubygems/commit/a03d30cd58
2022-10-01 05:46:40 +09:00
David Rodríguez 8252ea2140 [rubygems/rubygems] Fix matching of linux platforms with eabi modifiers
https://github.com/rubygems/rubygems/commit/89362c18ef

Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2022-10-01 05:46:40 +09:00
tompng 641310ce37 [ruby/irb] Fix ripper_lex_without_warning duplicated heredoc token
https://github.com/ruby/irb/commit/45b539af39
2022-10-01 04:17:15 +09:00
Victor Shepelev ad651925e3
Add Data class implementation: Simple immutable value object 2022-09-30 18:23:19 +09:00
Yusuke Endoh 962f9932af [rubygems/rubygems] Prevent a "warning: assigned but unused variable - data"
https://github.com/rubygems/rubygems/commit/ec3fd55d40
2022-09-30 15:50:46 +09:00
Benoit Daloze aa490f9442 Reduce diff to proc.c @ b0b9f7201a
* So it's easy to review https://github.com/ruby/ruby/pull/6242 +
  https://github.com/ruby/ruby/pull/6467 and there are less changes
  overall.
2022-09-29 15:48:35 +02:00
Benoit Daloze c6319026ca Extend tests for a zsuper method of which the method it resolved to has been removed 2022-09-29 15:48:35 +02:00
Benoit Daloze 6b7d32a5e5 Resolve zsuper method during lookup but preserve owner separately
* See https://bugs.ruby-lang.org/issues/18729#note-34
* See [Bug #18729]
2022-09-29 15:48:35 +02:00
Jenny Shen 28840d74c2 [rubygems/rubygems] Refine error message to check the push URL instead of just the host
https://github.com/rubygems/rubygems/commit/46990f3292
2022-09-29 17:56:36 +09:00
Jenny Shen 0522e31d57 [rubygems/rubygems] Refactor tests to use Net::HTTPResponse instances for fetcher.data[:path]
https://github.com/rubygems/rubygems/commit/4d91cacb1f

Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
2022-09-29 17:56:36 +09:00
Jenny Shen 17b783ad9e [rubygems/rubygems] Surface entire redirect uri in permanent redirections
https://github.com/rubygems/rubygems/commit/da7837630b
2022-09-29 17:56:35 +09:00
Jenny Shen 1cbf0fd863 [rubygems/rubygems] Add error message when api response is a permanent redirect
https://github.com/rubygems/rubygems/commit/ccca30c77a

Co-authored-by: Nick Schwaderer <nick.schwaderer@shopify.com>
2022-09-29 17:56:34 +09:00
Nobuyoshi Nakada cb16dcb184 [ruby/date] The shrunk words to be copied is limited
Th buffer size is small enough and no need to allocate dynamically.

https://github.com/ruby/date/commit/f62bf0a01d
2022-09-29 14:56:39 +09:00
Nobuyoshi Nakada 5a8aaedaff [ruby/date] Narrow ALLOCV region for shrunk words
https://github.com/ruby/date/commit/f51b038074
2022-09-29 14:06:36 +09:00
Samuel Williams bd2fbd3588
Add `Coverage.supported?` to detect what modes are supported. 2022-09-29 09:44:14 +13:00
Samuel Williams 9dd902b831
Add `eval: true/false` flag to `Coverage.setup`. 2022-09-29 09:44:14 +13:00
David Rodríguez ac56e5c1ab [rubygems/rubygems] Put bundler gemspec stub at the right place
So that it's found when needed, rather than dynamically modifying
loaded stubs and thus messing with RubyGems internals.

https://github.com/rubygems/rubygems/commit/cd3e7cb9e5
2022-09-29 03:41:53 +09:00
David Rodríguez 668e78f01b [rubygems/rubygems] Only activate bundler when needed
Loading Bundler beforehand was actually replacing ENV with a backup of
the pre-Bundler environment through `Bundler::EnvironmentPreserver`. I
think that was making a bug in `ENV.replace` not bite our tests, because
Bundler includes proper patches to workaround that issue. So this commit
also includes these patches in RubyGems tests.

https://github.com/rubygems/rubygems/commit/8e079149b9
2022-09-29 03:41:52 +09:00
David Rodríguez 20eff52087 [rubygems/rubygems] Test a pure RubyGems method
`Gem::Specification#load_paths` is actually a Bundler thing.

https://github.com/rubygems/rubygems/commit/d20b4d1950
2022-09-29 03:41:52 +09:00
David Rodríguez 00a040dda3 [rubygems/rubygems] Little refactor to keep things consistent
https://github.com/rubygems/rubygems/commit/3934deb4e4
2022-09-29 03:41:51 +09:00
David Rodríguez 874a2bf17c [rubygems/rubygems] Remove unnecessary `ensure`
https://github.com/rubygems/rubygems/commit/6c0c02c533
2022-09-29 03:41:51 +09:00
David Rodríguez c7232a2a0a [rubygems/rubygems] Require bundler consistently
The `$LOAD_PATH` should be properly setup so that the local version is
used.

https://github.com/rubygems/rubygems/commit/03c0ab4082
2022-09-29 03:41:50 +09:00
David Rodríguez b9c426eaea [rubygems/rubygems] Remove unnecessary constant
https://github.com/rubygems/rubygems/commit/4bd77488ad
2022-09-29 03:41:50 +09:00
David Rodríguez 1e5597532a [rubygems/rubygems] Cleaup unnecessary code
https://github.com/rubygems/rubygems/commit/2e05dadbc5
2022-09-29 03:41:49 +09:00
David Rodríguez 5222a89ab6 [rubygems/rubygems] Unskip stuff that now works on JRuby
https://github.com/rubygems/rubygems/commit/d86a5ae2eb
2022-09-29 03:41:49 +09:00
Jemma Issroff d594a5a8bd
This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-28 08:26:21 -07:00
David Rodríguez 3c3bd03a7c [rubygems/rubygems] Force "master" to be used regardless of `init.defaultBranch` config
Otherwise, if you have `init.defaultBranch main` configured, like I do,
a bunch of tests fail with things like:

```
============================================================================================================================================================================================================
Error: test_checkout_submodules(TestGemSourceGit): Gem::Exception: unable to find reference master in /Users/deivid/Code/rubygems/rubygems/tmp/test_rubygems_20220928-13878-xog1je/git/a
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/source/git.rb:188:in `rev_parse'
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/source/git.rb:143:in `dir_shortref'
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/source/git.rb:158:in `install_dir'
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/source/git.rb:94:in `checkout'
/Users/deivid/Code/rubygems/rubygems/test/rubygems/test_gem_source_git.rb:78:in `test_checkout_submodules'
     75:       system @git, "commit", "--quiet", "-m", "add submodule b"
     76:     end
     77:
  => 78:     source.checkout
     79:
     80:     assert_path_exist File.join source.install_dir, "a.gemspec"
     81:     assert_path_exist File.join source.install_dir, "b/b.gemspec"
============================================================================================================================================================================================================
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
E
```

In the future, I'd like to change things to use `main`, but the
straighforward fix now is to keep "master" and make the running
environment's git configuration not get in the middle.

https://github.com/rubygems/rubygems/commit/b09b1416f1
2022-09-28 23:01:20 +09:00
Nobuyoshi Nakada d12fce7af3 [ruby/date] Check time zone offset elements
Too big parts of fractional hour time zone offset can cause assertion
failures.

https://github.com/ruby/date/commit/06bcfb2729
2022-09-28 21:07:00 +09:00
Jeremy Evans cd77e71bba [ruby/net-http] Remove ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE
This list is out of date.  At least OpenBSD since 2013 does not
allow one user to read the environment variables of a process
run by another user.

While we could try to keep the list updated, I think it's a bad
idea to not use the user/password from the environment, even if
another user on the system could read it.  If http_proxy exists
in the environment, and other users can read it, it doesn't
make it more secure for Ruby to ignore it.  You could argue that
it encourages poor security practices, but net/http should provide
mechanism, not policy.

Fixes [Bug #18908]

https://github.com/ruby/net-http/commit/1e4585153d
2022-09-28 17:26:03 +09:00
Hiroshi SHIBATA b58710e006
dbm and gdbm have been extracted gems. 2022-09-28 17:06:12 +09:00
Mike Dalessio 8f7f12ad64 [rubygems/rubygems] fix: Gem::Platform.match handles String argument properly
Previously 9eead86 introduced non-commutativity of platforms, and
later commit 1b9f7f50 changed the behavior of `Gem::Platform.match` to
ensure the callee of `#=~` was the gem platform.

However, when the platform argument is a String, then the callee and
argument of `#=~` are flipped (see docs for `String#=~`), which works
against the fix from 1b9f7f50.

Closes #5938

https://github.com/rubygems/rubygems/commit/3b1fb562e8
2022-09-28 05:55:28 +09:00
Lars Kanis 9d56d9975d [ruby/timeout] Explicit add the timeout thread to default ThreadGroup
Otherwise the timeout thread would be added to the ThreadGroup of the thread that makes the first call to Timeout.timeout .

Fixes bug 19020: https://bugs.ruby-lang.org/issues/19020

Add a test case to make sure the common thread doesn't leak to another ThreadGroup

https://github.com/ruby/timeout/commit/c4f1385c9a
2022-09-28 01:59:35 +09:00
Aaron Patterson 06abfa5be6
Revert this until we can figure out WB issues or remove shapes from GC
Revert "* expand tabs. [ci skip]"

This reverts commit 830b5b5c35.

Revert "This commit implements the Object Shapes technique in CRuby."

This reverts commit 9ddfd2ca00.
2022-09-26 16:10:11 -07:00
Jeremy Evans b39690df3a Rename method name in keyword test from y to yo
Kernel#y is defined by psych/yaml, which causes occasional
nondeterministic problems with this test when doing parallel testing.
2022-09-27 04:00:40 +09:00
Jemma Issroff 9ddfd2ca00 This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-26 09:21:30 -07:00
Samuel Williams 025b8701c0
Add several new methods for getting and setting buffer contents. (#6434) 2022-09-26 18:06:12 +13:00
John Hawthorn b361bdc200 [Bug #19021] Fix safe call w/ conditional assign
As of fbaac837cf, when we were performing
a safe call (`o&.x=`) with a conditional assign (`||= 1`) and discarding
the result the stack would end up in a bad state due to a missing pop.

This commit fixes that by adjusting the target label of the branchnil to
be before a pop in that case (as was previously done in the
non-conditional assignment case).
2022-09-25 20:44:54 -07:00
Yuichiro Kaneko d89f8a0467 [ruby/rdoc] Fix ruby script in "test_parse_method_bracket" (https://github.com/ruby/rdoc/pull/927)
Because it's syntax error.

https://github.com/ruby/rdoc/commit/993f2532ff
2022-09-26 09:38:40 +09:00
Yusuke Endoh a78c733cc3 Revert "Revert "error.c: Let Exception#inspect inspect its message""
This reverts commit b9f030954a.

[Bug #18170]
2022-09-23 16:40:59 +09:00
Otávio Schwanck dos Santos 4bdd8f2ddf [ruby/reline] use assert_nothing_raised
https://github.com/ruby/reline/commit/f08be5da09
2022-09-22 22:28:39 +09:00
Otávio Schwanck dos Santos 696e8914b7 [ruby/reline] PR changes
https://github.com/ruby/reline/commit/e8e8d81f47
2022-09-22 22:28:38 +09:00
Samuel Williams 9434a7333c Enable coverage for eval. 2022-09-22 22:19:12 +12:00
tompng 78cb638002 [ruby/irb] Update expected colorize result that were uncolored before
https://github.com/ruby/irb/commit/52446eb77f
2022-09-22 00:37:39 +09:00
tompng 9f68687879 [ruby/irb] Scan every single characters in IRB::Color.scan
https://github.com/ruby/irb/commit/d14e56a65d
2022-09-22 00:37:38 +09:00
Stan Lo c21f820b49 [ruby/irb] Fix completion tests
https://github.com/ruby/irb/commit/eb1691f636
2022-09-21 22:59:45 +09:00
st0012 6325fc8854 [ruby/irb] Handle non-String $LOAD_PATH values more carefully
In addition to String values, $LOAD_PATH can also take objects that
respond_to the `to_path` method, like Pathname objects. So `irb` should
be able to handle those objects too.

And if $LOAD_PATH contains objects that can't be converted into String,
`irb` should simply ignore it.

https://github.com/ruby/irb/commit/b2f562176b
2022-09-21 22:24:27 +09:00
Hiroshi SHIBATA c287deecb6 backup IRBRC environmental variable. It's used by test methods when it's defined. 2022-09-21 14:25:42 +09:00
Hiroshi SHIBATA d6e84d97fe Fix the missing locale error 2022-09-21 14:25:42 +09:00
Nobuyoshi Nakada 55e540f7ab
Ignore EPERM which means already being process-leader 2022-09-20 11:12:11 +09:00
Nobuyoshi Nakada 1c9381283e Add another test for `Process.daemon`
Check for that the daemon process is detached, that means it is not a
child and not waitable.
2022-09-19 15:34:16 +09:00
Takashi Kokubun 1825d3673f
Skip test_wait on MinGW CI
This test has been unstable, and it seems like we're not interested in
fixing that for MinGW.
https://github.com/ruby/ruby/actions/runs/3073317191/jobs/4965373284
2022-09-17 22:08:36 +09:00
Jeremy Evans b07db96744 [ruby/irb] Support --noscript option to not use first non-option argument as script
Also add --script option to turn the option back on.

Previously there wasn't a way to get an interactive IRB session
and access arguments provided on the command line.

Additionally, handle `-` as script as stdin. In Unix-like tools, `-`
means to take standard input instead of a file.  This doesn't
result in exactly the same output for:

```
echo 'p ARGV' > args.rb; irb args.rb a b c
```

and

```
echo 'p ARGV' | irb - a b c
```

Due to how irb handles whether stdin is a tty.

However, this change allows use of `-` as a argument, instead of
giving an unrecognized switch error. This required some small
changes to context.rb (to handle `-` as standard input) and
input-method.rb (to have FileInputMethod accept IO arguments in
addition to strings).

Implements [Feature #15371]

https://github.com/ruby/irb/commit/4192683ba2
2022-09-17 02:25:26 +09:00
Takashi Kokubun 6ad6994457
Omit a DRb test on MinGW
This test seems to leak a thread and let TestIOWait fail:
https://github.com/ruby/ruby/actions/runs/3065426880/jobs/4949517274

DRb almost never seemed to stably work on MinGW. I don't think we intend
to fix it either. We should just omit DRb tests when they fail on MinGW.
2022-09-16 17:05:59 +09:00
Kevin Newton 68a5b0f086 [rubygems/rubygems] Mask the file mode when extracting files
When extracting files from the tarball, a mode is retrieved from
the header. Occasionally you'll encounter a gem that was packaged
on a system whose permission bits result in a value that is larger
than the value that File.chmod will allow (anything >= 2^16). In
that case the extraction fails with a RangeError, which is pretty
esoteric.

If you extract the tarball with the tar and gunzip utilities, the
file permissions end up being just the bottom 16 bits masked off
from the original value. I've mirrored that behavior here. Per the
tar spec:

> Modes which are not supported by the operating system restoring
> files from the archive will be ignored.

I think that basically means what I've done here.

---

This commit also changes the behavior very slightly with regard to
when the chmod is called. Previously it was called while the file
descriptor was still open, but after the write call.

When write flushes, the file permissions are changed to the mode
value from the File.open call, undoing the changes made by
FileUtils.chmod. CRuby appears to flush the buffer after the
chmod call, whereas TruffleRuby flushes before the chmod call.
So the file permissions can change depending on implementation.
Both implementations end up getting the correct file permissions
for the bottom 9 bits (user, group, world), but differ with
regard to the sticky bit in the next 3.

To get consistent behavior, this commit changes it to close the
file descriptor before attempting to chmod anything, which makes
it consistent because the write flushes in both cases.

https://github.com/rubygems/rubygems/commit/22ce076e99
2022-09-15 14:49:20 +09:00
Nobuyoshi Nakada 752ae81ed1 [ruby/irb] Refine assertion for failures
https://github.com/ruby/irb/commit/fd047512b3
2022-09-15 08:25:53 +09:00
Nobuyoshi Nakada ae2e8d364f [ruby/irb] `Dir.mktmpdir` creates a directory including the process ID
https://github.com/ruby/irb/commit/a15f68ffdb
2022-09-15 08:25:52 +09:00
Jeremy Evans 9299db49f5 [ruby/irb] Fix history file saving with concurrent irb sessions when history file doesn't exist
If history file didn't exist when irb was started, @loaded_history_mtime
would be nil.  However, if the history file didn't exist before, but it
exists when saving history, that means the history file was modified,
and we should handle it the same way as we handle the other case where
the history file was modified.

Fixes #388

https://github.com/ruby/irb/commit/8d277aafcb
2022-09-14 10:15:45 +09:00
Benoit Daloze 6525b6f760 Remove get_actual_encoding() and the dynamic endian detection for dummy UTF-16/UTF-32
* And simplify callers of get_actual_encoding().
* See [Feature #18949].
* See https://github.com/ruby/ruby/pull/6322#issuecomment-1242758474
2022-09-12 14:02:34 +02:00
Jeremy Bopp 684353fc03
[Win32] Negative length `IO#sysread`
Raise `ArgumentError` in `IO#sysread` on Windows when given a negative
length.

Fixes [Bug #18880]
2022-09-11 23:08:14 +09:00
Takashi Kokubun 106744107b
[ruby/fiddle] Fix PACK_MAP for unsigned types (https://github.com/ruby/fiddle/pull/110)
4a71246645
2022-09-11 15:30:49 +09:00
Benoit Daloze 14bcf69c9c Deprecate Encoding#replicate
* See [Feature #18949].
2022-09-10 19:02:15 +02:00
Benoit Daloze 92b907d12d Enable deprecation warnings for test-all
* So deprecated methods/constants/functions are dealt with early,
  instead of many tests breaking suddenly when removing a deprecated
  method/constant/function.
* Follows https://bugs.ruby-lang.org/issues/17591
2022-09-10 13:14:18 +02:00
David Rodríguez b350053ae4 [rubygems/rubygems] Fix resolution on non-musl platforms
Gems without specific platform were being preferred over matching
platform specific gems.

https://github.com/rubygems/rubygems/commit/37b95b9159
2022-09-09 19:38:52 +09:00
Kazuki Tsujimoto db0e0dad11
Fix unexpected "duplicated key name" error in paren-less one line pattern matching
[Bug #18990]
2022-09-09 14:00:27 +09:00
David Rodríguez 24fd2f73d0 Resync Bundler & RubyGems 2022-09-08 11:25:03 +09:00
Nobuyoshi Nakada e6b47f2fb0
Now Psych uses the proleptic Gregorian calendar 2022-09-07 10:37:01 +09:00
Nobuyoshi Nakada cbdde8e0c5 [ruby/psych] Dump Date/DateTime as proleptic Gregorian date as well as Time
Fix ruby/psych#572

https://github.com/ruby/psych/commit/92304269bc
2022-09-07 09:44:14 +09:00
Hiroshi SHIBATA bfa6d0f6d7
fixup 8cd6f2a087
we should handle ensure block when omit this test
2022-09-07 09:41:28 +09:00
Antonio Paulino 4c1f6750f2 [rubygems/rubygems] Fix: Gem info bug with version flag
https://github.com/rubygems/rubygems/commit/e4cee1f975
2022-09-07 06:18:58 +09:00
Hiroshi SHIBATA 8cd6f2a087
omit random failure tests with FreeBSD
http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20220906T043002Z.fail.html.gz
  http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20220905T103002Z.fail.html.gz
2022-09-06 16:27:12 +09:00
Takashi Kokubun f4dbfa0f04
Skip test_redefinition_mismatch on trunk-mjit for now
Investigating:
http://ci.rvm.jp/logfiles/brlog.trunk-mjit.20220906-025646
which is not immediately reproducible on my laptop.
2022-09-06 15:40:13 +09:00
Takashi Kokubun 915cbdb226
Stop testing MJIT on s390x
It didn't work either.
http://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20220905T080003Z.fail.html.gz
2022-09-05 02:02:17 -07:00
Hiroshi SHIBATA 3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00
Nobuyoshi Nakada b5cf356447 Consider Complex from Complex cases
The assertions that "an argument of a Complex constructor must not be
a Complex" may not hold for some Numeric objects.
2022-09-02 14:33:23 +09:00
Nobuyoshi Nakada 9212d96307 [Bug #18937] Coerce non-real non-Numeric into Complex at comparisons 2022-09-02 14:33:23 +09:00
John Hawthorn 679ef34586 New constant caching insn: opt_getconstant_path
Previously YARV bytecode implemented constant caching by having a pair
of instructions, opt_getinlinecache and opt_setinlinecache, wrapping a
series of getconstant calls (with putobject providing supporting
arguments).

This commit replaces that pattern with a new instruction,
opt_getconstant_path, handling both getting/setting the inline cache and
fetching the constant on a cache miss.

This is implemented by storing the full constant path as a
null-terminated array of IDs inside of the IC structure. idNULL is used
to signal an absolute constant reference.

    $ ./miniruby --dump=insns -e '::Foo::Bar::Baz'
    == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,13)> (catch: FALSE)
    0000 opt_getconstant_path                   <ic:0 ::Foo::Bar::Baz>      (   1)[Li]
    0002 leave

The motivation for this is that we had increasingly found the need to
disassemble the instructions between the opt_getinlinecache and
opt_setinlinecache in order to determine the constant we are fetching,
or otherwise store metadata.

This disassembly was done:
* In opt_setinlinecache, to register the IC against the constant names
  it is using for granular invalidation.
* In rb_iseq_free, to unregister the IC from the invalidation table.
* In YJIT to find the position of a opt_getinlinecache instruction to
  invalidate it when the cache is populated
* In YJIT to register the constant names being used for invalidation.

With this change we no longe need disassemly for these (in fact
rb_iseq_each is now unused), as the list of constant names being
referenced is held in the IC. This should also make it possible to make
more optimizations in the future.

This may also reduce the size of iseqs, as previously each segment
required 32 bytes (on 64-bit platforms) for each constant segment. This
implementation only stores one ID per-segment.

There should be no significant performance change between this and the
previous implementation. Previously opt_getinlinecache was a "leaf"
instruction, but it included a jump (almost always to a separate cache
line). Now opt_getconstant_path is a non-leaf (it may
raise/autoload/call const_missing) but it does not jump. These seem to
even out.
2022-09-01 15:20:49 -07:00
Imir Kiyamov f67ab7f30c [ruby/did_you_mean] Fixed correction duplicates in VariableNameChecker
https://github.com/ruby/did_you_mean/commit/c3fc412f6f
2022-09-01 19:47:39 +09:00
Nobuyoshi Nakada 59e8569cf9 [ruby/reline] Support dumb terminal
The "dumb" terminal is considered only on MSys tty now.  However, the
`TERM` feature has been used on many Unix-like systems for decades,
not MSys specific.

https://github.com/ruby/reline/commit/53fd51ab62
2022-09-01 16:36:16 +09:00
なつき aded6971ad [rubygems/rubygems] Support non gnu libc arm-linux-eabi platforms
https://github.com/rubygems/rubygems/commit/394d7a6fc9
2022-09-01 15:01:40 +09:00
Nobuyoshi Nakada 576bdec03f [Bug #18973] Promote US-ASCII to ASCII-8BIT when adding 8-bit char 2022-08-31 17:27:59 +09:00
David Rodríguez b98653f766 [rubygems/rubygems] Let `Dir.tmpdir` use the standard path
We're not fully in control of this folder, even when running our own
tests, because MJIT creates some temp folders there when invoking GC.

This bite tests running in ruby-core when making the behavior of
`FileUtils.rm_rf` more strict, because these extra files could not be
removed.

Since this was originally added due to some failures on systems with non
standard permissions on tmp folders, but I can no longer reproduce
those, I'll remove it.

https://github.com/rubygems/rubygems/commit/d2f21596ee
2022-08-30 18:46:06 +09:00
Takashi Kokubun 232e43fd52 Respect RUBY_TESTOPTS on test-all (https://github.com/Shopify/ruby/pull/435)
* Respect RUBY_TESTOPTS on test-all

* Increase the Cirrus timeout

* Increase the CSV test timeout
2022-08-29 09:09:41 -07:00
Alan Wu ea9ee31744 A64 Linux reports aarach64 in RUBY_PLATFORM
This should fix a version string test
2022-08-29 09:09:41 -07:00
Takashi Kokubun dca5e74aa1
Fix test_rubyoptions.rb for arm64 (https://github.com/Shopify/ruby/pull/396) 2022-08-29 08:47:10 -07:00
Yusuke Endoh 4bc782ed87 Revert "Chect what remains in TMPDIR"
This reverts commit 7bdb999d0f.

I think I confirmed the mechanism. GCC (invoked by MJIT) creates a
temporary file in TMPDIR, which prevents rm_rf from removing the
directory.
2022-08-29 20:23:51 +09:00
Yusuke Endoh 7bdb999d0f Chect what remains in TMPDIR
I guess it has a shared library file created by MJIT, but I want to make
sure the fact.
2022-08-29 12:50:47 +09:00
Nobuyoshi Nakada ace2eee544
[Bug #18963] Separate string contents by here document terminator 2022-08-28 09:29:24 +09:00
Takashi Kokubun 111b69e8a0
Pass wait: false to avoid a timeout 2022-08-27 15:47:18 -07:00
Takashi Kokubun 95d2d7920c
Try to prevent the failure of FileUtils.rm_rf 2022-08-27 12:05:45 -07:00
Takashi Kokubun 458d49a04a
Ignore rm -rf failure
http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker/4213386

It's failing with:
rm: cannot remove '/tmp/ruby/v3/build/trunk-mjit/tmp/test_rubygems_20220827-13666-ii8lcp': Directory not empty
rm: cannot remove '/tmp/ruby/v3/build/trunk-mjit/tmp/test_rubygems_20220827-13666-fy77y1': Directory not empty

I'd like to make sure the following `ENV.replace` is called and see if
there's any other issues.
2022-08-27 10:22:30 -07:00
Takashi Kokubun 13d2225c46
Try rm -rf instead of FileUtils.rm_rf
FileUtils.rm_rf started to randomly fail on http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker
since around https://github.com/ruby/fileutils/pull/99.
2022-08-26 23:35:45 -07:00
Takashi Kokubun d6f21b308b
Convert catch_except_t to stdbool
catch_excep_t is a field that exists for MJIT. In the process of
rewriting MJIT in Ruby, I added API to convert 1/0 of _Bool to
true/false, and it seemed confusing and hard to maintain if you
don't use _Bool for *_p fields.
2022-08-25 23:00:19 -07:00
Jeremy Evans 21cac42385 Raise ArgumentError for IO.foreach with limit of 0
Makes behavior consistent with IO.readlines.

Fixes [Bug #18767]
2022-08-25 13:36:17 -07:00
Takashi Kokubun 881bc2a176
Skip running a DRb test on MinGW
It hangs even after a retry
https://github.com/ruby/ruby/runs/7966439530?check_suite_focus=true

We contacted GitHub Suppport about this before, and we concluded that
the problem is on our end. Unfortunately we don't have a bandwidth to
fix this MinGW problem, so until we get to work on it, this should be
just skipped to avoid a sporadic CI timeout.
2022-08-25 11:37:39 -07:00
Takashi Kokubun af9fa16c96
Make sure super is called and fix teardown 2022-08-25 11:31:16 -07:00
Takashi Kokubun 52560a9263
Skip flaky mkmf tests on AppVeyor
It seems like TestMkmfTryConstant started to randomly fail, maybe
related to 96562a517d or 073f3b7e0a.

Some of them seem to have failed even after retries, so it feels like
there's a bug in the implementation, which leaves an unrecoverable situation.
https://ci.appveyor.com/project/ruby/ruby/builds/44559958/job/7uub5bmkvy4pwwl8
https://ci.appveyor.com/project/ruby/ruby/builds/44579924/job/n81xmb2mqs6no7dm
https://ci.appveyor.com/project/ruby/ruby/builds/44558471/job/s4qwymmlxmfjjd35

Until we figure out what it is, I'd like to stabilize the CI by not
running it.
2022-08-25 11:11:16 -07:00
Yusuke Endoh 314b76a567 test/-ext-/eval/test_eval.rb: Prevent "assigned but unused variable" 2022-08-24 10:36:17 +09:00
Yusuke Endoh 983115cf3c [ruby/fileutils] FileUtils.rm* methods swallows only Errno::ENOENT when force is true
... instead of any StandardError.

To behave like the standard `rm` command, it should only ignore
exceptions about not existing files, not every exception. This should
make debugging some errors easier, because the expectation is that `rm
-rf` will succeed if and only if, all given files (previously existent
or not) are removed. However, due to this exception swallowing, this is
not always the case.

From the `rm` man page

> COMPATIBILITY
>
> The rm utility differs from historical implementations in that the -f
> option only masks attempts to remove non-existent files instead of
> masking a large variety of errors.

https://github.com/ruby/fileutils/commit/fa65d676ec

Co-Authored-By: David Rodríguez <deivid.rodriguez@riseup.net>
2022-08-23 16:52:41 +09:00
Yusuke Endoh 96562a517d [ruby/fileutils] Narrow the scope of ensure
The ensure in postorder_traverse was added for [Bug #6756].
The intention was to try to delete the parent directory if it failed to
get the children. (It may be possible to delete the directory if it is
empty.)

However, the ensure region rescue'ed not only "failure to get children"
but also "failure to delete each child". Thus, the following raised
Errno::ENOTEMPTY, but we expect it to raise Errno::EACCES.

```
$ mkdir foo
$ touch foo/bar
$ chmod 555 foo
$ ruby -rfileutils -e 'FileUtils.rm_rf("foo")'
```

This changeset narrows the ensure region so that it rescues only
"failure to get children".

https://github.com/ruby/fileutils/commit/ec5d3b84ea
2022-08-23 16:52:40 +09:00
Yusuke Endoh 073f3b7e0a [ruby/fileutils] Fix the test permission of "test_rm_rf"
The test was added for [Bug #6756]. The ticket insisted
`FileUtils.rm_rf` should delete an empty directory even if its
permission is 000. However, the test tried to delete a directory with
permission 700.

https://github.com/ruby/fileutils/commit/d6c2ab2c01
2022-08-23 16:52:39 +09:00
Hiroshi SHIBATA 892fe9bbba
omit all assertions at TestIO_Console#test_intr when running with FreeBSD 2022-08-23 12:49:46 +09:00
David Rodríguez 59f27445ea [rubygems/rubygems] Implement extra rules for libc versioning
https://github.com/rubygems/rubygems/commit/7e976d790a
2022-08-23 05:50:23 +09:00
David Rodríguez 492e70c7b4 [rubygems/rubygems] Fix `gem install` still choosing musl incorrectly
https://github.com/rubygems/rubygems/commit/1b9f7f50a5
2022-08-23 05:50:22 +09:00
David Rodríguez 06ae78f8fb [rubygems/rubygems] Remove unnecessary variables
https://github.com/rubygems/rubygems/commit/b5e0c683d9
2022-08-23 05:50:22 +09:00
David Rodríguez 9819283044 [rubygems/rubygems] Handle non-gnu libc on linux platforms in RubyGems
Attempting to install a gem published as both *-linux and *-linux-musl
results in the incorrect gem being picked up, causing build failures due
to binary incompatibility. This is caused by the `nil` wildcard
swallowing the libc information upon version comparison.

Handle the linux case by performing only non-wildcard equality on the
version and asserting 'gnu' and nil equivalence, while preserving the
current behaviour for other OSes.

https://github.com/rubygems/rubygems/commit/9eead86abc

Co-authored-by: Loic Nageleisen <loic.nageleisen@gmail.com>
2022-08-23 05:50:21 +09:00
Loic Nageleisen f254b673f8 [rubygems/rubygems] Test platform parsing stability
On past versions there were observed cases of inconsistencies when some
platforms were re-parsed.

Ensure that a platform's string representation parses again in a
platform object equal to the original.

https://github.com/rubygems/rubygems/commit/6da35ee93c
2022-08-23 05:50:20 +09:00
dependabot[bot] 085790bdc0 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.29 to 0.9.30.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.29...v0.9.30)

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

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

https://github.com/rubygems/rubygems/commit/912da7828e
2022-08-23 04:40:29 +09:00
dependabot[bot] a9ee13365a [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.29 to 0.9.30.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.29...v0.9.30)

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

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

https://github.com/rubygems/rubygems/commit/d54c936c4c
2022-08-23 02:26:16 +09:00
Nobuyoshi Nakada d5f50463c2
[Bug #18937] Coerce non-Numeric into Complex at comparisons 2022-08-22 12:26:43 +09:00
David Rodríguez 70f69f8539 [ruby/fileutils] Fix mkdir_p hanging on Windows when trying to create a file on a offline drive
https://github.com/ruby/fileutils/commit/9cc6a082d7
2022-08-22 10:12:25 +09:00
Nobuyoshi Nakada 0cc989696e
Add invalid hexadecimal float tests 2022-08-21 20:01:27 +09:00
Takashi Kokubun ddf96b7693
Drop mswin support of MJIT (#6265)
The current MJIT relies on SIGCHLD and fork(2) to be performant, and
it's something mswin can't offer. You could run Linux MJIT on WSL
instead.

[Misc #18968]
2022-08-20 18:35:36 -07:00
Benoit Daloze 209631a45f Consider resolved-through-zsuper methods equal for compatibility
* Fixes https://bugs.ruby-lang.org/issues/18751
2022-08-20 13:44:00 +02:00
Jeremy Evans 8212aab81a Make Object#method and Module#instance_method not skip ZSUPER methods
Based on c95e7e5329

Among other things, this fixes calling visibility methods (public?,
protected?, and private?) on them.  It also fixes #owner to show the
class the zsuper method entry is defined in, instead of the original
class it references.

For some backwards compatibility, adjust #parameters and #source_location,
to show the parameters and source location of the method originally
defined. Also have the parameters and source location still be shown
by #inspect.

Clarify documentation of {Method,UnboundMethod}#owner.

Add tests based on the description of https://bugs.ruby-lang.org/issues/18435
and based on https://github.com/ruby/ruby/pull/5356#issuecomment-1005298809

Fixes [Bug #18435] [Bug #18729]

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2022-08-20 13:44:00 +02:00
Nobuyoshi Nakada b32a3f1275
[Bug #18964] Add test for `rb_econv_append` 2022-08-20 16:25:30 +09:00
Takashi Kokubun 485019c2bd
Rename mjit_exec to jit_exec (#6262)
* Rename mjit_exec to jit_exec

* Rename mjit_exec_slowpath to mjit_check_iseq

* Remove mjit_exec references from comments
2022-08-19 23:57:17 -07:00
Jeremy Evans 6f3857f6a7 Support Encoding::Converter newline: :lf and :lf_newline options
Previously, newline: :lf was accepted but ignored.  Where it
should have been used was commented out code that didn't work,
but unlike all other invalid values, using newline: :lf did
not raise an error.

This adds support for newline: :lf and :lf_newline, for consistency
with newline: :cr and :cr_newline.  This is basically the same as
universal_newline, except that it only affects writing and not
reading due to RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK.

Add tests for the File.open :newline option while here.

Fixes [Bug #12436]
2022-08-19 20:23:36 -07:00
Nobuyoshi Nakada 1a2f99275b [Bug #18958] format string must be ASCII compatible 2022-08-20 10:06:40 +09:00
Nobuyoshi Nakada d2483393cb [Bug #18956] Negative codepoints are invalid characters 2022-08-20 10:06:16 +09:00
Nobuyoshi Nakada 1ef49de834 [Bug #18955] format single character for `%c` 2022-08-20 03:57:13 +09:00
Nobuyoshi Nakada ce384ef5a9 [Bug #18955] Check length of argument for `%c` in proper encoding 2022-08-20 03:57:13 +09:00
Nobuyoshi Nakada 2652b0da6b
Harden SizedQueue#push timeout test 2022-08-19 00:16:44 +09:00
Jean Boussier b0b9f7201a rb_str_resize: Only clear coderange on truncation
If we are expanding the string or only stripping extra capacity
then coderange won't change, so clearing it is wasteful.
2022-08-18 10:09:08 +02:00
Jean Boussier fe61cad749 Implement SizedQueue#push(timeout: sec)
[Feature #18944]

If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
2022-08-18 10:07:37 +02:00
Peter Zhu b4daf6e28e Fix flaky test for GC thrashing
GC could be in an intermediate state after creating the objects, so we
should finish GC by running a minor GC.
2022-08-17 10:54:28 -04:00
Jean Boussier 3850113e20 [ruby/cgi] Implement `CGI.url_encode` and `CGI.url_decode`
[Feature #18822]

Ruby is somewhat missing an RFC 3986 compliant escape method.

https://github.com/ruby/cgi/commit/c2729c7f33
2022-08-16 19:12:03 +09:00
Nobuyoshi Nakada 5389c9813b
Update the excluding message for Psych [ci skip] 2022-08-16 13:49:28 +09:00
John Hawthorn 0608a9a086
Optimize Marshal dump/load for large (> 31-bit) FIXNUM (#6229)
* Optimize Marshal dump of large fixnum

Marshal's FIXNUM type only supports 31-bit fixnums, so on 64-bit
platforms the 63-bit fixnums need to be represented in Marshal's
BIGNUM.

Previously this was done by converting to a bugnum and serializing the
bignum object.

This commit avoids allocating the intermediate bignum object, instead
outputting the T_FIXNUM directly to a Marshal bignum. This maintains the
same representation as the previous implementation, including not using
LINKs for these large fixnums (an artifact of the previous
implementation always allocating a new BIGNUM).

This commit also avoids unnecessary st_lookups on immediate values,
which we know will not be in that table.

* Fastpath for loading FIXNUM from Marshal bignum

* Run update-deps
2022-08-15 16:14:12 -07:00
Peter Zhu 0264424d58 Add test for GC thrashing of young object creation
This test will prevent performance regressions like [Bug #18929].
2022-08-15 10:00:03 -04:00
Jeremy Evans 89aa09afaf [ruby/rinda] Handle situations where IPv4 multicast is not available
Fixes [Bug #13864]

https://github.com/ruby/rinda/commit/3cd620f38c
2022-08-15 14:11:52 +09:00
Nobuyoshi Nakada 844a0edbae [Bug #18962] Do not read again once reached EOF
`Ripper::Lexer#parse` re-parses the source code with syntax errors
when `raise_errors: false`.

Co-Authored-By: tompng <tomoyapenguin@gmail.com>
2022-08-12 15:58:18 +09:00
Kouhei Yanagita 24e33b84b5 Remove Numeric#ceildiv 2022-08-12 15:57:52 +09:00
Kouhei Yanagita 4165fd0e76 Add Numeric#ceildiv and Integer#ceildiv 2022-08-12 15:57:52 +09:00
Nobuyoshi Nakada cd1a0b3caa Stop defining `RUBY_ABI_VERSION` if released versions
As commented in include/ruby/internal/abi.h, since teeny versions of
Ruby should guarantee ABI compatibility, `RUBY_ABI_VERSION` has no role
in released versions of Ruby.
2022-08-12 15:57:25 +09:00
Jeremy Evans 49517b3bb4 Fix inspect for unicode codepoint 0x85
This is an inelegant hack, by manually checking for this specific
code point in rb_str_inspect.  Some testing indicates that this is
the only code point affected.

It's possible a better fix would be inside of lower-level encoding
code, such that rb_enc_isprint would return false and not true for
codepoint 0x85.

Fixes [Bug #16842]
2022-08-11 08:47:29 -07:00
Jeremy Evans cfb9624460
Fix Array#[] with ArithmeticSequence with negative steps (#5739)
* Fix Array#[] with ArithmeticSequence with negative steps

Previously, Array#[] when called with an ArithmeticSequence
with a negative step did not handle all cases correctly,
especially cases involving infinite ranges, inverted ranges,
and/or exclusive ends.

Fixes [Bug #18247]

* Add Array#slice tests for ArithmeticSequence with negative step to test_array

Add tests of rb_arithmetic_sequence_beg_len_step C-API function.

* Fix ext/-test-/arith_seq/beg_len_step/depend

* Rename local variables

* Fix a variable name

Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com>
2022-08-11 19:16:49 +09:00
Jeremy Evans ff42e2359b Revert "Add {Method,UnboundMethod}#{public?,private?,protected?}"
This reverts commit 2727815068 and
58dc8bf8f1.

Visibility is an attribute of the method entry in a class, not an
attribute of the Method object.

Fixes [#18729]
Fixes [#18751]
Fixes [#18435]
2022-08-10 13:02:52 -07:00
Yusuke Endoh 3a58009066 [ruby/error_highlight] Make backtrace_location keyword work
We had to keep backtrace_location before opts is overwritten.

https://github.com/ruby/error_highlight/commit/2735e4681a
2022-08-10 21:19:10 +09:00
Yusuke Endoh 99e7fa5b37 [ruby/error_highlight] Make ErrorHighlight.spot accept Exception (https://github.com/ruby/error_highlight/pull/25)
... and move things from core_ext.rb to base.rb.
This will confine CRuby-dependent things to ErrorHighlight.spot.

https://github.com/ruby/error_highlight/commit/22d1dd7824
2022-08-10 18:37:13 +09:00
Hiroshi SHIBATA 44264b4fee Merge rubygems/bundler HEAD.
Pick from dfbb5a3811
2022-08-09 12:05:19 +09:00
dependabot[bot] 35b9cd1def [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.28 to 0.9.29.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.28...v0.9.29)

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

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

https://github.com/rubygems/rubygems/commit/77a945f0e8
2022-08-09 04:35:33 +09:00
Nobuyoshi Nakada 79fdf9712d
Tentatively exclude the test that triggers ruby/psych#572 2022-08-09 03:09:33 +09:00
dependabot[bot] 78bc2aae7f [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.28 to 0.9.29.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.28...v0.9.29)

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

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

https://github.com/rubygems/rubygems/commit/d5d96f6bae
2022-08-09 01:50:18 +09:00
Alexander Momchilov 9c13a6ce5f [ruby/psych] Raise specific error when an anchor isn't defined
https://github.com/ruby/psych/commit/98fbd5247a
2022-08-09 01:33:34 +09:00
Alexander Momchilov 4b9cdf4e1c [ruby/psych] Update to squiggly heredocs in the file
https://github.com/ruby/psych/commit/42b43de997
2022-08-09 01:33:33 +09:00
Alexander Momchilov 38ea6b30dc [ruby/psych] Add test for missing anchor
https://github.com/ruby/psych/commit/5f08137ae6
2022-08-09 01:33:32 +09:00
Alexander Momchilov ea1efdf32f [ruby/psych] Add test for anchor reuse
The spec calls this a "reuse" of an anchor
https://yaml.org/spec/1.2.2/#71-alias-nodes

https://github.com/ruby/psych/commit/57e3b70a56
2022-08-09 01:33:31 +09:00
Alexander Momchilov 54219ae8c4 [ruby/psych] Raise specific error when aliases are not enabled
https://github.com/ruby/psych/commit/0c11ddcf46
2022-08-09 01:32:47 +09:00
Alexander Momchilov 71f89c2874 [ruby/psych] Don't hardcode expected alias names
https://github.com/ruby/psych/commit/b9ab19094f
2022-08-09 01:31:24 +09:00
Alexander Momchilov 0b7cfdca09 [ruby/psych] Test that recursive refs dump as aliases
https://github.com/ruby/psych/commit/d9f7289190
2022-08-09 01:31:23 +09:00
Alexander Momchilov c851bced39 [ruby/psych] Clarify tests about parsing aliases
https://github.com/ruby/psych/commit/0bc30cb4cb
2022-08-09 01:31:22 +09:00
Nobuyoshi Nakada e07d450dea [ruby/date] Fix Time#to_datetime before calendar reform
Time is always in the proleptic Gregorian calendar.
Also DateTime#to_time should convert to the Gregorian calendar first,
before extracting its components.

https://bugs.ruby-lang.org/issues/18946#change-98527

https://github.com/ruby/date/commit/b2aee75248
2022-08-08 23:50:17 +09:00
Nobuyoshi Nakada 5beb75ce8d
[ruby/rdoc] Allow multiple footnotes without in-between blank lines
https://github.com/ruby/ruby/commit/e4e054e3ce40 used four footnotes
without blank lines.  And the ChangeLog generated from that commit
resulted in ``undefined method `parts' for nil`` error.

For now, let a footnote terminated by the next footnote mark.

Also refined the error message when undefined footnote is used.

https://github.com/ruby/rdoc/commit/a7f290130b
2022-08-08 01:12:49 +09:00
David Rodríguez f310ac1cb2 [rubygems/rubygems] Include backtrace with crashes by default
https://github.com/rubygems/rubygems/commit/3cc3bfd371
2022-08-05 16:37:03 +09:00
John Hawthorn 70b60d24b9 Fix inconsistency with opt_aref_with
opt_aref_with is an optimized instruction for accessing a Hash using a
non-frozen string key (ie. from a file without frozen_string_literal).
It attempts to avoid allocating the string, and instead silently using a
frozen string (hash string keys are always fstrings).

Because this is just an optimization, it should be invisible to the
user. However, previously this optimization was could be seen via hashes
with default procs.

For example, previously:

    h = Hash.new { |h, k| k.frozen? }
    str = "foo"
    h[str]   # false
    h["foo"] # true when optimizations enabled

This commit checks that the Hash doesn't have a default proc when using
opt_aref_with.
2022-08-04 14:48:47 -07:00
David Rodríguez c84d0538be [rubygems/rubygems] Fix unused variable warning
```
/Users/deivid/Code/rubygems/rubygems/test/rubygems/test_gem_resolver_installer_set.rb:55: warning: assigned but unused variable - a_1_local
```

https://github.com/rubygems/rubygems/commit/9ea4534800
2022-08-05 00:09:18 +09:00
David Rodríguez 542040fb83 [rubygems/rubygems] Warn dangling symlinks
https://github.com/rubygems/rubygems/commit/425b78637f
2022-08-04 13:36:45 +09:00
Jean Boussier 4406cb1bf1 Harden Queue#pop timeout tests
They occasionaly fail with;

```
  FLeaked thread: TestThreadQueue#test_queue_pop_timeout: #<Thread:0x0000000108e38e48 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 sleep>
  .Finished thread: TestThreadQueue#test_deny_pushers: #<Thread:0x0000000108e38e48 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 dead>
  ...
  Retrying...

    1) Failure:
  TestThreadQueue#test_sized_queue_pop_timeout [/Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:157]:
  <#<Thread:0x00000001084bc7e8 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:156 sleep>> expected but was
  <nil>.

    2) Failure:
  TestThreadQueue#test_queue_pop_timeout [/Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:124]:
  <#<Thread:0x00000001083ff058 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 sleep>> expected but was
  <nil>.
```

I'm hoping joining for longer should help avoid this.
2022-08-03 10:59:13 +02:00
Hiroshi SHIBATA 71794a75db Merge rubygems/bundler HEAD
Pick from 8331e63263
2022-08-03 13:14:10 +09:00
Ilya Dyakonov 4f00ee8d47 [rubygems/rubygems] fix platform matching for index specs
https://github.com/rubygems/rubygems/commit/f087f1b590
2022-08-03 06:56:36 +09:00
David Rodríguez 20936eb3a9 [rubygems/rubygems] Warn (rather than crash) when setting `nil` specification versions
https://github.com/rubygems/rubygems/commit/a4ba1a4d97
2022-08-03 06:56:18 +09:00
Jean Boussier e3aabe93aa Implement Queue#pop(timeout: sec)
[Feature #18774]

As well as `SizedQueue#pop(timeout: sec)`

If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
2022-08-02 11:04:28 +02:00
Nobuyoshi Nakada ec3f59309e [Bug #17767] Now `ENV.clone` raises `TypeError` as well as `ENV.dup`
One year ago, the former method has been deprecated while the latter
has become an error.  Then the 3.1 released, it is enough time to make
also the former an error.
2022-08-02 16:40:12 +09:00