summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-10-22[ruby/reline] Use IO's encoding instead of Encoding.default_externalWu
(https://github.com/ruby/reline/pull/765) * use IO's encoding * refactoring * remove unused encoding params * (for retriggering CI) remove unused encoding params https://github.com/ruby/reline/commit/f09772adab
2024-10-22[rubygems/rubygems] Cleanup some specs after recent support dropDavid Rodríguez
https://github.com/rubygems/rubygems/commit/9548aa6766
2024-10-22[rubygems/rubygems] Change one `bundle check` spec to not touch the networkDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f4d31c0a97
2024-10-22Delete reserve_stack codeKJ Tsanaktsidis
This code was working around a bug in the Linux kernel. It was previously possible for the kernel to place heap pages in a region where the stack was allowed to grow into, and then therefore run out of usable stack memory before RLIMIT_STACK was reached. This bug was fixed in Linux commit https://github.com/torvalds/linux/commit/c204d21f2232d875e36b8774c36ffd027dc1d606 for kernel 4.13 in 2017. Therefore, in 2024, we should be safe to delete this workaround. [Bug #20804] Notes: Merged: https://github.com/ruby/ruby/pull/11927
2024-10-22Perform an actual access check in Dir.tmpdir for writabilityKJ Tsanaktsidis
At the moment, this code is looking at the stat output to determine if a temp directory can be written to. However, just because the stat bits say that a directory is writable, does not make it so; and, likewise, the operating system may in fact grant access to paths that the stat bits and process UID say should be inaccessible. These systems include: * Posix ACL's * Linux's capabilities like CAP_DAC_OVERRIDE * Linux Security Modules like SELinux or AppArmor * Syscall filters like Linux's seccomp * Granular capability systems like FreeBSD's Capsicum * OpenBSD's pledge and unveil * Windows too has a rich ACL system for controlling filesystem access The best thing to do is simply to try and access the path with `File.writable?` and let the operating system tell us if the path can be accessed. Notes: Merged: https://github.com/ruby/ruby/pull/11403
2024-10-21Don't clear out flags in rb_gc_obj_freePeter Zhu
If there's a crash after rb_gc_obj_free, it's hard to debug because the flags have been cleared out already. Notes: Merged: https://github.com/ruby/ruby/pull/11925
2024-10-21YJIT: Rename method substitution functions and improve docs (+1) (#11919)Alan Wu
* YJIT: Fill in commented-out assertion * YJIT: Rename yjit_reg_method() and add links in docs Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2024-10-21Fix wmap_compact from potentially corrupting ST tablePeter Zhu
Since we hash by the address of the key in the WeakMap, we cannot change the key in the same entry because deleting the key could require hashing. This commit changes it to allocate and insert a new entry if the key has moved. Notes: Merged: https://github.com/ruby/ruby/pull/11924
2024-10-21[DOC] Fix indentation of comment in wmap_compact_table_iPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11924
2024-10-21Fix an off-by-one error of own memrchr implementationYusuke Endoh
and make it support `search_len == 0`, just for the case Ref [Bug #20796] Notes: Merged: https://github.com/ruby/ruby/pull/11923
2024-10-21Show where mutated chilled strings were allocatedÉtienne Barrié
[Feature #20205] The warning now suggests running with --debug-frozen-string-literal: ``` test.rb:3: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information) ``` When using --debug-frozen-string-literal, the location where the string was created is shown: ``` test.rb:3: warning: literal string will be frozen in the future test.rb:1: info: the string was created here ``` When resurrecting strings and debug mode is not enabled, the overhead is a simple FL_TEST_RAW. When mutating chilled strings and deprecation warnings are not enabled, the overhead is a simple warning category enabled check. Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/11893
2024-10-20Remove unused or wrong conversionsNobuyoshi Nakada
The GMT offset and zone fields are not used in calculating the week number, and `zone` in `struct vtm` is a `VALUE` and should not be cast to `char *` at least. Notes: Merged: https://github.com/ruby/ruby/pull/11922
2024-10-20[DOC] Improve `Socket::tcp` with Happy Eyeballs Version 2Misaki Shioi
With the introduction of Happy Eyeballs Version 2 to `Socket::tcp`, the following areas have been mainly enhanced: - How the value specified for `connect_timeout` works - How Socket.tcp operates with Happy Eyeballs Version 2 A description for the new option `fast_fallback` has been added in https://github.com/ruby/ruby/pull/11813. Notes: Merged: https://github.com/ruby/ruby/pull/11920 Merged-By: nobu <nobu@ruby-lang.org>
2024-10-20[ruby/irb] Improve history test's encoding settingGo
(https://github.com/ruby/irb/pull/1022) * improve history test's encoding setting * fix missing locale error for ci and refactoring https://github.com/ruby/irb/commit/7f385bc19b
2024-10-19Update default gems list at b101ca598ef7a0b7c81efe673fea52 [ci skip]git
2024-10-19[ruby/ipaddr] Bump the version to 1.2.7Akinori MUSHA
https://github.com/ruby/ipaddr/commit/b44d2a1173
2024-10-19[ruby/ipaddr] Use string interpolation instead of format()Akinori MUSHA
https://github.com/ruby/ipaddr/commit/1f41cd7320
2024-10-18YJIT: Allow shareable consts in multi-ractor mode (#11917)John Hawthorn
* Update yjit-bindgen deps * YJIT: Allow shareable consts in multi-ractor mode * Update yjit/src/codegen.rs Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> --------- Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2024-10-18Point keyword->table into iseq local tableKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11912
2024-10-18[ruby/irb] Suppress "literal string will be frozen in the future"Tsutomu Katsube
warning (https://github.com/ruby/irb/pull/1019) * Suppress "literal string will be frozen in the future" warning Before change: ```console $ ruby -W -I lib -e 'require "irb"; IRB.setup(nil); IRB::Irb.new.build_statement("1 + 2")' /Users/zzz/src/github.com/ruby/irb/lib/irb.rb:1135: warning: literal string will be frozen in the future ``` After change: ```console $ ruby -W -I lib -e 'require "irb"; IRB.setup(nil); IRB::Irb.new.build_statement("1 + 2")' ``` * Making build_statement not modify the given argument Because improves readability and code quality. Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com> --------- https://github.com/ruby/irb/commit/3da04b9786 Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com>
2024-10-18[ruby/irb] Always use alternate sceen on alt-dtomoya ishida
(https://github.com/ruby/irb/pull/988) https://github.com/ruby/irb/commit/db0a923d62
2024-10-18Use rb_id_table_foreach_values for marking Ractor local storagePeter Zhu
Since we only mark the values, we can use rb_id_table_foreach_values to avoid the overhead of converting the key to an ID. Notes: Merged: https://github.com/ruby/ruby/pull/11918
2024-10-18[rubygems/rubygems] Add `bundle add --quiet` optionJerome Dalbert
This option is similar to the `bundle install --quiet` option https://github.com/rubygems/rubygems/commit/3bd773d827
2024-10-18[ruby/ipaddr] Use string interpolation instead of format()Akinori MUSHA
https://github.com/ruby/ipaddr/commit/73f59e111f
2024-10-18[DOC] Tweaks for Array#sumBurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11915
2024-10-18[DOC] Tweaks for Array#sort_by!BurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11914
2024-10-18[ruby/ipaddr] Added to_json/as_json methodTaketo Takashima
Updated to use cidr method when return address with prefix in #as_json https://github.com/ruby/ipaddr/commit/cf8181d53e
2024-10-18[rubygems/rubygems] Clarify `bundle install --quiet` documentationJerome Dalbert
Bundler always exits with a status code. https://github.com/rubygems/rubygems/commit/3a38bd0b12
2024-10-18Move object processing in Process.warmup to gc.cPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11904
2024-10-18[ruby/fiddle] test: Fix a typokojix2
(https://github.com/ruby/fiddle/pull/154) https://github.com/ruby/fiddle/commit/1f818e4684
2024-10-18Relax Pure::Parser's comment regex...Stephen Humphries
...to allow any character sequence, including "/*", before then end sequence of a multi-line ANSI C-style comment .
2024-10-18[ruby/json] Assume Encoding is definedJean Boussier
https://github.com/ruby/json/commit/8713aa4812
2024-10-18[ruby/json] Always dup argument to preserve original encoding for force_encodingTakumasa Ochi
https://github.com/ruby/json/commit/db9a489ca2
2024-10-18[ruby/json] Fix behavior of trying to parse non-string objectsYuheiNakasaka
https://github.com/ruby/json/commit/e2e9936047
2024-10-18[ruby/json] Speedup Parser initializationJean Boussier
Extracted from: https://github.com/ruby/json/pull/512 Use `rb_hash_lookup2` to check for hash key existence instead of going through `rb_funcall`. https://github.com/ruby/json/commit/43835a0d13 Co-Authored-By: lukeg <luke.gru@gmail.com>
2024-10-18Update default gems list at 8b4df90a24a886ed2ccb4b381d43a5 [ci skip]git
2024-10-18[ruby/syntax_suggest] Bump up 2.0.1Hiroshi SHIBATA
https://github.com/ruby/syntax_suggest/commit/0b9e4081c0
2024-10-18[ruby/syntax_suggest] Removed empty commentHiroshi SHIBATA
https://github.com/ruby/syntax_suggest/commit/e1d9c83736
2024-10-18[ruby/syntax_suggest] A gem executable should not use require_relativeBenoit Daloze
Otherwise it makes incorrect assumption about RubyGems layout. https://github.com/ruby/syntax_suggest/commit/04585d820d
2024-10-17YJIT: In stats, group by resolved C method nameAlan Wu
Previously, in the "Top-N most frequent C calls" section of --yjit-stats output, we printed the class name of the receiver, not the method owner. This meant that calls on subclass instances that land on the same method showed up as different entires. Similarly, method called using an alias showed up as different entries from other aliases. Group by the resolved method instead. Test program: 1.itself; [].itself; true.inspect; true.to_s Before: Top-4 most frequent C calls (80.0% of C calls): 1 (20.0%): Integer#itself 1 (20.0%): TrueClass#to_s 1 (20.0%): TrueClass#inspect 1 (20.0%): Array#itself After: Top-2 most frequent C calls (80.0% of C calls): 2 (40.0%): Kernel#itself 2 (40.0%): TrueClass#to_s Notes: Merged: https://github.com/ruby/ruby/pull/11913
2024-10-17YJIT: Add compilation log (#11818)Kevin Menard
* YJIT: Add `--yjit-compilation-log` flag to print out the compilation log at exit. * YJIT: Add an option to enable the compilation log at runtime. * YJIT: Fix a typo in the `IseqPayload` docs. * YJIT: Add stubs for getting the YJIT compilation log in memory. * YJIT: Add a compilation log based on a circular buffer to cap the log size. * YJIT: Allow specifying either a file or directory name for the YJIT compilation log. The compilation log will be populated as compilation events occur. If a directory is supplied, then a filename based on the PID will be used as the write target. If a file name is supplied instead, the log will be written to that file. * YJIT: Add JIT compilation of C function substitutions to the compilation log. * YJIT: Add compilation events to the circular buffer even if output is sent to a file. Previously, the two modes were treated as being exclusive of one another. However, it could be beneficial to log all events to a file while also allowing for direct access of the last N events via `RubyVM::YJIT.compilation_log`. * YJIT: Make timestamps the first element in the YJIT compilation log tuple. * YJIT: Stream log to stderr if `--yjit-compilation-log` is supplied without an argument. * YJIT: Eagerly compute compilation log messages to avoid hanging on to references that may GC. * YJIT: Log all compiled blocks, not just the method entry points. * YJIT: Remove all compilation events other than block compilation to slim down the log. * YJIT: Replace circular buffer iterator with a consuming loop. * YJIT: Support `--yjit-compilation-log=quiet` as a way to activate the in-memory log without printing it. Co-authored-by: Randy Stauner <randy.stauner@shopify.com> * YJIT: Promote the compilation log to being the one YJIT log. Co-authored-by: Randy Stauner <randy.stauner@shopify.com> * Update doc/yjit/yjit.md * Update doc/yjit/yjit.md --------- Co-authored-by: Randy Stauner <randy.stauner@shopify.com> Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2024-10-17[DOC] Tweaks for Array#sort!BurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11908
2024-10-17[DOC] Tweaks for Array#sort (#11907)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2024-10-17[ruby/rdoc] feature: Render mixed-in methods and constants withMike Dalessio
`--embed-mixins` (https://github.com/ruby/rdoc/pull/842) * Embed mixed-in methods and constants with `--embed-mixins` When `--embed-mixins` option is set: - methods from an `extend`ed module are documented as singleton methods - attrs from an `extend`ed module are documented as class attributes - methods from an `include`ed module are documented as instance methods - attrs from an `include`ed module are documented as instance attributes - constants from an `include`ed module are documented Sections are created when needed, and Darkfish's template annotates each of these mixed-in CodeObjects. We also respect the mixin methods' visibility. This feature is inspired by Yard's option of the same name. * Add comment to document why we set object visibility Co-authored-by: Stan Lo <stan001212@gmail.com> * Add the mixin_from attribute to CodeObject's initializer * Add test coverage for private mixed-in attributes. --------- https://github.com/ruby/rdoc/commit/481c2ce660 Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-10-17[ruby/json] Sync changesPeter Zhu
Some changes were missed in the automatic sync. Notes: Merged: https://github.com/ruby/ruby/pull/11911
2024-10-17[ruby/json] Fix State#max_nesting=Peter Zhu
Returning state->max_nesting is not valid because it's not a Ruby object. https://github.com/ruby/json/commit/6679ceb
2024-10-17Update maintainers of PrismKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11909
2024-10-17Add a fast path for ASCII stringsJean Boussier
This optimization is based on a few assumptions: - Most strings are ASCII only. - Most strings had their coderange scanned already. If the above is true, then by checking the string coderange, we can use a much more streamlined function to encode ASCII strings. Before: ``` == Encoding twitter.json (466906 bytes) ruby 3.4.0preview2 (2024-10-07 master 32c733f57b) +YJIT +PRISM [arm64-darwin23] Warming up -------------------------------------- json 140.000 i/100ms oj 230.000 i/100ms rapidjson 108.000 i/100ms Calculating ------------------------------------- json 1.464k (± 1.4%) i/s (682.83 μs/i) - 7.420k in 5.067573s oj 2.338k (± 1.5%) i/s (427.64 μs/i) - 11.730k in 5.017336s rapidjson 1.075k (± 1.6%) i/s (930.40 μs/i) - 5.400k in 5.025469s Comparison: json: 1464.5 i/s oj: 2338.4 i/s - 1.60x faster rapidjson: 1074.8 i/s - 1.36x slower ``` After: ``` == Encoding twitter.json (466906 bytes) ruby 3.4.0preview2 (2024-10-07 master 32c733f57b) +YJIT +PRISM [arm64-darwin23] Warming up -------------------------------------- json 189.000 i/100ms oj 228.000 i/100ms rapidjson 108.000 i/100ms Calculating ------------------------------------- json 1.903k (± 1.2%) i/s (525.55 μs/i) - 9.639k in 5.066521s oj 2.306k (± 1.3%) i/s (433.71 μs/i) - 11.628k in 5.044096s rapidjson 1.069k (± 2.4%) i/s (935.38 μs/i) - 5.400k in 5.053794s Comparison: json: 1902.8 i/s oj: 2305.7 i/s - 1.21x faster rapidjson: 1069.1 i/s - 1.78x slower ```
2024-10-17[ruby/json] Get rid of some more outdated compatibility codeJean Boussier
All these macros are available on Ruby 2.3+ https://github.com/ruby/json/commit/227885f460
2024-10-17[ruby/json] Get rid of compatibility code for older rubiesJean Boussier
All of these are for rubies older than 2.3. https://github.com/ruby/json/commit/811297f86a