summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-06Allow `RUBY_DEBUG_LOG` format to be emptyNobuyoshi Nakada
GCC warns of empty format strings, perhaps because they have no effects in printf() and there are better ways than sprintf(). However, ruby_debug_log() adds informations other than the format, this warning is not the case.
2022-08-06Adjust styles [ci skip]Nobuyoshi Nakada
2022-08-05Test that File.read defaults to text modeAlan Wu
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6212
2022-08-05[DOC] Mention Windows text mode EOF marker interpretationAlan Wu
I don't think this is super well known so it's worth mentioning as it can be a pitfall. See: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6212
2022-08-05[DOC] Clarify that `IO.read` uses text modeAlan Wu
See: https://bugs.ruby-lang.org/issues/18882#note-13 [Bug #18882] Notes: Merged: https://github.com/ruby/ruby/pull/6212
2022-08-06* 2022-08-06 [ci skip]git
2022-08-05Sync new doc in Date (#6215)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-08-05Get rid of `-C` option for very old `git`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6214
2022-08-05[DOC] Process._fork does not get called by Process.daemonIvo Anjo
As discussed in [Bug #18911], I'm adding some documentation to `Process._fork` to clarify that it is not expected to cover calls to `Process.daemon`. [Bug #18911]: https://bugs.ruby-lang.org/issues/18911 Co-authored-by: Yusuke Endoh <mame@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6170 Merged-By: nobu <nobu@ruby-lang.org>
2022-08-05[rubygems/rubygems] Include backtrace with crashes by defaultDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3cc3bfd371
2022-08-05[rubygems/rubygems] Automatically remove "ruby" from lockfile if incompleteDavid Rodríguez
https://github.com/rubygems/rubygems/commit/69d0b4e10b
2022-08-05Ignore revision to test unless HAVE_GITNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6203
2022-08-05Clone upstream gem repositories for testNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6203
2022-08-05Load gemspec file at that directoryNobuyoshi Nakada
Gemspec files generated by old bundler run `git` without changing the working directory. Or some gemspec files expect an owned file at the top exists ath the current working directory. Notes: Merged: https://github.com/ruby/ruby/pull/6203
2022-08-05Copy from cloned gem sources in parallelNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6203
2022-08-05Move to tool/lib/bundled_gem.rbNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6203
2022-08-05Extract bundled gems by BASERUBYNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6203
2022-08-05Copy from bundled gem source for testNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6203
2022-08-05Use configured GITNobuyoshi Nakada
2022-08-04Fix inconsistency with opt_aref_withJohn Hawthorn
opt_aref_with is an optimized instruction for accessing a Hash using a non-frozen string key (ie. from a file without frozen_string_literal). It attempts to avoid allocating the string, and instead silently using a frozen string (hash string keys are always fstrings). Because this is just an optimization, it should be invisible to the user. However, previously this optimization was could be seen via hashes with default procs. For example, previously: h = Hash.new { |h, k| k.frozen? } str = "foo" h[str] # false h["foo"] # true when optimizations enabled This commit checks that the Hash doesn't have a default proc when using opt_aref_with. Notes: Merged: https://github.com/ruby/ruby/pull/6196
2022-08-04YJIT: Allow str-concat arg to be any string subtype, not just rb_cString (#6205)Noah Gibbs
Allow str-concat arg to be any string subtype, not just rb_cString Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-08-04YJIT: Add known_* helpers for Type (#6208)John Hawthorn
* YJIT: Add known_* helpers for Type This adds a few helpers to Type which all return Options representing what is known, from a Ruby perspective, about the type. This includes: * known_class_of: If known, the class represented by this type * known_value_type: If known, the T_ value type * known_exact_value: If known, the exact VALUE represented by this type (currently this is only available for true/false/nil) * known_truthy: If known, whether or not this value evaluates as true (not false or nil) The goal of this is to abstract away the specifics of the mappings between types wherever possible from the codegen. For example previously by introducing Type::CString as a more specific version of Type::TString, uses of Type::TString in codegen needed to be updated to check either case. Now by using known_value_type, at least in theory we can introduce new types with minimal (if any) codegen changes. I think rust's Option type allows us to represent this uncertainty fairly well, and should help avoid mistakes, and the matching using this turned out pretty cleanly. * YJIT: Use known_value_type for checktype * YJIT: Use known_value_type for T_STRING check * YJIT: Use known_class_of in guard_known_klass * YJIT: Use known truthyness in jit_rb_obj_not * YJIT: Rename known_class_of => known_class Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-08-05* 2022-08-05 [ci skip]git
2022-08-05[rubygems/rubygems] Fix unused variable warningDavid Rodríguez
``` /Users/deivid/Code/rubygems/rubygems/test/rubygems/test_gem_resolver_installer_set.rb:55: warning: assigned but unused variable - a_1_local ``` https://github.com/rubygems/rubygems/commit/9ea4534800
2022-08-04thread_sync.c: pass proper argument to queue_sleep in rb_szqueue_pushJean Boussier
When I removed the SizeQueue#push timeout from my PR, I forgot to update the `queue_sleep` parameters to be a `queue_sleep_arg`. Somehow this worked on most archs, but on Solaris/Sparc it would legitimately crash when trying to access the `timeout` and `end` members of the struct. Notes: Merged: https://github.com/ruby/ruby/pull/6213
2022-08-04Add `-bundle_loader` to mjit compilation args on macOSYuta Saito
Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Resolve abi symbols from libruby.dylib when availableYuta Saito
Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Resolve abi symbol references from miniruby to avoid circular depsYuta Saito
Adding `ruby` to `PREP` causes the following circular dependencies because `PREP` is used as a prerequisite by some targets required to build `ruby` target itself. ``` make: Circular .rbconfig.time <- ruby dependency dropped. make: Circular builtin_binary.inc <- ruby dependency dropped. make: Circular ext/extinit.c <- ruby dependency dropped. make: Circular ruby <- ruby dependency dropped. ``` Adding a new Make variable like `EXTPREP` only for exts may be also reasonable, but it would introduce another complexity into our build system. `-bundle_loader` doesn't care that link-time and run-time loader executables are different as long as bound symbols are provided, so it's ok to resolve from miniruby to simplify our build. Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Use $(bindir) for path to executable in mkmfAlan Wu
For the macOS -bundle_loader linker option, we need a path to the Ruby exectuable. $(RUBY) is not necessarily a path since it could be a command line invocation. That happens during build with runruby.rb and can happen post installation if the user passes the --ruby option to a extconf.rb. Use $(bindir) to locate the executable instead. Before installation, $(bindir) doesn't exist, so we need to be able to override $(BUILTRUBY) in such situations so test-spec and bundled extensions could build. Use a new mkmf global, $builtruby, to do this; set it in fake.rb and in extmk.rb. Our build system is quite complex... Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Quote $(BUILTRUBY) so paths with spaces workAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Link ext bundles with bundle loader option for newer ld64Yuta Saito
ld64 shipped with Xcode 14 emits a warning when using `-undefined dynamic_lookup`. ``` ld: warning: -undefined dynamic_lookup may not work with chained fixups ``` Actually, `-undefined dynamic_lookup` doesn't work when: 1. Link a *shared library* with the option 2. Link it with a program that uses the chained-fixup introduced from macOS 12 and iOS 15 because `-undefined dynamic_lookup` uses lazy-bindings and they won't be bound while dyld fixes-up by traversing chained-fixup info. However, we build exts as *bundles* and they are loaded only through `dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory. So the warning produced by ld64 is false-positive, and it results failure of option checking in configuration. Therefore, it would be an option to ignore the warning during our configuration. On the other hand, `-undefined dynamic_lookup` is already deprecated on all darwin platforms except for macOS, so it's good time to get rid of the option. ld64 also provides `-bundle_loader <executable>` option, which allows to resolve symbols defined in the executable symtab while linking. It behaves almost the same with `-undefined dynamic_lookup`, but it makes the following changes: 1. Require that unresolved symbols among input objects must be defined in the executable. 2. Lazy symbol binding will lookup only the symtab of the bundle loader executable. (`-undefined dynamic_lookup` lookups all symtab as flat namespace) This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC configuration by assuming ruby executable can be linked before building exts. See "New Features" subsection under "Linking" section for chained fixup https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04[rubygems/rubygems] Warn dangling symlinksDavid Rodríguez
https://github.com/rubygems/rubygems/commit/425b78637f
2022-08-04[rubygems/rubygems] Extract entry.full_name to a variableDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3973773005
2022-08-04* 2022-08-04 [ci skip]git
2022-08-04[ruby/irb] shortcut colorize_code to speedup pretty_printtompng
https://github.com/ruby/irb/commit/8a074a6904
2022-08-03Harden Queue#pop timeout testsJean Boussier
They occasionaly fail with; ``` FLeaked thread: TestThreadQueue#test_queue_pop_timeout: #<Thread:0x0000000108e38e48 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 sleep> .Finished thread: TestThreadQueue#test_deny_pushers: #<Thread:0x0000000108e38e48 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 dead> ... Retrying... 1) Failure: TestThreadQueue#test_sized_queue_pop_timeout [/Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:157]: <#<Thread:0x00000001084bc7e8 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:156 sleep>> expected but was <nil>. 2) Failure: TestThreadQueue#test_queue_pop_timeout [/Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:124]: <#<Thread:0x00000001083ff058 /Users/runner/work/ruby/ruby/src/test/ruby/test_thread_queue.rb:123 sleep>> expected but was <nil>. ``` I'm hoping joining for longer should help avoid this. Notes: Merged: https://github.com/ruby/ruby/pull/6210
2022-08-03[rubygems/rubygems] Fix `bundle outdated --strict`David Rodríguez
It should be an alias of `--filter-strict`. `--update-strict` is essentially a dummy option with no special behavior associated and should be deprecated. https://github.com/rubygems/rubygems/commit/ec1e5d83c8
2022-08-03[rubygems/rubygems] Fix conservative updates regardless of `--strict`David Rodríguez
https://github.com/rubygems/rubygems/commit/c9a1d69a8d
2022-08-03Merge rubygems/bundler HEADHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/8331e63263081a6aa690d8025d2957f30c4e814a Notes: Merged: https://github.com/ruby/ruby/pull/6209
2022-08-03[ruby/bigdecimal] Updated to use the correct spec for muilti licenseThomas Winsnes
https://github.com/ruby/bigdecimal/commit/13165b29b8
2022-08-03Updated to use multiple licensesThomas Winsnes
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2022-08-03[rubygems/rubygems] fix platform matching for index specsIlya Dyakonov
https://github.com/rubygems/rubygems/commit/f087f1b590
2022-08-03[rubygems/rubygems] Warn (rather than crash) when setting `nil` ↵David Rodríguez
specification versions https://github.com/rubygems/rubygems/commit/a4ba1a4d97
2022-08-03[ruby/date] Enhanced RDoc (https://github.com/ruby/date/pull/69)Burdette Lamar
Treats: ::_strptime ::strptime Adds 'Related' entry to some methods' doc. https://github.com/ruby/date/commit/a6c2129273
2022-08-03[ruby/date] [DOC] Enhanced RDoc for parser methods ↵Burdette Lamar
(https://github.com/ruby/date/pull/68) Treats: ::_httpdate ::_iso8601 ::_jisx0301 ::_parse ::_rfc2822 ::_rfc3339 ::_xmlschema ::httpdate ::iso8601 ::jisx0301 ::parse ::rfc2822 ::rfc3339 ::xmlschema https://github.com/ruby/date/commit/24bdab600a
2022-08-03* 2022-08-03 [ci skip]git
2022-08-02Speed up setting the backref match objectAaron Patterson
This patch speeds up setting the backref match object by avoiding some memcopies. Take the following code for example: ```ruby "hello world" =~ /hello/ p $~ ``` When the RE matches the string, we have to set the Match object in the backref global. So we would allocate a match object[^1] and use `rb_reg_region_copy`[^2] to make a deep copy of the stack allocated `re_registers` struct[^3] in to the newly created Ruby object. This could possibly trigger GC[^4], and would allocate new memory. This patch makes a shallow copy of the `re_registers` struct on to the Match object allowing the match object to manage the `re_registers` pointer and also avoiding some calls to `xmalloc` and some manual memcopy. Benchmark looks like this: ```ruby require "benchmark/ips" def test_re thing thing =~ /hello/ end Benchmark.ips do |x| x.report("re hit") do test_re "hello world" end x.report("re miss") do test_re "world" end end ``` Before this patch: ``` $ ruby -v test.rb ruby 3.2.0dev (2022-07-27T22:29:00Z master 4ad69899b7) [arm64-darwin21] Ignoring bcrypt-3.1.16 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.16 Warming up -------------------------------------- re hit 345.401k i/100ms re miss 673.584k i/100ms Calculating ------------------------------------- re hit 3.452M (± 0.5%) i/s - 17.270M in 5.002535s re miss 6.736M (± 0.4%) i/s - 34.353M in 5.099593s ``` After this patch: ``` $ ./ruby -v test.rb ruby 3.2.0dev (2022-08-01T21:24:12Z less-memcpy 0ff2a56606) [arm64-darwin21] Warming up -------------------------------------- re hit 419.578k i/100ms re miss 673.251k i/100ms Calculating ------------------------------------- re hit 4.201M (± 0.7%) i/s - 21.398M in 5.093593s re miss 6.716M (± 0.4%) i/s - 33.663M in 5.012756s ``` Matches get faster and misses maintain the same speed [^1]: https://github.com/ruby/ruby/blob/24204d54ab730791bfbd0cd66b8e12f0bd62ca5d/re.c#L1737 [^2]: https://github.com/ruby/ruby/blob/24204d54ab730791bfbd0cd66b8e12f0bd62ca5d/re.c#L1738 [^3]: https://github.com/ruby/ruby/blob/24204d54ab730791bfbd0cd66b8e12f0bd62ca5d/re.c#L1686 [^4]: https://github.com/ruby/ruby/blob/24204d54ab730791bfbd0cd66b8e12f0bd62ca5d/re.c#L981 Notes: Merged: https://github.com/ruby/ruby/pull/6206
2022-08-02[DOC] Specify ways to run bootstrap testsPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/6194
2022-08-02[rubygems/rubygems] Array is already uniq, no need to deduplicate itDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3212ae14b7
2022-08-02[rubygems/rubygems] Fix arguments for bundle-config(1) docsTakuya Noguchi
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com> https://github.com/rubygems/rubygems/commit/3e62ca776d