summaryrefslogtreecommitdiff
path: root/tool
AgeCommit message (Collapse)Author
2024-08-06Use 3min for test parallel worker timeout againYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/11315
2024-08-06Dump all-thread backtraces when test parallel worker exceeds time limitYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/11315
2024-08-06Extend the default timeout of parallel testing to one hourYusuke Endoh
2024-08-06Extend the default timeout of parallel testingYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/11311
2024-08-05Clean up empty directoryHiroshi SHIBATA
2024-08-05Make sure to always use the right `warn`David Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/11296
2024-07-26Error when --with-shared-gc doesn't specify a directoryPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11248
2024-07-18Write rbinc files at onceNobuyoshi Nakada
Unexpected error can make empty files which result in unclear compilation errors. Notes: Merged: https://github.com/ruby/ruby/pull/11194
2024-07-16Follow-up resolv and win32 integrationHiroshi SHIBATA
https://github.com/ruby/resolv/pull/54
2024-07-11[PRISM] Revert incorrectly merged gemfileKevin Newton
2024-07-11[ruby/prism] Various cleanup for initializers and typechecksKevin Newton
https://github.com/ruby/prism/commit/86cf82794a
2024-07-11Removed WEBrick and that testsHiroshi SHIBATA
We can handle uri, time and others without `make test-all` dependencies now.
2024-07-09Fix grammar of ruby_shared_gc.m4Peter Zhu
2024-07-08Add make target shared-gcPeter Zhu
Allows building shared GC using `make shared-gc SHARED_GC=gc_impl`
2024-07-08Move the file location of launchable.rbNaoto Ono
2024-07-08Integrate Launchable into make btestNaoto Ono
2024-07-05Change external GC to use directory at configurePeter Zhu
This commit changes the external GC API to use `--with-shared-gc=DIR` at configure time with a directory of the external GC and uses `RUBY_GC_LIBRARY` environment variable to load the external GC at runtime.
2024-07-01Skip to copy .so/.bundle files generated by rake-compilerHiroshi SHIBATA
2024-06-24Use gperf 3.1 to generate ANSI-C codeNobuyoshi Nakada
2024-06-24No longer needs `sigsetjmp`Nobuyoshi Nakada
Since signal handlers just set flag and return now, `sigsetjmp` and `siglongjmp` will not be needed.
2024-06-21Support LCOV 2.0Yusuke Endoh
LCOV 2.0, a GCOV frontend, seems to have stricter error checking
2024-06-18Optimized forwarding callers and calleesAaron Patterson
This patch optimizes forwarding callers and callees. It only optimizes methods that only take `...` as their parameter, and then pass `...` to other calls. Calls it optimizes look like this: ```ruby def bar(a) = a def foo(...) = bar(...) # optimized foo(123) ``` ```ruby def bar(a) = a def foo(...) = bar(1, 2, ...) # optimized foo(123) ``` ```ruby def bar(*a) = a def foo(...) list = [1, 2] bar(*list, ...) # optimized end foo(123) ``` All variants of the above but using `super` are also optimized, including a bare super like this: ```ruby def foo(...) super end ``` This patch eliminates intermediate allocations made when calling methods that accept `...`. We can observe allocation elimination like this: ```ruby def m x = GC.stat(:total_allocated_objects) yield GC.stat(:total_allocated_objects) - x end def bar(a) = a def foo(...) = bar(...) def test m { foo(123) } end test p test # allocates 1 object on master, but 0 objects with this patch ``` ```ruby def bar(a, b:) = a + b def foo(...) = bar(...) def test m { foo(1, b: 2) } end test p test # allocates 2 objects on master, but 0 objects with this patch ``` How does it work? ----------------- This patch works by using a dynamic stack size when passing forwarded parameters to callees. The caller's info object (known as the "CI") contains the stack size of the parameters, so we pass the CI object itself as a parameter to the callee. When forwarding parameters, the forwarding ISeq uses the caller's CI to determine how much stack to copy, then copies the caller's stack before calling the callee. The CI at the forwarded call site is adjusted using information from the caller's CI. I think this description is kind of confusing, so let's walk through an example with code. ```ruby def delegatee(a, b) = a + b def delegator(...) delegatee(...) # CI2 (FORWARDING) end def caller delegator(1, 2) # CI1 (argc: 2) end ``` Before we call the delegator method, the stack looks like this: ``` Executing Line | Code | Stack ---------------+---------------------------------------+-------- 1| def delegatee(a, b) = a + b | self 2| | 1 3| def delegator(...) | 2 4| # | 5| delegatee(...) # CI2 (FORWARDING) | 6| end | 7| | 8| def caller | -> 9| delegator(1, 2) # CI1 (argc: 2) | 10| end | ``` The ISeq for `delegator` is tagged as "forwardable", so when `caller` calls in to `delegator`, it writes `CI1` on to the stack as a local variable for the `delegator` method. The `delegator` method has a special local called `...` that holds the caller's CI object. Here is the ISeq disasm fo `delegator`: ``` == disasm: #<ISeq:delegator@-e:1 (1,0)-(1,39)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] "..."@0 0000 putself ( 1)[LiCa] 0001 getlocal_WC_0 "..."@0 0003 send <calldata!mid:delegatee, argc:0, FCALL|FORWARDING>, nil 0006 leave [Re] ``` The local called `...` will contain the caller's CI: CI1. Here is the stack when we enter `delegator`: ``` Executing Line | Code | Stack ---------------+---------------------------------------+-------- 1| def delegatee(a, b) = a + b | self 2| | 1 3| def delegator(...) | 2 -> 4| # | CI1 (argc: 2) 5| delegatee(...) # CI2 (FORWARDING) | cref_or_me 6| end | specval 7| | type 8| def caller | 9| delegator(1, 2) # CI1 (argc: 2) | 10| end | ``` The CI at `delegatee` on line 5 is tagged as "FORWARDING", so it knows to memcopy the caller's stack before calling `delegatee`. In this case, it will memcopy self, 1, and 2 to the stack before calling `delegatee`. It knows how much memory to copy from the caller because `CI1` contains stack size information (argc: 2). Before executing the `send` instruction, we push `...` on the stack. The `send` instruction pops `...`, and because it is tagged with `FORWARDING`, it knows to memcopy (using the information in the CI it just popped): ``` == disasm: #<ISeq:delegator@-e:1 (1,0)-(1,39)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] "..."@0 0000 putself ( 1)[LiCa] 0001 getlocal_WC_0 "..."@0 0003 send <calldata!mid:delegatee, argc:0, FCALL|FORWARDING>, nil 0006 leave [Re] ``` Instruction 001 puts the caller's CI on the stack. `send` is tagged with FORWARDING, so it reads the CI and _copies_ the callers stack to this stack: ``` Executing Line | Code | Stack ---------------+---------------------------------------+-------- 1| def delegatee(a, b) = a + b | self 2| | 1 3| def delegator(...) | 2 4| # | CI1 (argc: 2) -> 5| delegatee(...) # CI2 (FORWARDING) | cref_or_me 6| end | specval 7| | type 8| def caller | self 9| delegator(1, 2) # CI1 (argc: 2) | 1 10| end | 2 ``` The "FORWARDING" call site combines information from CI1 with CI2 in order to support passing other values in addition to the `...` value, as well as perfectly forward splat args, kwargs, etc. Since we're able to copy the stack from `caller` in to `delegator`'s stack, we can avoid allocating objects. I want to do this to eliminate object allocations for delegate methods. My long term goal is to implement `Class#new` in Ruby and it uses `...`. I was able to implement `Class#new` in Ruby [here](https://github.com/ruby/ruby/pull/9289). If we adopt the technique in this patch, then we can optimize allocating objects that take keyword parameters for `initialize`. For example, this code will allocate 2 objects: one for `SomeObject`, and one for the kwargs: ```ruby SomeObject.new(foo: 1) ``` If we combine this technique, plus implement `Class#new` in Ruby, then we can reduce allocations for this common operation. Co-Authored-By: John Hawthorn <john@hawthorn.email> Co-Authored-By: Alan Wu <XrXr@users.noreply.github.com>
2024-06-14Enable LeakChecker for RJIT previously disabled for MJIT (#10998)Alan Wu
RJIT doesn't spawn subprocesses so there should now be no need to special case it.
2024-06-11redmine-backporter.rb: Prepend commit: to shorter revsTakashi Kokubun
Some of the places in Redmine (e.g. Associated revisions) print revisions using only 8 characters. Even when I copied a revision from there, I want to prepend commit: in the message.
2024-06-11Extract hardening CFLAGS to a special $hardenflags variableKJ Tsanaktsidis
This changes the automatic detection of -fstack-protector, -D_FORTIFY_SOURCE, and -mbranch-protection to write to $hardenflags instead of $XCFLAGS. The definition of $cflags is changed to "$hardenflags $orig_cflags $optflags $debugflags $warnflags" to match. Furthermore, these flags are _prepended_ to $hardenflags, rather than appended. The implications of doing this are as follows: * If a CRuby builder specifies cflags="-mbranch-protection=foobar" at the ./configure script, and the configure script detects that -mbranch-protection=pac-ret is accepted, then GCC will be invoked as "gcc -mbranch-protection=pac-ret -mbranch-protection=foobar". Since the last flags take precedence, that means that user-supplied values of these flags in $cflags will take priority. * Likewise, if a CRuby builder explicitly specifies "hardenflags=-mbranch-protection=foobar", because we _prepend_ to $hardenflags in our autoconf script, we will still invoke GCC as "gcc -mbranch-protection=pac-ret -mbranch-protection=foobar". * If a CRuby builder specifies CFLAGS="..." at the configure line, automatic detection of hardening flags is ignored as before. * C extensions will _also_ be built with hardening flags now as well (this was not the case by default before because the detected flags went into $XCFLAGS). Additionally, as part of this work, I changed how the detection of PAC/BTI in Context.S works. Rather than appending the autodetected option to ASFLAGS, we simply compile a set of test programs with the actual CFLAGS in use to determine what PAC/BTI settings were actually chosen by the builder. Context.S is made aware of these choices through some custom macros. The result of this work is that: * Ruby will continue to choose some sensible defaults for hardening options for the C compiler * Distributors are able to specify CFLAGS that are consistent with their distribution and override these defaults * Context.S will react to whatever -mbranch-protection is actually in use, not what was autodetected * Extensions get built with hardening flags too. [Bug #20154] [Bug #20520]
2024-06-04Ignore retguard symbols when looking for leaked symbolsJeremy Evans
retguard symbols are added on OpenBSD as part of stack protection. They should be ignored by the leaked symbols checker, just as we ignore asan symbols.
2024-06-04merger.rb: Put spaces in between revisionsTakashi Kokubun
so that they are linked correctly on GitHub
2024-06-04Sync strscan HEAD again.Hiroshi SHIBATA
https://github.com/ruby/strscan/pull/99 split document with multi-byte chars.
2024-06-03Revert "Sync strscan document files to under the doc directory"Hiroshi SHIBATA
This reverts commit 5611e249e10bf95d48bbf27674bbb6b1fe588b5e. Followed up with https://github.com/ruby/ruby/commit/78bfde5d9f42f2d7bcfb40343477eb8e73ca0e29
2024-06-02Show destination directory after installationNobuyoshi Nakada
Due to the length of the list of gems to install, the message at the beginning of the installation scrolls out.
2024-05-30RUBY_CHECK_HEADER didn't define HAVE_{header-file} (#10876)Sorah Fukumori
--with-gmp is not working at all because HAVE_GMP_H was missing since 18eaf0be90. [Bug #20515] bug: https://bugs.ruby-lang.org/issues/20515 follow-up: https://bugs.ruby-lang.org/issues/20494 follow-up: 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b follow-up: https://github.com/ruby/ruby/pull/10805
2024-05-30Sync strscan document files to under the doc directoryHiroshi SHIBATA
2024-05-29release.sh: Explain example usagesTakashi Kokubun
2024-05-29release.sh: We don't release tar.bz2 anymoreTakashi Kokubun
2024-05-30Suppress warnings about frozen string literal featureHiroshi SHIBATA
``` tool/redmine-backporter.rb:69: warning: literal string will be frozen in the future ```
2024-05-29Sort backport revisions by commit timestampsTakashi Kokubun
2024-05-28merger.rb: Don't ask "conflicts resolved?" if not neededTakashi Kokubun
2024-05-28redmine-backporter.rb: Prepend commit: to every revisionTakashi Kokubun
2024-05-28redmine-backporter.rb: Remove an unneeded spaceTakashi Kokubun
from #backport_command_string I don't want to leave unneeded spaces in the command history by copy-pasting the entire line.
2024-05-28merger.rb: Auto-detect tickets when --ticket is not givenTakashi Kokubun
2024-05-28merger.rb: Drop an obsoleted command from helpTakashi Kokubun
It was needed only for SVN, and we dropped SVN support.
2024-05-28merger.rb: Use commit: prefix in more placesTakashi Kokubun
2024-05-28merger.rb: Improve the help messageTakashi Kokubun
It wasn't clear whether the backport command takes a commit hash or a ticket number.
2024-05-28merger.rb: Drop SVN supportTakashi Kokubun
2024-05-28redmine-backporter.rb: Use commit: prefixTakashi Kokubun
2024-05-28redmine-backporter.rb: Highlight closed ticketsTakashi Kokubun
2024-05-28redmine-backporter.rb: Fix #color for Ruby 3 splatTakashi Kokubun
color(*PRIORITIES['Immediate']) didn't work with Ruby 3.
2024-05-28redmine-backporter.rb: Drop SVN supportTakashi Kokubun
2024-05-28redmine-backporter.rb: Migrate Readline to RelineTakashi Kokubun
instead of using a local Readline port as a fallback
2024-05-28redmine-backporter.rb: Get rid of VERSIONTakashi Kokubun
that has never been utilized