74915 Commits

Author SHA1 Message Date
Takashi Kokubun
29bf5495a9 Do not use the same variable for multiple things
`conv` proc is used before and after the `url` variable is updated. So
this script didn't seem to behave correctly for the "Close #xxx" syntax.

Reusing the same variable name for different things seems prone to errors.
2022-11-25 21:45:28 -08:00
Takashi Kokubun
95647378ff Support other GitHub PR/issue syntaxes
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
2022-11-25 21:44:21 -08:00
Takashi Kokubun
7cf94a611f Allow an arbitrary number of newlines 2022-11-25 21:36:40 -08:00
Takashi Kokubun
91c7e8afc4 Revert "Update default gems list at 574896a0ce99ab00676aa5ff2fabd3 [ci skip]"
This reverts commit eb3a6ae524b029e96738f21931d95dfad1caed2f.
2022-11-25 21:36:16 -08:00
git
eb3a6ae524 Update default gems list at 574896a0ce99ab00676aa5ff2fabd3 [ci skip] 2022-11-26 05:33:02 +00:00
Takashi Kokubun
574896a0ce [ruby/erb] Define ERB::Escape module
(https://github.com/ruby/erb/pull/38)

Close #32
2022-11-26 05:32:25 +00:00
Nobuyoshi Nakada
15be9ecbcc
Revert "Update default gems list at d0bb24c497ceae01cc7b7698365982 [ci skip]"
This reverts commit ba26dd7ba557f1a8d58251bb8437d579e0d5d23a, which
duplicates the list.
2022-11-26 13:29:17 +09:00
git
ba26dd7ba5 Update default gems list at d0bb24c497ceae01cc7b7698365982 [ci skip] 2022-11-26 04:13:23 +00:00
Nobuyoshi Nakada
d0bb24c497
[DOC] Fix loose and tight lists
The MarkDown parser of RDoc does not allow mixing loose and tight
lists, and the results may be very unexpected otherwise.
2022-11-26 13:12:10 +09:00
Nobuyoshi Nakada
19fdc9cac2
[DOC] Fix indents of nested bullet lists 2022-11-26 13:12:10 +09:00
Nobuyoshi Nakada
6bd86bb2af
Follow the NEWS.md change up [ci skip] 2022-11-26 13:11:24 +09:00
Takashi Kokubun
ac4d00df82 MJIT: Change default --mjit-max-cache back to 100
These days we benchmark MJIT using yjit-bench. The warmup duration in
yjit-bench is very short, so compiling many methods comes at a cost even
while it's actually optimal for MJIT to compile everything / tens of
thousands of methods once it reaches the peak performance.

yjit-bench doesn't necessarily represent the peak performance on production.
It measures the performance of Ruby 30~60s after boot. If your JIT takes
more than 1 minute to warm up, there's no way for the JIT to make the numbers
good on yjit-bench.

Until we make MJIT's compilation much faster, we don't afford compiling
10,000 methods on yjit-bench.

This change alone makes MJIT's benchmark number on railsbench 2x better :p
2022-11-25 15:55:19 -08:00
Takashi Kokubun
3c16f33ffd MJIT: Refactor source_shape_id extraction
I'm not comfortable indenting code that deeply.
2022-11-25 15:27:27 -08:00
Takashi Kokubun
89a98ee1e1 MJIT: Remove obsoleted variable
no longer used after 4ea9d7d7c223ff92365c4a013fc1bd073d67a3a5
2022-11-25 15:23:43 -08:00
Takashi Kokubun
4ea9d7d7c2 MJIT: Remove the code to optimize shape transition
because this code crashes on railsbench. I'll try adding a repro for it
later, but I don't know shapes enough to craft it right away.
2022-11-25 15:18:34 -08:00
Alan Wu
1d64a5a7c0 YJIT: Run test-all tests without requiring RUN_OPTS
Most tests in test_yjit.rb use a sub process, so we can run them even
when the parent process is not running with YJIT. Run them so simply
running `make check` tests YJIT a bit.

[Misc #19149]
2022-11-25 17:15:24 -05:00
Alan Wu
790cf4b6d0 Fix autoload status of statically linked extensions
Previously, for statically-linked extensions, we used
`vm->loading_table` to delay calling the init function until the
extensions are required. This caused the extensions to look like they
are in the middle of being loaded even before they're required.
(`rb_feature_p()` returned true with a loading path output.) Combined
with autoload, queries like `defined?(CONST)` and `Module#autoload?`
were confused by this and returned nil incorrectly. RubyGems uses
`defined?` to detect if OpenSSL is available and failed when OpenSSL was
available in builds using `--with-static-linked-ext`.

Use a dedicated table for the init functions instead of adding them to
the loading table. This lets us remove some logic from non-EXTSTATIC
builds.

[Bug #19115]
2022-11-25 16:21:40 -05:00
StepSecurity Bot
e15cd01149 [StepSecurity] ci: Harden GitHub Actions
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2022-11-25 20:12:23 +09:00
Nobuyoshi Nakada
8a50db7dfa
NEWS: "Find pattern" is not related to find.rb [ci skip] 2022-11-25 19:53:35 +09:00
Nobuyoshi Nakada
26baf4813e
[Feature #18925] [DOC] Add FileUtils.ln_sr to NEWS 2022-11-25 19:51:31 +09:00
Nobuyoshi Nakada
e9d6d2a579
[DOC] Fix AST documents
- Fix indents of `tokens`, to make the contents of Token a list
- Move the example of `tokens` to separate from the above list
- Markup keyword argument and method name
2022-11-25 19:42:47 +09:00
Nobuyoshi Nakada
fb7598fb3e
[DOC] Remove extraneous backticks
So cross-references to defined classes/modules/methods work.
2022-11-25 19:17:44 +09:00
Nobuyoshi Nakada
4ab89d57bb
Fix indents in NEWS [ci skip]
The MarkDown parser in RDoc requires 4 columns indentation for
paragraphs following list items.
2022-11-25 19:07:21 +09:00
Takashi Kokubun
addb1cbbfd [ruby/erb] Keep ERB::Util#html_escape private
ERB::Util.html_escape has been public, but ERB::Util#html_escape had
been private.

https://github.com/ruby/erb/commit/e62210bf56
2022-11-25 08:54:18 +00:00
Nobuyoshi Nakada
58dc9c931b [rubygems/rubygems] Stop installing everything under "lib" at the top in all tests
https://github.com/rubygems/rubygems/commit/f9772d62e1
2022-11-25 08:02:28 +00:00
Nobuyoshi Nakada
64c8ed272f remain no longer starts with 0 2022-11-25 16:11:17 +09:00
Nobuyoshi Nakada
ffc6c5d056 [Bug #18971] Add precheck to enumerator 2022-11-25 16:11:17 +09:00
Nobuyoshi Nakada
67d0f4821f [Bug #19145] volatile on an argument may not be effective 2022-11-25 15:50:06 +09:00
Nobuyoshi Nakada
45bad8c7b8 The mode flags may be clobbered by tag jumps 2022-11-25 15:50:06 +09:00
yui-knk
e29d9e9fba Add examples to error_tolerant option in NEWS [ci skip] 2022-11-25 15:36:00 +09:00
Koichi Sasada
67766cd55c add debug context APIs for debuggers (frame depth)
The following new debug context APIs are for implementing debugger's
`next` (step over) and similar functionality.

* `rb_debug_inspector_frame_depth(dc, index)` returns `index`-th
  frame's depth.
* `rb_debug_inspector_current_depth()` returns current frame depth.

The frame depth is not related to the frame index because debug
context API skips some special frames but proposed `_depth()` APIs
returns the count of all frames (raw depth).
2022-11-25 14:01:36 +09:00
Jeremy Evans
571d21fd4a Make String#rstrip{,!} raise Encoding::CompatibilityError for broken coderange
It's questionable whether we want to allow rstrip to work for strings
where the broken coderange occurs before the trailing whitespace and
not after, but this approach is probably simpler, and I don't think
users should expect string operations like rstrip to work on broken
strings.

In some cases, this changes rstrip to raise
Encoding::CompatibilityError instead of ArgumentError.  However, as
the problem is related to an encoding issue in the receiver, and due
not due to an issue with an argument, I think
Encoding::CompatibilityError is the more appropriate error.

Fixes [Bug #18931]
2022-11-24 18:24:42 -08:00
Nobuyoshi Nakada
c6330cd32b [ruby/fileutils] [Feature #18925] Add ln_sr method and relative: option to ln_s
https://github.com/ruby/fileutils/commit/5116088d5c
2022-11-25 01:03:57 +00:00
Nobuyoshi Nakada
1a47521c44
Use rb_sprintf instead of deprecated sprintf 2022-11-25 08:51:14 +09:00
Takashi Kokubun
bcdfe12919 [ruby/erb] Allow requiring erb/escape.so alone
(https://github.com/ruby/erb/pull/37)

Prior to this commit, requiring erb/escape first and then requiring erb
did not work as expected.
2022-11-24 23:49:15 +00:00
Takashi Kokubun
8ac4081aa8 [ruby/erb] Split erb.rb into files for each module under ERB
(https://github.com/ruby/erb/pull/36)

https://github.com/ruby/erb/commit/f74833cc07
2022-11-24 23:40:53 +00:00
Takashi Kokubun
c480f589c2 [ruby/erb] Rename erb.so to erb/escape.so
(https://github.com/ruby/erb/pull/35)

https://github.com/ruby/erb/commit/1280046952
2022-11-24 23:22:00 +00:00
Jeremy Evans
04a92a6764 Raise TypeError for endless non-numeric range include?
Beginless ranges previously raised TypeError for this case,
except for string ranges, which had unexpected behavior:

  ('a'..'z').include?('ww') # false
  (..'z').include?('ww') # previously true, now TypeError

Use of include? with endless ranges could previously result
in an infinite loop.

This splits off a range_string_cover_internal function from
range_include_internal.

Fixes [Bug #18580]
2022-11-24 15:18:44 -08:00
Takashi Kokubun
d15de2f0d7 Add a NEWS entry about erb -S removal [ci skip] 2022-11-24 14:55:07 -08:00
Takashi Kokubun
1c0c1c8098 [ruby/erb] Drop deprecated -S option from erb command
We attempted to remove things like this and reverted all of them, but I
think nobody relies on this unlike the positional arguments of
`ERB#initialize`.

https://github.com/ruby/erb/commit/92fde7e403
2022-11-24 22:49:21 +00:00
Takashi Kokubun
e5a0abc5de [ruby/erb] Suppress warnings to fix ruby-head CI
(https://github.com/ruby/erb/pull/34)

There seems to be no way to fix this. It doesn't happen in an installed
directory, so it's likely a false positive and/or a bug in rubygems.

  | <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: loading in progress, circular require considered harmful - /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb
  | 	from /home/runner/work/erb/erb/libexec/erb:0:in  `require'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb:3:in  `<top (required)>'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb:3:in  `require_relative'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/shared_helpers.rb:8:in  `<top (required)>'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/shared_helpers.rb:8:in  `require_relative'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/rubygems_integration.rb:3:in  `<top (required)>'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/rubygems_integration.rb:3:in  `require'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems.rb:1352:in  `<top (required)>'
  | 	from <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85:in  `require'
  | 	from <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85:in  `require'
2022-11-24 22:35:33 +00:00
Jeremy Evans
1340195e79 Reduce duplication in pack by sharing code for some cases
s/S, i/I, l/L, and q/Q had the same code in both cases, so
combine the cases.

Alternatively, we could actually the size of the unsigned type,
but I doubt there are any platforms where the unsigned type is
a different size than the signed type.
2022-11-24 14:27:19 -08:00
Jeremy Evans
f5d73da806 Fix the position of rescue clause without exc_list
If the rescue clause has only exc_var and not exc_list, use the
exc_var position instead of the rescue body position.

This issue appears to have been introduced in
688169fd83b24564b653c03977c168cea50ccd35 when "opt_list" was split
into "exc_list exc_var".

Fixes [Bug #18974]
2022-11-24 14:26:08 -08:00
Maxime Chevalier-Boisvert
07169fd824
Update YJIT section of NEWS.md (#6803)
* Update YJIT section of `NEWS.md`

* Update NEWS.md
2022-11-24 16:37:04 -05:00
Alan Wu
a81c89b7c8
YJIT: Make sure rustc's target matches before enabling (#6804)
For people using Rosetta 2 on ARM Macs, it can happen that the
rustc in the PATH compiles for x86_64 while clang is targeting
ARM. We were enabling YJIT in these situations because the test
program compiled fine, but caused linking failure later due to
the architecture mismatch.

Adjust the test program to fail when rustc's target arch is different
from ruby's target arch.

[Bug #19146]
2022-11-24 14:58:41 -05:00
Jean Boussier
656f25987c [ruby/cgi] Fix test_cgi_cookie_new_with_domain to pass on older rubies
https://github.com/ruby/cgi/commit/05f0c58048
2022-11-24 18:32:19 +00:00
Maxime Chevalier-Boisvert
d2fa67de81
YJIT: rename InsnOpnd => YARVOpnd (#6801)
Rename InsnOpnd => YARVOpnd

Make it more clear this refers to YARV insn/vm operands rather
than backend IR, x86 or ARM insn operands.
2022-11-24 10:30:28 -05:00
Yusuke Endoh
66e5200ba4 Relax the timeout of TestRegexp#test_cache_optimization_square
It fails on riscv (QEmu)

http://rubyci.s3.amazonaws.com/debian-riscv64/ruby-master/log/20221124T000021Z.fail.html.gz
```
  1) Error:
TestRegexp#test_cache_optimization_square:
Regexp::TimeoutError: regexp match timeout
    /home/rubyci/chkbuild/tmp/build/20221124T000021Z/ruby/test/ruby/test_regexp.rb:1693:in `<main>'
    /home/rubyci/chkbuild/tmp/build/20221124T000021Z/ruby/test/ruby/test_regexp.rb:1688:in `test_cache_optimization_square'
```
2022-11-24 15:13:00 +09:00
Alan Wu
d92054e371 YJIT: Use a Box for branch targets to save memory
We frequently make branches that only have one target but we used to
always allocate space for two branch targets. This patch moves all the
information a branch target has into a struct and refer to them using
Option<Box<BranchTarget>>, this way when the second branch target is not
present it only takes 8 bytes.

Retained heap size on railsbench went from 16.17 MiB to 14.57 MiB, a
ratio of about 1.1.
2022-11-23 18:00:12 -05:00
Aaron Patterson
e788215125 Add next_shape_id to vm stats
We need to track this number in CI.  It's important to know how changes
to the codebase impact the number of shapes in the system, so lets add
the number to the VM stat hash
2022-11-23 14:18:10 -08:00