Previously, `make test-spec` was not printing the description with +YJIT
even when YJIT was indeed enabled. It was confusing on CI. `fake.rb` was
changing the `RUBY_DESCRIPTION` constant incorrectly.
I suppose `make test-spec` mostly needs the `mkmf` faking and not the
faking of `RUBY_.*` constants, so maybe there is an opportunity to simplify
in the future.
This allows for the ability to opt-in to a method to set the
encoding of response bodies. By setting the accessor to a String
or Encoding instance, it will use the specified encoding.
Setting the value of true will try to detect the encoding of the
response body, either using the Content-Type header (assuming it
specifies charset) or by scanning for a <meta> tag in the document
that specifies the encoding. The default is false in which case
no forcing of encoding will be done (same as before the patch).
Implements [Feature #2567]
Implements [Feature #15517]
https://github.com/ruby/net-http/commit/6233e6b7c1
Co-authored-by: Yui Naruse <naruse@ruby-lang.org>
When calling `const_added` while process in `autoload`, it can
cause synchronization issue because of a thread swithcing.
http://ci.rvm.jp/logfiles/brlog.trunk.20220407-152213#L489
```
1)
Module#autoload (concurrently) raises a LoadError in each thread if the file does not exist ERROR
NameError: uninitialized constant ModuleSpecs::Autoload::FileDoesNotExist
ModuleSpecs::Autoload::FileDoesNotExist
^^^^^^^^^^^^^^^^^^
/tmp/ruby/v3/src/trunk/spec/ruby/core/module/autoload_spec.rb:965:in `block (5 levels) in <top (required)>'
```
`rb_id_table_lookup()` writes to a `VALUE`, which is definitely a distinct
type from `st_table *`. With LTO, the compiler is allowed by N1256
§6.5p7 to remove the output parameter write via type-based alias
analysis.
See also: a0a8f2abf5
Check whether the current or previous frame is a Ruby frame in
call_trace_func and rb_tracearg_binding before attempting to
create a binding for the frame.
Fixes [Bug #18487]
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
We have seen some errors during test `setup` before `@tempdir` is
actually set, in particular, when instantiating `Gem::MockUI` which in
turn requires `stringio`. In this case, the `teardown` method will also
produce an error because it tries to remove the `@tempdir`, which has
not been set, so tries to remove a `nil` directory. It results in a
confusing error like
```
<internal:D:/a/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb>:85:in `require': Interrupt
Error: test_bump_one_level(TestGemVersion): TypeError: no implicit conversion of nil into String
C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:1570:in `path'
from <internal:D:/a/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:1570:in `block in fu_list'
from D:/a/rubygems/rubygems/lib/rubygems/mock_gem_ui.rb:43:in `initialize'
C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:1570:in `map'
from D:/a/rubygems/rubygems/test/rubygems/helper.rb:323:in `new'
C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:1570:in `fu_list'
from D:/a/rubygems/rubygems/test/rubygems/helper.rb:323:in `setup'
C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:616:in `rm_r'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:284:in `run_fixture_callback'
C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:638:in `rm_rf'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:272:in `block in create_fixtures_runner'
D:/a/rubygems/rubygems/test/rubygems/helper.rb:462:in `teardown'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:276:in `block in create_fixtures_runner'
===============================================================================
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:257:in `run_fixture'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:292:in `run_setup'
Finished in 683.0312862 seconds.
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:564:in `block in run'
-------------------------------------------------------------------------------
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:563:in `catch'
2185 tests, 5929 assertions, 0 failures, 1 errors, 28 pendings, 0 omissions, 0 notifications
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:563:in `run'
98.7185% passed
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test'
-------------------------------------------------------------------------------
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run'
3.20 tests/s, 8.68 assertions/sTerminate batch job (Y/N)?
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:67:in `run_suite'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:45:in `block (2 levels) in run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:102:in `with_listener'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:41:in `block in run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:39:in `catch'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:39:in `run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunner.rb:40:in `start_mediator'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunner.rb:25:in `start'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnerutilities.rb:24:in `run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:458:in `block in run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:514:in `change_work_directory'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:457:in `run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:66:in `run'
from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit.rb:518:in `block (2 levels) in <top (required)>'
rake aborted!
Interrupt:
```
The should make this same error much cleaner if it happens again.
https://github.com/rubygems/rubygems/commit/fa649d22e8