summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-05-26[ruby/rdoc] Improve `<summary>` CSS on sidebarMasafumi Koba
- Use a smaller font size for the toggle symbol. (Currently, it seems a little too large) - Use the child combinator (`>`) to unify selectors. - Use `margin-left` instead of whitespace within the `content` property. - Use `::` instead of outdated `:` for the pseudo-element symbol. (See https://developer.mozilla.org/en-US/docs/Web/CSS/::before) https://github.com/ruby/rdoc/commit/61ce0a7d75
2023-05-26[ruby/rdoc] Improve layout CSSMasafumi Koba
- Use the `grid` property for the page layout. - https://caniuse.com/css-grid - Adjust the `<main>` margin. - Make the sidebar responsive and resizable. - https://caniuse.com/css-math-functions - https://caniuse.com/css-resize Note all modern browsers support the new CSS properties and functions used by this change. https://github.com/ruby/rdoc/commit/2db5097c41
2023-05-26Document throw/catch in the control expressions document [ci skip]Jeremy Evans
This are implemented as Kernel methods and not keywords, but I still think they are worth documenting with the other control flow expressions. Notes: Merged: https://github.com/ruby/ruby/pull/7856 Merged-By: jeremyevans <[email protected]>
2023-05-26T_HASH is no longer on transient heapPeter Zhu
2023-05-26[DOC] Link fix (#7862)Burdette Lamar
Notes: Merged-By: peterzhu2118 <[email protected]>
2023-05-26testing_ruby.md: Update `make test-all` tips [ci skip]Jun Aruga
Notes: Merged: https://github.com/ruby/ruby/pull/7861
2023-05-26* expand tabs. [ci skip]git
Please consider using misc/expand_tabs.rb as a pre-commit hook.
2023-05-26Remvoe very high timeout on test_race_gets_and_closeKJ Tsanaktsidis
This test should be fixed and fast now because the closing thread sleeps appropriately waiting for the file descriptor to be unused. Notes: Merged: https://github.com/ruby/ruby/pull/7865
2023-05-26Fix busy-loop when waiting for file descriptors to closeKJ Tsanaktsidis
When one thread is closing a file descriptor whilst another thread is concurrently reading it, we need to wait for the reading thread to be done with it to prevent a potential EBADF (or, worse, file descriptor reuse). At the moment, that is done by keeping a list of threads still using the file descriptor in io_close_fptr. It then continually calls rb_thread_schedule() in fptr_finalize_flush until said list is empty. That busy-looping seems to behave rather poorly on some OS's, particulary FreeBSD. It can cause the TestIO#test_race_gets_and_close test to fail (even with its very long 200 second timeout) because the closing thread starves out the using thread. To fix that, I introduce the concept of struct rb_io_close_wait_list; a list of threads still using a file descriptor that we want to close. We call `rb_notify_fd_close` to let the thread scheduler know we're closing a FD, which fills the list with threads. Then, we call rb_notify_fd_close_wait which will block the thread until all of the still-using threads are done. This is implemented with a condition variable sleep, so no busy-looping is required. Notes: Merged: https://github.com/ruby/ruby/pull/7865
2023-05-26Move rb_thread_cond_struct definition into thread_native.hKJ Tsanaktsidis
On Win32, currently, rb_nativethread_cond_t is an incomplete type because it's a typedef for `struct rb_thread_cond_struct`. That means you can't actually allocate a rb_nativethread_cond_t unless you also include THREAD_IMPL_H (since its defined in thread_win32.h) (alternatively, including vm_core.h also works). Move the definition of rb_thread_cond_struct into thread_native.h to alleviate this. Notes: Merged: https://github.com/ruby/ruby/pull/7865
2023-05-26Remove excessive timeout on test_wait_exception for FreeBSDKJ Tsanaktsidis
This should now be fixed by the previous commit. Notes: Merged: https://github.com/ruby/ruby/pull/7864
2023-05-26Fix a potential busy-loop in the thread scheduler (esp. on FreeBSD)KJ Tsanaktsidis
This patch fixes a potential busy-loop in the thread scheduler. If there are two threads, the main thread (where Ruby signal handlers must run) and a sleeping thread, it is possible for the following sequence of events to occur: * The sleeping thread is in native_sleep -> sigwait_sleep A signal * arives, kicking this thread out of rb_sigwait_sleep The sleeping * thread calls THREAD_BLOCKING_END and eventually thread_sched_to_running_common * the sleeping thread writes into the sigwait_fd pipe by calling rb_thread_wakeup_timer_thread * the sleeping thread re-loops around in native_sleep() because the desired sleep time has not actually yet expired * that calls rb_sigwait_sleep again the ppoll() in rb_sigwait_sleep * immediately returns because of the byte written into the sigwait_fd by rb_thread_wakeup_timer_thread * that wakes the thread up again and kicks the whole cycle off again. Such a loop can only be broken by the main thread waking up and handling the signal, such that ubf_threads_empty() below becomes true again; however this loop can actually keep things so busy (and cause so much contention on the main thread's interrupt_lock) that the main thread doesn't deal with the signal for many seconds. This seems particuarly likely on FreeBSD 13. (the cycle can also be broken by the sleeping thread finally elapsing its desired sleep time). The fix for _this_ loop is to only wakeup the timer thrad in thread_sched_to_running_common if the current thread is not itself the sigwait thread. An almost identical loop also happens in the same circumstances because the call to check_signals_nogvl (through sigwait_timeout) in rb_sigwait_sleep returns true if there is any pending signal for the main thread to handle. That then causes rb_sigwait_sleep to skip over sleeping entirely. This is unnescessary and counterproductive, I believe; if the main thread needs to be woken up that is done inline in check_signals_nogvl anyway. See https://bugs.ruby-lang.org/issues/19680 Notes: Merged: https://github.com/ruby/ruby/pull/7864
2023-05-26Bump github/codeql-action from 2.3.3 to 2.3.5dependabot[bot]
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.3 to 2.3.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/29b1f65c5e92e24fe6b6647da1eaabe529cec70f...0225834cc549ee0ca93cb085b92954821a145866) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
2023-05-25[rubygems/rubygems] Load plugin immediatelySutou Kouhei
We can install RubyGems plugin by "gem install XXX". The installed plugin is used from the NEXT "gem ...". For example, "gem install gem-src kaminari" doesn't use gem-src plugin for kaminari. "gem install gem-src && gem install kaminari" uses gem-src plugin for kaminari. How about loading a plugin immediately when the plugin is installed? If this proposal is implemented, "gem install gem-src kaminari" works like "gem install gem-src && gem install kaminari". https://github.com/rubygems/rubygems/commit/4917d96f4c
2023-05-25Don't immediately promote children of old objectsPeter Zhu
[Feature #19678] References from an old object to a write barrier protected young object will not immediately promote the young object. Instead, the young object will age just like any other object, meaning that it has to survive three collections before being promoted to the old generation. References from an old object to a write barrier unprotected object will place the parent object in the remember set for marking during minor collections. This allows the child object to be reclaimed in minor collections at the cost of increased time for minor collections. On one of [Shopify's highest traffic Ruby apps, Storefront Renderer](https://shopify.engineering/how-shopify-reduced-storefront-response-times-rewrite), we saw significant improvements after deploying this feature in production. We compare the GC time and response time of web workers that have the original behaviour (non-experimental group) and this new behaviour (experimental group). We see that with this feature we spend significantly less time in the GC, 0.81x on average, 0.88x on p99, and 0.45x on p99.9. This translates to improvements in average response time (0.96x) and p99 response time (0.92x). Notes: Merged: https://github.com/ruby/ruby/pull/7821
2023-05-25Update default gems list at e5bce57e1d3ab6eb8c218355e9b31f [ci skip]git
2023-05-25[ruby/nkf] Bump up nkf-0.1.3Hiroshi SHIBATA
https://github.com/ruby/nkf/commit/bc90e2ed39
2023-05-25[ruby/nkf] Added mission extension configurationHiroshi SHIBATA
https://github.com/ruby/nkf/commit/e627a39dff
2023-05-25Fixup 5bfb317a938Hiroshi SHIBATA
2023-05-25[ruby/benchmark] Don't use version.rbHiroshi SHIBATA
https://github.com/ruby/benchmark/commit/6d51b10500
2023-05-25Update bundled gems list at 2023-05-25git
2023-05-25Move gemspec files to top of lib directory.Hiroshi SHIBATA
They have version.rb files with same directory. But version.rb have been removed at https://github.com/ruby/ruby/pull/3375 There is no reason to locate under the library name of directory.
2023-05-25Bump necojackarc/auto-request-review from 0.11.0 to 0.12.0dependabot[bot]
Bumps [necojackarc/auto-request-review](https://github.com/necojackarc/auto-request-review) from 0.11.0 to 0.12.0. - [Release notes](https://github.com/necojackarc/auto-request-review/releases) - [Commits](https://github.com/necojackarc/auto-request-review/compare/a39c70b6e72b97d3096c9a85059e5c9634746c02...6a51cebffe2c084705d9a7b394abd802e0119633) --- updated-dependencies: - dependency-name: necojackarc/auto-request-review dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
2023-05-25Allow environment variable to control madvise advice. (#7855)Samuel Williams
Introduce experimental support for explicitly specifying the `advice` value provided to `madvise` when releasing the fiber stack. Notes: Merged-By: ioquatix <[email protected]>
2023-05-25[ruby/csv] Support RJIT (https://github.com/ruby/csv/pull/281)Nobuyoshi Nakada
In Ruby 3.3, MJIT is replaced with RJIT. https://github.com/ruby/csv/commit/cc6b47a4a7 Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] test: rename Helper to CSVHelperLuke Gruber
(https://github.com/ruby/csv/pull/278) Rename it so that in ruby/ruby, the generic name Helper is not used. Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] docs: fix example in Recipe: Capture Unconverted FieldsYuki Tsujimoto
(https://github.com/ruby/csv/pull/276) I've fixed the example in `Recipe: Capture Unconverted Fields`. https://ruby.github.io/csv/doc/csv/recipes/parsing_rdoc.html#label-Recipe-3A+Capture+Unconverted+Fields `parsed` is wrong: header row is missing and the values should be integers. ``` $ ruby -v ruby 3.2.1 (2023-02-08 revision https://github.com/ruby/csv/commit/31819e82c8) [x86_64-darwin21] $ cat unconverted_fields.rb require "csv" source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" parsed = CSV.parse(source, converters: :integer, unconverted_fields: true) p parsed parsed.each {|row| p row.unconverted_fields } $ ruby unconverted_fields.rb [["Name", "Value"], ["foo", 0], ["bar", 1], ["baz", 2]] ["Name", "Value"] ["foo", "0"] ["bar", "1"] ["baz", "2"] ``` Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] All Enumerable based methods consume the same lines with other ↵Sutou Kouhei
methods This may have a performance penalty. We should benchmark this. GitHub: fix https://github.com/ruby/csv/pull/260 Reported by Lhoussaine Ghallou. Thanks!!! https://github.com/ruby/csv/commit/acc05116c5 Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] CSV#read consumes the same lines with other methods like CSV#shiftSutou Kouhei
GitHub: fix https://github.com/ruby/csv/pull/258 Reported by Lhoussaine Ghallou. Thanks!!! https://github.com/ruby/csv/commit/71e6d24e28 Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] Remove no longer required refinementsMau Magnaguagno
(https://github.com/ruby/csv/pull/250) Since PR #159, the minimum Ruby version is 2.5.0, a version which no longer requires refinements for String#delete_suffix?, String#match? and Regexp#match?. Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] Fix typos (https://github.com/ruby/csv/pull/236)Sampat Badhe
https://github.com/ruby/csv/commit/d5e401266f Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] Small RDoc changes for recipesBurdette Lamar
(https://github.com/ruby/csv/pull/190) https://github.com/ruby/csv/commit/2102c78384 Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] Enhanced RDoc for CSV::TableBurdette Lamar
(https://github.com/ruby/csv/pull/166) https://github.com/ruby/csv/commit/1d685aede3 Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-24Add REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIOPeter Zhu
[Feature #19571] This commit adds the environment variable `RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO` which is used to calculate the `remembered_wb_unprotected_objects_limit` using a ratio of `old_objects`. This should improve performance by reducing major GC because, in a major GC, we mark all of the old objects, so we should have more uncollectible WB unprotected objects before starting a major GC. The default has been set to 0.01 (1% of old objects). On one of [Shopify's highest traffic Ruby apps, Storefront Renderer](https://shopify.engineering/how-shopify-reduced-storefront-response-times-rewrite), we saw significant improvements after deploying this patch in production. In the graphs below, we have the `tuned` group which uses `RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO=0.01` (the default value), and an `untuned` group, which turns this feature off with `RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO=0`. We see that the tuned group spends significantly less time in GC, on average 0.67x of the time compared to the untuned group and 0.49x for p99. We see this improvement in GC time translate to improvements in response times. The average response time is now 0.96x of the time compared to the untuned group and 0.86x for p99. https://user-images.githubusercontent.com/15860699/229559078-e23e8ce4-5f1f-4a2f-b5ef-5769f92b8c70.png Notes: Merged: https://github.com/ruby/ruby/pull/7577
2023-05-24Fix "runs a C function with the global lock unlocked and unlocks IO with the ↵Samuel Williams
generic RUBY_UBF_IO" on Windows. (#7848) * Enable borked spec. * Ensure win32 wrappers are visible and used. * Reorganise `read`/`write`/`pipe` in `thread_spec.c`. Notes: Merged-By: ioquatix <[email protected]>
2023-05-24gc.c: get rid of unused objspace parameters (#7853)Jean Boussier
Notes: Merged-By: byroot <[email protected]>
2023-05-24Rename `rb_node_name` to the original nameyui-knk
98637d421dbe8bcf86cc2effae5e26bb96a6a4da changes the name of the function. However this function is exported as global, then change the name to origin one for keeping compatibility. Notes: Merged: https://github.com/ruby/ruby/pull/7852
2023-05-24Add a newline at EOF [ci skip]Nobuyoshi Nakada
2023-05-24[ruby/racc] Add a newline at EOF [ci skip]Nobuyoshi Nakada
https://github.com/ruby/racc/commit/8f1dab6759
2023-05-24Bump necojackarc/auto-request-review from 0.10.0 to 0.11.0dependabot[bot]
Bumps [necojackarc/auto-request-review](https://github.com/necojackarc/auto-request-review) from 0.10.0 to 0.11.0. - [Release notes](https://github.com/necojackarc/auto-request-review/releases) - [Commits](https://github.com/necojackarc/auto-request-review/compare/5f91f424cabb3211c669e49e79da8363f7df395b...a39c70b6e72b97d3096c9a85059e5c9634746c02) --- updated-dependencies: - dependency-name: necojackarc/auto-request-review dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
2023-05-24Bump dependabot/fetch-metadata from 1.5.0 to 1.5.1dependabot[bot]
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/28a846a1194a2665a2eea75dd4556c91e43af857...cd6e996708b8cfe0b639401134a3b9a3177be7b2) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
2023-05-24Improvements to `IO::Buffer` `read`/`write`/`pread`/`pwrite`. (#7826)Samuel Williams
- Fix IO::Buffer `read`/`write` to use a minimum length. Notes: Merged-By: ioquatix <[email protected]>
2023-05-24[flori/json] Call `super` in `included` hookUfuk Kayserilioglu
The C extension defines an `included` hook for the `JSON::Ext::Generator::GeneratorMethods::String` module but neglects to call `super` in the hook. This can break the functionality of various other code that rely on the fact that `included` on `Module` will always be called. https://github.com/flori/json/commit/cd8bbe56a3
2023-05-24Add support for pread/pwrite on windows. (#7827)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2023-05-23Remove dead code in rb_hash_replacePeter Zhu
We now always copy the ST table, so we don't need to initialize the ST table of hash when hash2 is empty. Notes: Merged: https://github.com/ruby/ruby/pull/7846
2023-05-23Fix crash when replacing ST hash with AR hashPeter Zhu
With VWA, AR hashes are much larger than ST hashes. Hash#replace attempts to directly copy the contents of AR hashes into ST hashes so there will be memory corruption caused by writing past the end of memory. This commit changes it so that if a ST hash is being replaced with an AR hash it will insert each element into the ST hash. Notes: Merged: https://github.com/ruby/ruby/pull/7846
2023-05-23[rubygems/rubygems] Remove forward slash in key regardless if it contains __Jenny Shen
https://github.com/rubygems/rubygems/commit/33a02eec00
2023-05-23[rubygems/rubygems] Modify invalid key check to accept keys with colonsJenny Shen
https://github.com/rubygems/rubygems/commit/413033198b Co-authored-by: Eric Herscovich <[email protected]>
2023-05-23[ruby/irb] Allow `show_source` for private methodsTSUYUSATO Kitsune
(https://github.com/ruby/irb/pull/589) * Allow `show_source` for private methods Fix https://github.com/ruby/irb/pull/577 * Pend tests on TruffleRuby It seems `eval(..., __LINE__ + 1)` does not work. Other similar tests are also pended on TruffleRuby, so I think it is acceptable. * Use `private_method_defined?` instead of `defined?`
2023-05-23Remove dead code in ar_copyPeter Zhu
new_tab can no longer ever be NULL so this is dead code.