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

69449 Коммитов

Автор SHA1 Сообщение Дата
Alan Wu 244c98e635
Strip out YJIT at build time when unsupported or disabled (#5003)
In an effort to minimize build issues on non x64 platforms, we can
decide at build time to not build the bulk of YJIT. This should fix
obscure build errors like this one on riscv64:

    yjit_asm.c:137:(.text+0x3fa): relocation truncated to fit: R_RISCV_PCREL_HI20 against `alloc_exec_mem'

We also don't need to bulid YJIT on `--disable-jit-support` builds.

One wrinkle to this is that the YJIT Ruby module will not be defined
when YJIT is stripped from the build. I think that's a fair change as
it's only meant to be used for YJIT development.
2021-10-25 10:45:22 -04:00
Ian C. Anderson e943511455
YJIT: Implement duphash (#5009)
`duphash` showed up in the top-20 most frequent exit ops for @jhawthorn's benchmark that renders github.com/about

The implementation was almost exactly the same as `duparray`

Co-authored-by: John Hawthorn <john@hawthorn.email>

Co-authored-by: John Hawthorn <john@hawthorn.email>
2021-10-25 10:40:33 -04:00
Yusuke Endoh 1c0c8d5da2 test/ruby/test_jit.rb: Add a test for checkmatch insn 2021-10-25 21:30:16 +09:00
Yusuke Endoh 5bcef26d24 test/ruby/test_jit.rb: Print a hint at exit of the original process
Otherwise, the hint is printed whenever fork is called.

http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20211025T093004Z.log.html.gz
```
[20244/21156] TestThread#test_fork_while_lockedyou may want to add tests for following insns, when you have a chance: checkmatch
you may want to add tests for following insns, when you have a chance: checkmatch
you may want to add tests for following insns, when you have a chance: checkmatch
 = 0.19 s
```
2021-10-25 21:28:44 +09:00
David Rodriguez 9d28618091
[rubygems/rubygems] Avoid loading the `digest` gem unnecessarily
OpenSSL includes what we need.

https://github.com/rubygems/rubygems/commit/955f3b72ca
2021-10-25 20:48:52 +09:00
David Rodriguez a959342abf
[rubygems/rubygems] Remove comment that seems no longer accurate
We require things inline or autoload them for efficiency and to avoid as
much as possible conflicting with user's choice of gems.

But I removed the require and observed no deadlocks when activating
gems.

https://github.com/rubygems/rubygems/commit/7d6333e842
2021-10-25 20:48:52 +09:00
David Rodriguez 9fbf3a1f6f
Unify issue template and ISSUES.md document
Some crucial information to ease maintainers work, like the advice of
upgrading rubygems and bundler, was one step away from the issue
template, making it easier for some users to miss.

Now all relevant information is written directly in the bug report
template.
2021-10-25 20:48:51 +09:00
David Rodriguez b4a43e4f57
[rubygems/rubygems] Show proper error when previous installation of gem can't be deleted
Instead of showing the bug report template with an error at a random
place.

https://github.com/rubygems/rubygems/commit/882ad3ab57
2021-10-25 20:48:51 +09:00
David Rodriguez 00412be204
[rubygems/rubygems] Show a proper error if gem path is not writable
Instead of showing the bug report place with an error at a randome
place.

https://github.com/rubygems/rubygems/commit/241854ce73
2021-10-25 20:48:51 +09:00
David Rodriguez f6d1909500
[rubygems/rubygems] Catch up with recent error message modification
https://github.com/rubygems/rubygems/commit/ae374c1f31
2021-10-25 20:48:51 +09:00
David Rodriguez 7073870dfa
[rubygems/rubygems] Improve readability by splitting updating the cache and searching it
https://github.com/rubygems/rubygems/commit/d0df25bb0f
2021-10-25 20:48:51 +09:00
David Rodriguez f7f85c1feb
[rubygems/rubygems] Manage global gem cache directly
Previously, it was maintained in sync with the standard cache. That was
less efficient, and it caused some error messages to point to non
existent files.

https://github.com/rubygems/rubygems/commit/931f8cb8a9
2021-10-25 20:48:51 +09:00
David Rodriguez 4fc29d17b3
[rubygems/rubygems] Cached gem path resolution should consider default gems
https://github.com/rubygems/rubygems/commit/83b2b845b3
2021-10-25 20:48:51 +09:00
David Rodriguez 4edcda67b3
[rubygems/rubygems] Simplify gem downloading inside bundler
We can skip most stuff in `Gem::RemoteFetcher#download`, and use
`Gem::RemoteFetcher#update_cache_path` directly.

This has the benefit of allowing us to remove some workarounds to
support several rubygems versions, but also allows us to pass the target
folder where the gem should be downloaded directly and skip the logic
inside `Gem::RemoteFetcher#download` to infer the cache path. This will
be useful later to fix some issues with the `global_gem_cache` feature
flag.

https://github.com/rubygems/rubygems/commit/8fe74a77e4
2021-10-25 20:48:51 +09:00
David Rodriguez 03a563b47e
[rubygems/rubygems] Remove unused `let`
https://github.com/rubygems/rubygems/commit/7e1316e454
2021-10-25 20:48:51 +09:00
David Rodriguez 57d990ddab
[rubygems/rubygems] Raise original exception
https://github.com/rubygems/rubygems/commit/3c93b9fd21
2021-10-25 20:48:51 +09:00
David Rodriguez 7b821bc9b5
[rubygems/rubygems] Add missing requires
These methods rescue a constant defined by `rubygems/remote_fetcher`,
so they should technically require it.

The require is provided by `gem_remote_fetcher` anyways but I was
running a unit spec that stubs that method, so I was getting an
undefined constant error hiding another error.

https://github.com/rubygems/rubygems/commit/8bedae4034
2021-10-25 20:48:50 +09:00
David Rodriguez 9b1b171866
[rubygems/rubygems] Use `Gem::Specification#file_name` consistently
https://github.com/rubygems/rubygems/commit/13b933f49a
2021-10-25 20:48:50 +09:00
David Rodriguez 38542cfffc
[rubygems/rubygems] Extract a `default_cache_path` helper
https://github.com/rubygems/rubygems/commit/8319305d58
2021-10-25 20:48:50 +09:00
David Rodriguez edc1813190
[rubygems/rubygems] Small refactor
Extract final cache path to a variable and pass that to `download_gem`.
It actually fits better the parameters documentation since it's the
final directory where the downloaded gem will be placed.

https://github.com/rubygems/rubygems/commit/1429db6a04
2021-10-25 20:48:50 +09:00
Yusuke Endoh 13068ebe32
process.c: Add Process._fork (#5017)
* process.c: Add Process._fork

This API is supposed for application monitoring libraries to hook fork
event.

[Feature #17795]

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-10-25 20:47:19 +09:00
Yusuke Endoh 1eac38c609 test/ruby/test_rubyvm.rb: prevent "assigned but unused variable" warnings
http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20211025T093004Z.log.html.gz
```
[ 4896/21159] TestRubyVM#test_keep_script_lines(none):3: warning: assigned but unused variable - b
(none):6: warning: assigned but unused variable - c
(none):1: warning: assigned but unused variable - a
<compiled>:3: warning: assigned but unused variable - b
(none):3: warning: assigned but unused variable - b
(none):6: warning: assigned but unused variable - c
(none):1: warning: assigned but unused variable - a
<compiled>:3: warning: assigned but unused variable - b
```
2021-10-25 20:45:05 +09:00
Yusuke Endoh 7da9c25aa4 test/ruby/test_refinement.rb: Prevent deprecation warnings during test
http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20211025T093004Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:777: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:840: warning: Refinement#prepend is deprecated and will be removed in Ruby 3.2
/home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:2620: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
```
2021-10-25 20:44:29 +09:00
Yusuke Endoh 00c7b91f91 test/ruby/test_marshal.rb: Prevent "assigned but unused variable" warning
http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20211025T093004Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_marshal.rb:925: warning: assigned but unused variable - objects
```
2021-10-25 20:43:42 +09:00
Jean Boussier 5af3f7f357
[rubygems/rubygems] Vendor a pure ruby implementation of SHA1
This allows `Source::Git` to no longer load the `digest` gem as it is causing
issues on Ruby 3.1.

https://github.com/rubygems/rubygems/pull/4989/commits/c19a9f2ff7
2021-10-25 20:24:32 +09:00
Yusuke Endoh 86e3d77abb
Make Coverage suspendable (#4856)
* Make Coverage suspendable

Add `Coverage.suspend`, `Coverage.resume` and some methods.

[Feature #18176] [ruby-core:105321]
2021-10-25 20:00:51 +09:00
Yusuke Endoh 54379e3d7d Update TypeProf to 0.20.1 2021-10-25 19:42:42 +09:00
Daniel Colson 7394514bde [rubygems/rubygems] Simplify and remove some unused code
When `install_with_build_args` was added in
be96283985,
there were two versions of the method: the default version in the base class that still
used the locking `with_build_args`, and an override in the `Future`
class (for Rubygems 2.0 and up) that yielded without calling
`with_build_args`.

The `with_build_args` version of the method was removed in
8a5b71e3e8
while removing a bunch of the old Rubygems compatibility code.

This commit removes `with_build_args`, since it no longer appears to be
used (the build args are passed as a keyword argument to
`spec.source.install` instead, since
be96283985).

The commit also removes `install_with_build_args` and the conditional
around it, since the method wasn't doing anything different than
`install`, and it had a comment that was no longer accurate.

https://github.com/rubygems/rubygems/commit/ba543a60eb
2021-10-25 19:02:50 +09:00
Koichi Sasada a1c4cab11d check other IO#close calls
http://ci.rvm.jp/results/trunk@ruby-iga/3690333
> tool/lib/test/unit/parallel.rb:68:in `close': Bad file descriptor (Errno::EBADF)
2021-10-25 17:38:23 +09:00
Koichi Sasada 7864efa105 introduce check code for mysterious EBADF
parallel test randomly failed with EBADF.
This patch checks wich suite causes this error.

ex) http://ci.rvm.jp/results/trunk@ruby-iga/3690219

```
/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:88:in `close': Bad file descriptor (Errno::EBADF)
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:88:in `ensure in _run_suite'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:89:in `_run_suite'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:30:in `block in _run_suites'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:29:in `map'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:29:in `_run_suites'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:128:in `run'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:211:in `<main>'
```
2021-10-25 15:47:09 +09:00
Tanaka Akira b74f9d656a add example for buffer: argument of pack. 2021-10-25 12:25:13 +09:00
180909 66d09501c2
fix typo [ci skip] 2021-10-25 12:15:55 +09:00
TSUYUSATO Kitsune dfb47bbd17
Fix `Enumerable#each_cons` and `Enumerable#each_slice` to return a receiver
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-10-25 12:13:44 +09:00
Kazuhiro NISHIYAMA aa09c8dae0
Fix links [ci skip] 2021-10-25 08:38:44 +09:00
Nobuyoshi Nakada 4fb71575e2
[DOC] Fix code markup [ci skip]
Code markup in RDoc must not be concatenated with anothr word.
2021-10-25 01:04:51 +09:00
git df4445128b * 2021-10-25 [ci skip] 2021-10-25 00:43:45 +09:00
Kazuki Yamaguchi e10dfdf623 [ruby/openssl] bn: expand BIGNUM_RAND and BIGNUM_RAND_RANGE macros
Now that BN.pseudo_rand{,_range} are alias, those macros are only used
once. Let's expand the macros for better readability.

https://github.com/ruby/openssl/commit/7c2fc00dee
2021-10-25 00:40:48 +09:00
Kazuki Yamaguchi e19186707a [ruby/openssl] bn: make BN.pseudo_rand{,_range} an alias of BN.rand{,_range}
BN_pseudo_rand() and BN_pseudo_rand_range() are deprecated in
OpenSSL 3.0. Since they are identical to their non-'pseudo' version
anyway, let's make them alias.

https://github.com/ruby/openssl/commit/2d34e85ddf
2021-10-25 00:40:48 +09:00
Kazuki Yamaguchi 1b5ccc8a0c [ruby/openssl] pkey, ssl: use EVP_PKEY_eq() instead of EVP_PKEY_cmp()
OpenSSL 3.0 renamed EVP_PKEY_cmp() to EVP_PKEY_eq() because that was a
confusing name.

https://github.com/ruby/openssl/commit/d42bd7fcdb
2021-10-25 00:40:47 +09:00
Kazuki Yamaguchi ee7131614c [ruby/openssl] pkey/ec: use EC_GROUP_free() instead of EC_GROUP_clear_free()
EC_GROUP_clear_free() is deprecated in OpenSSL 3.0.

EC_GROUP does not include any sensitive data, so we can safely use
EC_GROUP_free() instead.

https://github.com/ruby/openssl/commit/e93a5fdffc
2021-10-25 00:40:47 +09:00
Kazuki Yamaguchi 555788b622 [ruby/openssl] pkey/ec: deprecate PKey::EC::Point#make_affine! and make it a no-op
It converts the internal representation of the point object to the
affine coordinate system. However, it had no real use case because the
difference in the internal representation has not been visible from
Ruby/OpenSSL at all.

EC_POINT_make_affine() is marked as deprecated in OpenSSL 3.0.

https://github.com/ruby/openssl/commit/e2cc81fef7
2021-10-25 00:40:46 +09:00
Kazuki Yamaguchi 16272d9ae9 [ruby/openssl] hmac: use EVP_MD_CTX_get_pkey_ctx() instead of EVP_MD_CTX_pkey_ctx()
OpenSSL 3.0 renamed EVP_MD_CTX_pkey_ctx() to include "get" in the
function name. Adjust compatibility macro so that we can use the new
function name for all OpenSSL 1.0.2-3.0.

https://github.com/ruby/openssl/commit/c106d888c6
2021-10-25 00:40:46 +09:00
Kazuki Yamaguchi 040387d265 [ruby/openssl] digest: use EVP_MD_CTX_get0_md() instead of EVP_MD_CTX_md() if exists
The function was renamed in OpenSSL 3.0 due to the change of the
lifetime of EVP_MD objects. They are no longer necessarily statically
allocated and can be reference-counted -- when an EVP_MD_CTX is free'd,
the associated EVP_MD can also become inaccessible.

Currently Ruby/OpenSSL only handles builtin algorithms, so no special
handling is needed except for adapting to the rename.

https://github.com/ruby/openssl/commit/0a253027e6
2021-10-25 00:40:45 +09:00
Kazuki Yamaguchi cfa4fa636e [ruby/openssl] bn: use BN_check_prime() in OpenSSL::BN#prime{,_fasttest}?
In OpenSSL 3.0, BN_is_prime_ex() and BN_is_prime_fasttest_ex() are
deprecated in favor of BN_check_prime().

https://github.com/ruby/openssl/commit/90d51ef510
2021-10-25 00:40:45 +09:00
Kazuki Yamaguchi fa24e7a57e [ruby/openssl] ssl: use SSL_get_rbio() to check if SSL is started or not
Use SSL_get_rbio() instead of SSL_get_fd(). SSL_get_fd() internally
calls SSL_get_rbio() and it's enough for our purpose.

In OpenSSL 3.0, SSL_get_fd() leaves an entry in the OpenSSL error queue
if BIO has not been set up yet, and we would have to clean it up.

https://github.com/ruby/openssl/commit/e95ee24867
2021-10-25 00:40:44 +09:00
Kazuki Yamaguchi d5aa3fcae6 [ruby/openssl] ssl: use SSL_CTX_load_verify_{file,dir}() if available
SSL_CTX_load_verify_locations() is deprecated in OpenSSL 3.0 and
replaced with those two separate functions. Use them if they exist.

https://github.com/ruby/openssl/commit/5375a55ffc
2021-10-25 00:40:44 +09:00
Kazuki Yamaguchi 19ef7082ba [ruby/openssl] ts: use TS_VERIFY_CTX_set_certs instead of TS_VERIFY_CTS_set_certs
OpenSSL 3.0 fixed the typo in the function name and replaced the
current 'CTS' version with a macro.

https://github.com/ruby/openssl/commit/2be6779b08
2021-10-25 00:40:43 +09:00
Kazuki Yamaguchi 3d16401508 [ruby/openssl] ossl.c: use ERR_get_error_all() if available
OpenSSL 3.0 deprecated ERR_get_error_line_data() in favor of
ERR_get_error_all(), as part of the error queue structure changes.

https://github.com/ruby/openssl/commit/8e98d2ecc8
2021-10-25 00:40:43 +09:00
Kazuki Yamaguchi 32d49e93cf [ruby/openssl] ext/openssl/ossl.h: add helper macros for OpenSSL/LibreSSL versions
Add following convenient macros:

 - OSSL_IS_LIBRESSL
 - OSSL_OPENSSL_PREREQ(maj, min, pat)
 - OSSL_LIBRESSL_PREREQ(maj, min, pat)

https://github.com/ruby/openssl/commit/00abee791d
2021-10-25 00:40:42 +09:00
Nobuyoshi Nakada 1ea5325360
Reduce YJIT runs on Ubuntu [ci skip] 2021-10-24 19:35:29 +09:00