Граф коммитов

72924 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 591ee9d068
[DOC] Add return values of rb_enc_mbcput 2022-08-07 13:09:46 +09:00
git 6d742c9412 * 2022-08-07 [ci skip] 2022-08-07 00:03:21 +09:00
Nobuyoshi Nakada e545cfad20
Stop using casted `rb_syswait` as `proc_syswait`
The argument of `rb_syswait` is now `rb_pid_t` which may differ from
`int`.  Also it is an undefined behavior to take the result of casted
void function (in `rb_protect`).
2022-08-07 00:02:38 +09:00
Nobuyoshi Nakada f245b425af
Fix the sizes comparison
`proc_syswait` will be called with a `VALUE` argument.
2022-08-06 23:56:44 +09:00
David Rodríguez 466a760e18 [rubygems/rubygems] Fix yanked gems being unintentionally update when other gems are unlocked
This is a regression from a change intended to raise errors when user
puts a gem under an incorrect source in the Gemfile by mistake. To fix
the issue, we revert the change that caused it and implement it in a
different way that restores the resolver independency from real
specifications. Now it deals only with names and versions and does not
try to materialize anything into real specifications before resolving.

https://github.com/rubygems/rubygems/commit/d2bf1b86eb
2022-08-06 15:41:46 +09:00
David Rodríguez 8dd63b89d9 [rubygems/rubygems] Move comment where the actual replacement happens
https://github.com/rubygems/rubygems/commit/d60acdf80d
2022-08-06 15:41:46 +09:00
David Rodríguez 4ea521f6c7 [rubygems/rubygems] Remove unclear comment
https://github.com/rubygems/rubygems/commit/3a843c1ac7
2022-08-06 15:41:45 +09:00
David Rodríguez af40af45b2 [rubygems/rubygems] Extract `SourceList#get_with_fallback`
https://github.com/rubygems/rubygems/commit/9dbc4757a8
2022-08-06 15:41:45 +09:00
Nobuyoshi Nakada 27173e3735
Allow `RUBY_DEBUG_LOG` format to be empty
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-06 10:52:00 +09:00
Nobuyoshi Nakada 58c8b6e862
Adjust styles [ci skip] 2022-08-06 10:13:20 +09:00
Alan Wu c433d36b5b Test that File.read defaults to text mode
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-08-05 14:34:08 -04:00
Alan Wu ca8daf70fa [DOC] Mention Windows text mode EOF marker interpretation
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>
2022-08-05 14:34:08 -04:00
Alan Wu f1057393da [DOC] Clarify that `IO.read` uses text mode
See: https://bugs.ruby-lang.org/issues/18882#note-13

[Bug #18882]
2022-08-05 14:34:08 -04:00
git ce6dc9f660 * 2022-08-06 [ci skip] 2022-08-06 03:05:55 +09:00
Burdette Lamar 412da2c221
Sync new doc in Date (#6215) 2022-08-05 13:05:38 -05:00
Nobuyoshi Nakada 2f0d9e74c8 Get rid of `-C` option for very old `git` 2022-08-05 20:46:53 +09:00
Ivo Anjo 74817f3d37
[DOC] Process._fork does not get called by Process.daemon
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>
2022-08-05 18:40:48 +09:00
David Rodríguez f310ac1cb2 [rubygems/rubygems] Include backtrace with crashes by default
https://github.com/rubygems/rubygems/commit/3cc3bfd371
2022-08-05 16:37:03 +09:00
David Rodríguez 5a9db23734 [rubygems/rubygems] Automatically remove "ruby" from lockfile if incomplete
https://github.com/rubygems/rubygems/commit/69d0b4e10b
2022-08-05 16:36:42 +09:00
Nobuyoshi Nakada 73f0573cb3
Ignore revision to test unless HAVE_GIT 2022-08-05 09:55:49 +09:00
Nobuyoshi Nakada 8fae120912
Clone upstream gem repositories for test 2022-08-05 09:53:18 +09:00
Nobuyoshi Nakada 5791171201
Load gemspec file at that directory
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.
2022-08-05 09:52:20 +09:00
Nobuyoshi Nakada 661536ab16
Copy from cloned gem sources in parallel 2022-08-05 09:52:12 +09:00
Nobuyoshi Nakada 44a0a66559
Move to tool/lib/bundled_gem.rb 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 41516b3541
Extract bundled gems by BASERUBY 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 6a8f1a9e5c
Copy from bundled gem source for test 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 87d8d25796
Use configured GIT 2022-08-05 09:39:47 +09:00
John Hawthorn 70b60d24b9 Fix inconsistency with opt_aref_with
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.
2022-08-04 14:48:47 -07:00
Noah Gibbs 1e7a2415a4
YJIT: Allow str-concat arg to be any string subtype, not just rb_cString (#6205)
Allow str-concat arg to be any string subtype, not just rb_cString
2022-08-04 12:19:14 -04:00
John Hawthorn 7f5f9d19c5
YJIT: Add known_* helpers for Type (#6208)
* 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
2022-08-04 11:18:24 -04:00
git 8bab099830 * 2022-08-05 [ci skip] 2022-08-05 00:09:30 +09:00
David Rodríguez c84d0538be [rubygems/rubygems] Fix unused variable warning
```
/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-05 00:09:18 +09:00
Jean Boussier 6b2fc33ae2 thread_sync.c: pass proper argument to queue_sleep in rb_szqueue_push
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.
2022-08-04 11:48:31 +02:00
Yuta Saito 00f411c58a Add `-bundle_loader` to mjit compilation args on macOS 2022-08-04 16:29:22 +09:00
Yuta Saito 184fd94d7e Resolve abi symbols from libruby.dylib when available 2022-08-04 16:29:22 +09:00
Yuta Saito 6d8b9a9d61 Resolve abi symbol references from miniruby to avoid circular deps
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.
2022-08-04 16:29:22 +09:00
Alan Wu e5a3f23256 Use $(bindir) for path to executable in mkmf
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...
2022-08-04 16:29:22 +09:00
Alan Wu c69582a540 Quote $(BUILTRUBY) so paths with spaces work 2022-08-04 16:29:22 +09:00
Yuta Saito 50d81bfbc1 Link ext bundles with bundle loader option for newer ld64
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
2022-08-04 16:29:22 +09:00
David Rodríguez 542040fb83 [rubygems/rubygems] Warn dangling symlinks
https://github.com/rubygems/rubygems/commit/425b78637f
2022-08-04 13:36:45 +09:00
David Rodríguez 0591780a74 [rubygems/rubygems] Extract entry.full_name to a variable
https://github.com/rubygems/rubygems/commit/3973773005
2022-08-04 13:36:44 +09:00
git 3944862066 * 2022-08-04 [ci skip] 2022-08-04 08:37:19 +09:00
tompng b54f26b704 [ruby/irb] shortcut colorize_code to speedup pretty_print
https://github.com/ruby/irb/commit/8a074a6904
2022-08-04 08:37:03 +09:00
Jean Boussier 4406cb1bf1 Harden Queue#pop timeout tests
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.
2022-08-03 10:59:13 +02:00
David Rodríguez 851b3aa7dd [rubygems/rubygems] Fix `bundle outdated --strict`
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 16:33:53 +09:00
David Rodríguez 35c65e7ba6 [rubygems/rubygems] Fix conservative updates regardless of `--strict`
https://github.com/rubygems/rubygems/commit/c9a1d69a8d
2022-08-03 16:33:52 +09:00
Hiroshi SHIBATA 71794a75db Merge rubygems/bundler HEAD
Pick from 8331e63263
2022-08-03 13:14:10 +09:00
Thomas Winsnes 8a1be433e8 [ruby/bigdecimal] Updated to use the correct spec for muilti license
https://github.com/ruby/bigdecimal/commit/13165b29b8
2022-08-03 11:04:31 +09:00
Thomas Winsnes f33b2ae918
Updated to use multiple licenses
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2022-08-03 11:04:20 +09:00
Ilya Dyakonov 4f00ee8d47 [rubygems/rubygems] fix platform matching for index specs
https://github.com/rubygems/rubygems/commit/f087f1b590
2022-08-03 06:56:36 +09:00