8000 Merge upstream Ruby (#42) · github/ruby@941da2e · GitHub
[go: up one dir, main page]

Skip to content

Commit 941da2e

Browse files
maximecbmameyui-knknobuBurdetteLamar
authored
Merge upstream Ruby (#42)
* compile.c: Pass node instead of nd_line(node) to ADD_INSN* functions ... then, new_insn_core extracts nd_line(node). Also, if a macro "EXPERIMENTAL_ISEQ_NODE_ID" is defined, this changeset keeps nd_node_id(node) for each instruction. This is intended for TypeProf to identify what AST::Node corresponds to each instruction. This patch is originally authored by @yui-knk for showing which column a NoMethodError occurred. ruby/ruby@master...yui-knk:feature/node_id Co-Authored-By: Yuichiro Kaneko <yui-knk@ruby-lang.org> * Fixed shorten-64-to-32 errors when USE_COMBINATION_EXPLOSION_CHECK * What's Here for class File (ruby#4460) What's Here for class File * * 2021-05-08 [ci skip] * What's Here for class Dir (ruby#4472) What's Here for class Dir * Shrink timev.rb iseq size * [ruby/irb] Dump ancestors' methods by ls command ruby/irb@73edff287c * [ruby/irb] Deal with different screen sizes ruby/irb@7118b3322f * Fix example code in Array#max doc `[0, 1, 2, 3].max(6)` actually returns `[3, 2, 1, 0]`, but the doc said it returns `[3, 2, 1]`. * Enhanced RDoc for Enumerable (ruby#4473) Enhanced RDoc for Enumerable: #grep and #grep_v. * * 2021-05-09 [ci skip] * Fix Math.cbrt(0.0) on glibc This should return 0, but on glibc it returned NaN. Fixes [Bug #17804] * rb_fiber_new_kw: doesn't exist Not against having such thing but currently we lack one. * * 2021-05-10 [ci skip] * LEGAL: Remove entries that no longer exist lib/bundler.gemspec and man/bundle-*,gemfile.* are now under the directory lib/bundler/. * Removed missing/dup2.c This function should be always available, as POSIX-compliant or Windows platform are required since 1.9. Also the code in this file is MT-unsafe. * [ruby/set] Adding section: What's Here ruby/set@ab81354de1 * [ruby/set] Adding section: What's Here ruby/set@254d927c8c * [ruby/set] Adding section: What's Here ruby/set@8f4c62768d * [ruby/set] Adding section: What's Here ruby/set@257dc452a7 * Add a space to separate sentences in the error message * [ruby/set] set is also dual licenses ruby/set@fc24457e53 * [ruby/psych] Use test-unit instead of minitest ruby/psych@01e7310dd3 * [ruby/psych] Use Ractor constant for ignoreing condition ruby/psych@cc5f957327 * [ruby/psych] Fixed test-case for NaN ruby/psych@f85a008263 * [ruby/psych] Use pend instead of skip ruby/psych@efd2a62c9a * [ruby/psych] Use assert_raise instead of assert_raises ruby/psych@e6ad12b4e1 * [ruby/psych] Cache access to Psych.load_tags in Visitor::ToRuby ruby/psych@58223f0426 * [ruby/psych] Cache dispatch cache in an instance variable ruby/psych@285c461cd2 * [ruby/psych] Fix custom marshalization with symbolize_names: true ruby/psych@ee26f26ab5 * [ruby/psych] Update to latest SnakeYAML Fixes jruby/jruby#6365 ruby/psych@a88ff77f02 * [ruby/psych] docs: fix simple typo, expessed -> expressed There is a small typo in ext/psych/yaml/yaml.h. Should read `expressed` rather than `expessed`. ruby/psych@1150d669cb * [ruby/psych] bump version ruby/psych@091cd46b1f * [ruby/psych] Fix some typos [ci skip] ruby/psych@98617e55a1 * Enhanced RDoc for Enumerable (ruby#4479) Methods treated: #count #find #find_index #select #filter_map #reject #map #flat_map * * 2021-05-11 [ci skip] * .github/compilers/workflows.yml: support GCC-11 GCC 11.1 was released. https://gcc.gnu.org/pipermail/gcc/2021-April/235922.html See also ruby/ruby-ci-image#1 * [ruby/irb] Treat encodings in exception correctly ruby/irb@4452adbe04 * Simplify syncing bundler These files no longer exist upstream, so they don't need to be synced. * Properly synchronize bundler gemspec too By making the necessary modifications automatically. * Sync bundler & rubygems at the same time * Sync bundler & rubygems * [ruby/resolv] Fix confusion of received response message This is a follow up for commit 33fb966197f1 ("Remove sender/message_id pair after response received in resolv", 2020-09-11). As the @senders instance variable is also used for tracking transaction ID allocation, simply removing an entry without releasing the ID would eventually deplete the ID space and cause Resolv::DNS.allocate_request_id to hang. It seems the intention of the code was to check that the received DNS message is actually the response for the question made within the method earlier. Let's have it actually do so. [Bug ruby#12838] https://bugs.ruby-lang.org/issues/12838 [Bug #17748] https://bugs.ruby-lang.org/issues/17748 ruby/resolv@53ca9c9209 * [ruby/irb] Skip the new IRB test on Windows for now It's not passing from the beginning https://github.com/ruby/ruby/runs/2550929220 https://ci.appveyor.com/project/ruby/ruby/builds/39100747 ruby/irb@71fc180018 * Retry choco install by using a wrapper provided by GitHub Actions actions/runner-images#721 to address failures like https://github.com/ruby/ruby/runs/2551980671 * Try running Choco-Install with powershell https://github.com/ruby/ruby/runs/2552047430 * test/irb/test_raise_no_backtrace_exception.rb: UTF-8 is expected ... for the output of assert_in_out_err. This will fix the following failure on many CI machines http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20210511T030005Z.fail.html.gz ``` 1) Failure: TestIRB::TestRaiseNoBacktraceException#test_raise_exception_with_different_encoding_containing_invalid_byte_sequence [/home/chkbuild/chkbuild/tmp/build/20210511T030005Z/ruby/test/irb/test_raise_no_backtrace_exception.rb:41]: pid 221531 exit 0. 1. [1/2] Assertion for "stdout" | invalid byte sequence in US-ASCII. ``` * Split a Choco-Install command In https://github.com/ruby/ruby/runs/2552065052, while it failed to install winflexbison3, it exited the retry loop because openssl was installed successfully. https://github.com/actions/virtual-environments/blob/a5ee51f72dcbc3879a91a74c63f95737e2d4a292/images/win/scripts/ImageHelpers/ChocoHelpers.ps1 * Explicitly specify encoding for another test as well Same as e2ccc33 https://ci.appveyor.com/project/ruby/ruby/builds/39102539/job/k8m1yrrjesxbgvtq * [ruby/irb] Skip test_raise_exception_with_invalid_byte_sequence on Windows for now. It seems like we haven't figured this out yet. ruby/irb@ecf5a1ace1 * [ruby/irb] Fix `Encoding::ConverterNotFoundError` Follow ruby/irb#237. This PR fixes the following `Encoding::ConverterNotFoundError`. ```console % bin/spring stop && bin/rails c Spring stopped. Running via Spring preloader in process 58395 Loading development environment (Rails 6.0.3.7) irb(main):001:0> "こんにちは".do_something Traceback (most recent call last): (snip) 12: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:547:in `eval_input' 11: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:232:in `each_top_level_statement' 10: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:232:in `catch' 9: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:233:in `block in each_top_level_statement' 8: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:233:in `loop' 7: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:251:in `block (2 levels) in each_top_level_statement' 6: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:548:in `block in eval_input' 5: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:758:in `signal_status' 4: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:586:in `block (2 levels) in eval_input' 3: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:650:in `handle_exception' 2: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `encode_with_invalid_byte_sequence' 1: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `new' /Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `initialize': code converter not found (UTF-8 to UTF-8) (Encoding::ConverterNotFoundError) ``` First, this patch skips `Encoding::Converter.new` for the same encoding. https://github.com/ruby/irb/blob/170531df19bce289444afe97360480efed5f27f0/lib/irb.rb#L601 Next, this is a talk about the condition for skipping. `IRB.conf[:LC_MESSAGES].encoding` becomes `"UTF-8"` string when `Reline.encoding_system_needs.name` is set in the below. https://github.com/ruby/irb/blob/170531df19bce289444afe97360480efed5f27f0/lib/irb/input-method.rb#L269 OTOH, `message.encoding` is `Encoding::UTF_8`, so these are compared as a string by this patch. ruby/irb@6df6e76cfc * Alias assert/refute_path_exists for test-unit gem. It's required at rubygems/rubygems#3141 * test/irb/test_raise_no_backtrace_exception.rb: Set LC_MESSAGES as UTF-8 * Fix a typo of c6a11b8 It failed to define `refute_path_not_exist` * Workaround for make test-tool * Method cache: fix refinement entry handling To invalidate some callable method entries, we replace the entry in the class. Most types of method entries are on the method table of the origin class, but refinement entries without an orig_me are housed in the method table of the class itself. They are there because refinements take priority over prepended methods. By unconditionally inserting a copy of the refinement entry into the origin class, clearing the method cache created situations where there are refinement entry duplicates in the lookup chain, leading to infinite loops and other problems. Update the replacement logic to use the right class that houses the method entry. Also, be more selective about cache invalidation when moving refinement entries for prepend. This avoids calling clear_method_cache_by_id_in_class() before refinement entries are in the place it expects. [Bug #17806] * * 2021-05-12 [ci skip] * Add a cache for class variables This change implements a cache for class variables. Previously there was no cache for cvars. Cvar access is slow due to needing to travel all the way up th ancestor tree before returning the cvar value. The deeper the ancestor tree the slower cvar access will be. The benefits of the cache are more visible with a higher number of included modules due to the way Ruby looks up class variables. The benchmark here includes 26 modules and shows with the cache, this branch is 6.5x faster when accessing class variables. ``` compare-ruby: ruby 3.1.0dev (2021-03-15T06:22:34Z master 9e5105c) [x86_64-darwin19] built-ruby: ruby 3.1.0dev (2021-03-15T12:12:44Z add-cache-for-clas.. c6be009) [x86_64-darwin19] | |compare-ruby|built-ruby| |:--------|-----------:|---------:| |vm_cvar | 5.681M| 36.980M| | | -| 6.51x| ``` Benchmark.ips calling `ActiveRecord::Base.logger` from within a Rails application. ActiveRecord::Base.logger has 71 ancestors. The more ancestors a tree has, the more clear the speed increase. IE if Base had only one ancestor we'd see no improvement. This benchmark is run on a vanilla Rails application. Benchmark code: ```ruby require "benchmark/ips" require_relative "config/environment" Benchmark.ips do |x| x.report "logger" do ActiveRecord::Base.logger end end ``` Ruby 3.0 master / Rails 6.1: ``` Warming up ----------- 8000 --------------------------- logger 155.251k i/100ms Calculating ------------------------------------- ``` Ruby 3.0 with cvar cache / Rails 6.1: ``` Warming up -------------------------------------- logger 1.546M i/100ms Calculating ------------------------------------- logger 14.857M (± 4.8%) i/s - 74.198M in 5.006202s ``` Lastly we ran a benchmark to demonstate the difference between master and our cache when the number of modules increases. This benchmark measures 1 ancestor, 30 ancestors, and 100 ancestors. Ruby 3.0 master: ``` Warming up -------------------------------------- 1 module 1.231M i/100ms 30 modules 432.020k i/100ms 100 modules 145.399k i/100ms Calculating ------------------------------------- 1 module 12.210M (± 2.1%) i/s - 61.553M in 5.043400s 30 modules 4.354M (± 2.7%) i/s - 22.033M in 5.063839s 100 modules 1.434M (± 2.9%) i/s - 7.270M in 5.072531s Comparison: 1 module: 12209958.3 i/s 30 modules: 4354217.8 i/s - 2.80x (± 0.00) slower 100 modules: 1434447.3 i/s - 8.51x (± 0.00) slower ``` Ruby 3.0 with cvar cache: ``` Warming up -------------------------------------- 1 module 1.641M i/100ms 30 modules 1.655M i/100ms 100 modules 1.620M i/100ms Calculating ------------------------------------- 1 module 16.279M (± 3.8%) i/s - 82.038M in 5.046923s 30 modules 15.891M (± 3.9%) i/s - 79.459M in 5.007958s 100 modules 16.087M (± 3.6%) i/s - 81.005M in 5.041931s Comparison: 1 module: 16279458.0 i/s 100 modules: 16087484.6 i/s - same-ish: difference falls within error 30 modules: 15891406.2 i/s - same-ish: difference falls within error ``` Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> * Filling cache values on cvar write Instead of on read. Once it's in the inline cache we never have to make one again. We want to eventually put the value into the cache, and the best opportunity to do that is when you write the value. * Revert "Filling cache values on cvar write" This reverts commit 08de37f. This reverts commit e8ae922. * Run nmake check on Actions (ruby#4487) * Run nmake check on Actions * Skip tests not working in mswin GitHub Actions * Override TEMP * Revert "Skip tests not working in mswin GitHub Actions" This reverts commit 544d257. * Revert "Revert "Skip tests not working in mswin GitHub Actions"" This reverts commit e1f8ad7. * Fix timeouts * Skip some more broken tests * Update windows.yml * Add a guard for rbasic_spec * Revert "Update windows.yml" This reverts commit bc9694b. * Skip the ensure clause * Simplify the ensure * Update keyword argument description in method syntax guide Remove discussion of Ruby 2.7 specific handling of keyword argument separation. Add a small example of keyword to positional hash conversion for methods not accepting keyword arguments. * [ruby/net-ftp] Bump version to 0.1.2 ruby/net-ftp@895ba44b3c * cdhash_cmp: can take rational literals Rational literals are those integers suffixed with `r`. They tend to be a part of more complex expressions like `123/456r`, but in theory they can live alone. When such "bare" rational literals are passed to case-when branch, we have to take care of them. Fixes [Bug #17854] * cdhash_cmp: rational literals with fractions Nobu kindly pointed out that rational literals can have fractions. * cdhash_cmp: can also take complex There are complex literals `123i`, which can also be a case condition. * cdhash_cmp: recursively apply For instance a rational's numerator can be a bignum. Comparison using C's == can be insufficient. * cdhash_cmp: should use || cf: ruby#4469 (comment) * test_cdhash: refactor change class It is now strange to test Complex in a class named Rational_Test. * suppress warnings on repeat tests. Constant definitions are affect on outer namespace of an anonymous module. To define constants on the anonymous module, this patch uses Module#class_eval(str). * skip test for debug. test_memsize_of_iseq fails on repeat tests and it seems to difficult to solve immediately. Now this test is skipped. It seems that the result of `memsize_of(Object.new)` are increased. Why...? * [rubygems/rubygems] Use test-unit instead of minitest rubygems/rubygems@a8571524ad * [rubygems/rubygems] Use capture_output instead of capture_io. rubygems/rubygems@ad9206d4d0 * [rubygems/rubygems] Also use capture_output instead of capture_io rubygems/rubygems@229858ea56 * [rubygems/rubygems] Use Regexp with refute_match rubygems/rubygems@51fdbe53bc * [rubygems/rubygems] Extract assert_output to assert_empty and assert_equal with capture_output rubygems/rubygems@f6759440a4 * [rubygems/rubygems] Use assert_path_exist and assert_path_not_exist instead of assert_path_exists and refute_path_exists rubygems/rubygems@a7c93558c3 * [rubygems/rubygems] Use capture_output instead of capture_io for test-unit rubygems/rubygems@ab9c80d4cb * [rubygems/rubygems] Use capture_output instead of assert_silent rubygems/rubygems@3225aab7f8 * [rubygems/rubygems] Use dummy assertion for assert_https rubygems/rubygems@64d843fe17 * [rubygems/rubygems] Use assert_raise instead of assert_raises rubygems/rubygems@769e87f011 * [rubygems/rubygems] Use capture_output instead of capture_io rubygems/rubygems@c46185abe3 * [rubygems/rubygems] Rewrite with capture_output rubygems/rubygems@a091004ded * [rubygems/rubygems] Import capture_subprocess_io from minitest rubygems/rubygems@8b2ca6df3a * [rubygems/rubygems] Fixed variable scope at test_silent_system rubygems/rubygems@bfcdf79657 * [rubygems/rubygems] capture_output will return empty string, not nil rubygems/rubygems@3fa93f6144 * [rubygems/rubygems] Removed minitest/mock from test_gem_package_tar_writer.rb rubygems/rubygems@45464bfcbd * [rubygems/rubygems] Removed minitest/mock from test/rubygems/test_gem_remote_fetcher.rb rubygems/rubygems@f1af59fe02 * [rubygems/rubygems] Don't use Minitest::Mock rubygems/rubygems@d3fa893597 * [rubygems/rubygems] util/rubocop -a rubygems/rubygems@a10ff97830 * [rubygems/rubygems] Replace skip to pend rubygems/rubygems@0b145135c7 * [rubygems/rubygems] Added comment for Minitest::Mock rubygems/rubygems@ae44b68d57 * [rubygems/rubygems] Fixed an intentional blank-line rubygems/rubygems@795b572ac2 * [rubygems/rubygems] Removed the related code for minitest-bisect rubygems/rubygems@83ebdec27a * [rubygems/rubygems] Update the link of minitest code with the commit hash. rubygems/rubygems@e7280f8d30 * [rubygems/rubygems] Added begin-end block for java platform Because pend of test-unit raises exception. rubygems/rubygems@b5e2d0855a * Revert 924ce2c5ba4d1c1dc781a6a06682204d358421bb Because test-unit didn't provide the benchmark test. And This test is fragile with the several environments. * Use assert_raise instead of assert_raises * Use another class for the comparison. `memsize_of(Object.new)` can be changed with past ivar creation history for Object instances (another Object instance has 4 or more ivars, next created Object instance has the area for the ivars). So use antoher class for the comparison. * * remove trailing spaces. [ci skip] * parse.y: Allow "command" syntax in endless method definition This change allows `def hello = puts "Hello"` without parentheses. Note that `private def hello = puts "Hello"` does not parse for technical reason. [Feature #17398] * * 2021-05-13 [ci skip] * [rubygems/rubygems] Use `Time.stub :now` to avoid a random failure Essentially this reverts 45464bfcbdf9f9cfb440950bc57a27d237627a17. The commit removed a mock of Time.now, which caused a random failure. http://rubyci.s3.amazonaws.com/ubuntu1804/ruby-master/log/20210512T123004Z.fail.html.gz ``` 1) Failure: TestGemPackageTarWriter#test_add_file_signer [/home/chkbuild/chkbuild/tmp/build/20210512T123004Z/ruby/test/rubygems/test_gem_package_tar_writer.rb:117]: Field mtime of the tar header differs.. <"14046746312\u0000"> expected but was <"14046746311\x00">. ``` Object#stub is defined at f1af59fe02ef2cc58f13e2742e4cc6cf8c2a1a20, so now `Time.stub :now` works. rubygems/rubygems@85f60a9ed0 * Fix handling of control/meta escapes in literal regexps Ruby uses a recursive algorithm for handling control/meta escapes in strings (read_escape). However, the equivalent code for regexps (tokadd_escape) in did not use a recursive algorithm. Due to this, Handling of control/meta escapes in regexp did not have the same behavior as in strings, leading to behavior such as the following returning nil: ```ruby /\c\xFF/ =~ "\c\xFF" ``` Switch the code for handling \c, \C and \M in literal regexps to use the same code as for strings (read_escape), to keep behavior consistent between the two. Fixes [Bug #14367] * Avoid improper optimization of case statements mixed integer/rational/complex Fixes [Bug #17857] * Also `\U` after control/meta is invalid [Bug #17861] As well as `\u`, `\U` should be invalid there too. And highlight including `u`/`U` not only the backslash before it. * Try to fix MJIT symbol clash with cargo cult Co-authored-by: Yusuke Endoh <mame@ruby-lang.org> Co-authored-by: Yuichiro Kaneko <yui-knk@ruby-lang.org> Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Burdette Lamar <BurdetteLamar@Yahoo.com> Co-authored-by: git <svn-admin@ruby-lang.org> Co-authored-by: Masataka Pocke Kuwabara <kuwabara@pocke.me> Co-authored-by: Jeremy Evans <code@jeremyevans.net> Co-authored-by: 卜部昌平 <shyouhei@ruby-lang.org> Co-authored-by: Andrei Beliankou <arbox@yandex.ru> Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org> Co-authored-by: Jean Boussier <jean.boussier@gmail.com> Co-authored-by: Charles Oliver Nutter <headius@headius.com> Co-authored-by: Tim Gates <tim.gates@iress.com> Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Co-authored-by: Ryuta Kamizono <kamipo@gmail.com> Co-authored-by: aycabta <aycabta@gmail.com> Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> Co-authored-by: Kazuki Yamaguchi <k@rhe.jp> Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Koichi ITO <koic.ito@gmail.com> Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: eileencodes <eileencodes@gmail.com> Co-authored-by: Shugo Maeda <shugo@ruby-lang.org> Co-authored-by: Koichi Sasada <ko1@atdot.net>
2 parents 31a6b88 + 5abb125 commit 941da2e

File tree

229 files changed

+3994
-2472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+3994
-2472
lines changed

.github/workflows/compilers.yml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on: [push, pull_request]
66
# environment variables (plus the "echo ::set-env" hack) is to reroute that
77
# restriction.
88
env:
9-
default_cc: clang-11
9+
default_cc: clang-13
1010
append_cc: ''
1111
crosshost: ''
1212

@@ -47,33 +47,34 @@ jobs:
4747
fail-fast: false
4848
matrix:
4949
entry:
50-
- { key: default_cc, name: gcc-10, value: gcc-10 }
51-
# - { key: default_cc, name: gcc-9, value: gcc-9 }
52-
# - { key: default_cc, name: gcc-8, value: gcc-8 }
53-
# - { key: default_cc, name: gcc-7, value: gcc-7 }
54-
# - { key: default_cc, name: gcc-6, value: gcc-6 }
55-
# - { key: default_cc, name: gcc-5, value: gcc-5 }
56-
- { key: default_cc, name: gcc-4.8, value: gcc-4.8 }
57-
- { key: default_cc, name: clang-13, value: clang-13 }
58-
# - { key: default_cc, name: clang-12, value: clang-12 }
59-
# - { key: default_cc, name: clang-11, value: clang-11 }
60-
# - { key: default_cc, name: clang-10, value: clang-10 }
61-
# - { key: default_cc, name: clang-9, value: clang-9 }
62-
# - { key: default_cc, name: clang-8, value: clang-8 }
63-
# - { key: default_cc, name: clang-7, value: clang-7 }
64-
# - { key: default_cc, name: clang-6.0, value: clang-6.0 }
65-
# - { key: default_cc, name: clang-5.0, value: clang-5.0 }
66-
# - { key: default_cc, name: clang-4.0, value: clang-4.0 }
67-
- { key: default_cc, name: clang-3.9, value: clang-3.9 }
68-
69-
- { key: crosshost, name: aarch64-linux-gnu, value: aarch64-linux-gnu }
50+
- { key: default_cc, name: gcc-11, value: gcc-11, container: gcc-11 }
51+
- { key: default_cc, name: gcc-10, value: gcc-10, container: gcc-10 }
52+
- { key: default_cc, name: gcc-9, value: gcc-9, container: gcc-9 }
53+
- { key: default_cc, name: gcc-8, value: gcc-8, container: gcc-8 }
54+
- { key: default_cc, name: gcc-7, value: gcc-7, container: gcc-7 }
55+
- { key: default_cc, name: gcc-6, value: gcc-6, container: gcc-6 }
56+
- { key: default_cc, name: gcc-5, value: gcc-5, container: gcc-5 }
57+
- { key: default_cc, name: gcc-4.8, value: gcc-4.8, container: gcc-4.8 }
58+
- { key: default_cc, name: clang-13, value: clang-13, container: clang-13 }
59+
- { key: default_cc, name: clang-12, value: clang-12, container: clang-12 }
60+
- { key: default_cc, name: clang-11, value: clang-11, container: clang-11 }
61+
- { key: default_cc, name: clang-10, value: clang-10, container: clang-10 }
62+
- { key: default_cc, name: clang-9, value: clang-9, container: clang-9 }
63+
- { key: default_cc, name: clang-8, value: clang-8, container: clang-8 }
64+
- { key: default_cc, name: clang-7, value: clang-7, container: clang-7 }
65+
- { key: default_cc, name: clang-6.0, value: clang-6.0, container: clang-6.0 }
66+
- { key: default_cc, name: clang-5.0, value: clang-5.0, container: clang-5.0 }
67+
- { key: default_cc, name: clang-4.0, value: clang-4.0, container: clang-4.0 }
68+
- { key: default_cc, name: clang-3.9, value: clang-3.9, container: clang-3.9 }
69+
70+
- { key: crosshost, name: aarch64-linux-gnu, value: aarch64-linux-gnu, container: crossbuild-essential-arm64 }
7071
# - { key: crosshost, name: arm-linux-gnueabi, value: arm-linux-gnueabi }
7172
# - { key: crosshost, name: arm-linux-gnueabihf, value: arm-linux-gnueabihf }
7273
# - { key: crosshost, name: i686-w64-mingw32, value: i686-w64-mingw32 }
7374
# - { key: crosshost, name: powerpc-linux-gnu, value: powerpc-linux-gnu }
74-
- { key: crosshost, name: powerpc64le-linux-gnu, value: powerpc64le-linux-gnu }
75-
- { key: crosshost, name: s390x-linux-gnu, value: s390x-linux-gnu }
76-
- { key: crosshost, name: x86_64-w64-mingw32, value: x86_64-w64-mingw32 }
75+
- { key: crosshost, name: powerpc64le-linux-gnu, value: powerpc64le-linux-gnu, container: crossbuild-essential-ppc64el }
76+
- { key: crosshost, name: s390x-linux-gnu, value: s390x-linux-gnu, container: crossbuild-essential-s390x }
77+
- { key: crosshost, name: x86_64-w64-mingw32, value: x86_64-w64-mingw32, container: mingw-w64 }
7778

7879
- { key: append_cc, name: c99, value: '-std=c99 -Werror=pedantic -pedantic-errors' }
7980
# - { key: append_cc, name: c11, value: '-std=c11 -Werror=pedantic -pedantic-errors' }
@@ -156,7 +157,7 @@ jobs:
156157

157158
name: ${{ matrix.entry.name }}
158159
runs-on: ubuntu-latest
159-
container: ghcr.io/ruby/ruby-ci-image:latest
160+
container: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || 'clang-13' }}
160161
steps:
161162
- run: mkdir build
162163
working-directory:

.github/workflows/windows.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
make:
55
strategy:
66
matrix:
7-
test_task: [test]
7+
test_task: [check] # to make job names consistent
88
os: [windows-2019]
99
vs: [2019]
1010
fail-fast: false
@@ -35,7 +35,11 @@ jobs:
3535
${{ runner.os }}-chocolatey-
3636
- name: Install libraries with chocolatey
3737
run: |
38-
choco install --no-progress openssl winflexbison3
38+
# Using Choco-Install for retries, but it doesn't detect failures properly
39+
# if you pass multiple package names in a single command.
40+
Choco-Install -PackageName openssl
41+
Choco-Install -PackageName winflexbison3
42+
shell: pwsh
3943
- name: git config
4044
run: |
4145
git config --global core.autocrlf false
@@ -58,10 +62,24 @@ jobs:
5862
nmake extract-extlibs
5963
nmake
6064
- name: nmake test
61-
timeout-minutes: 30
65+
timeout-minutes: 5
6266
run: |
6367
call "%VCVARS%"
64-
nmake ${{ matrix.test_task }}
68+
nmake test
69+
- name: nmake test-all
70+
timeout-minutes: 60
71+
run: |
72+
call "%VCVARS%"
73+
# %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
74+
# https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
75+
set TMP=%USERPROFILE%\AppData\Local\Temp
76+
set TEMP=%USERPROFILE%\AppData\Local\Temp
77+
nmake test-all
78+
- name: nmake test-spec
79+
timeout-minutes: 10
80+
run: |
81+
call "%VCVARS%"
82+
nmake test-spec
6583
- uses: k0kubun/action-slack@v2.0.0
6684
with:
6785
payload: |

LEGAL

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ mentioned below.
531531
[include/ruby/st.h]
532532
[missing/acosh.c]
533533
[missing/alloca.c]
534-
[missing/dup2.c]
535534
[missing/erf.c]
536535
[missing/finite.c]
537536
[missing/hypot.c]
@@ -934,9 +933,7 @@ mentioned below.
934933

935934
[lib/bundler]
936935
[lib/bundler.rb]
937-
[lib/bundler.gemspec]
938936
[spec/bundler]
939-
[man/bundle-*,gemfile.*]
940937

941938
Bundler is under the following license.
942939

array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5737,7 +5737,7 @@ ary_max_opt_string(VALUE ary, long i, VALUE vmax)
57375737
* With an argument \Integer +n+ and no block, returns a new \Array with at most +n+ elements,
57385738
* in descending order per method <tt><=></tt>:
57395739
* [0, 1, 2, 3].max(3) # => [3, 2, 1]
5740-
* [0, 1, 2, 3].max(6) # => [3, 2, 1]
5740+
* [0, 1, 2, 3].max(6) # => [3, 2, 1, 0]
57415741
*
57425742
* When a block is given, the block must return an \Integer.
57435743
*

ast.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,17 @@ ast_node_type(rb_execution_context_t *ec, VALUE self)
245245
return rb_sym_intern_ascii_cstr(node_type_to_str(data->node));
246246
}
247247

248+
#ifdef EXPERIMENTAL_ISEQ_NODE_ID
249+
static VALUE
250+
ast_node_node_id(VALUE self)
251+
{
252+
struct ASTNodeData *data;
253+
TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
254+
255+
return INT2FIX(nd_node_id(data->node));
256+
}
257+
#endif
258+
248259
#define NEW_CHILD(ast, node) node ? ast_new_internal(ast, node) : Qnil
249260

250261
static VALUE
@@ -695,4 +706,7 @@ Init_ast(void)
695706
rb_mAST = rb_define_module_under(rb_cRubyVM, "AbstractSyntaxTree");
696707
rb_cNode = rb_define_class_under(rb_mAST, "Node", rb_cObject);
697708
rb_undef_alloc_func(rb_cNode);
709+
#ifdef EXPERIMENTAL_ISEQ_NODE_ID
710+
rb_define_method(rb_cNode, "node_id", ast_node_node_id, 0);
711+
#endif
698712
}

class.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,10 +1181,12 @@ cache_clear_refined_method(ID key, VALUE value, void *data)
11811181
{
11821182
rb_method_entry_t *me = (rb_method_entry_t *) value;
11831183

1184-
if (me->def->type == VM_METHOD_TYPE_REFINED) {
1184+
if (me->def->type == VM_METHOD_TYPE_REFINED && me->def->body.refined.orig_me) {
11851185
VALUE klass = (VALUE)data;
11861186
rb_clear_method_cache(klass, me->called_id);
11871187
}
1188+
// Refined method entries without an orig_me is going to stay in the method
1189+
// table of klass, like before the move, so no need to clear the cache.
11881190

11891191
return ID_TABLE_CONTINUE;
11901192
}

common.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,6 +2818,7 @@ compile.$(OBJEXT): $(top_srcdir)/internal/hash.h
28182818
compile.$(OBJEXT): $(top_srcdir)/internal/imemo.h
28192819
compile.$(OBJEXT): $(top_srcdir)/internal/numeric.h
28202820
compile.$(OBJEXT): $(top_srcdir)/internal/object.h
2821+
compile.$(OBJEXT): $(top_srcdir)/internal/rational.h
28212822
compile.$(OBJEXT): $(top_srcdir)/internal/re.h
28222823
compile.$(OBJEXT): $(top_srcdir)/internal/serial.h
28232824
compile.$(OBJEXT): $(top_srcdir)/internal/static_assert.h

0 commit comments

Comments
 (0)
0