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

58137 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA 966915d807
[rubygems/rubygems] indent
https://github.com/rubygems/rubygems/commit/8cdb2fd66f
2019-09-26 17:48:01 +09:00
Hiroshi SHIBATA 1eb503373e
[rubygems/rubygems] filter dependency type and name strictly.
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>

https://github.com/rubygems/rubygems/commit/92892bbc3a
2019-09-26 17:48:01 +09:00
bronzdoc 0b65a7a19e
[rubygems/rubygems] Fix test_gem_attr
https://github.com/rubygems/rubygems/commit/7c5b66f9ef
2019-09-26 17:48:01 +09:00
David Rodríguez 4f87a1583d
[rubygems/rubygems] Introduce default prerelease requirement
https://github.com/rubygems/rubygems/commit/506c5bce49
2019-09-26 17:48:01 +09:00
David Rodríguez 6134fd7a64
[rubygems/rubygems] Remove comment not adding much
https://github.com/rubygems/rubygems/commit/b3b5c2d379
2019-09-26 17:48:01 +09:00
f 73633683c5
[rubygems/rubygems] add tests
https://github.com/rubygems/rubygems/commit/8a7e27381c
2019-09-26 17:48:01 +09:00
f 1fb44d2b8c
[rubygems/rubygems] Detect libc version, closes #2918
https://github.com/rubygems/rubygems/commit/1d18b12a26
2019-09-26 17:48:01 +09:00
David Rodríguez ea5b136155
[rubygems/rubygems] Fix underscore version for bundler itself
Previously it wouldn't play nice with the bundler version finder.

https://github.com/rubygems/rubygems/commit/d8bb81556d
2019-09-26 17:48:01 +09:00
Hiroshi SHIBATA ad638a713a
[rubygems/rubygems] Added jruby to matrix
https://github.com/rubygems/rubygems/commit/0832c079c8
2019-09-26 17:48:01 +09:00
Hiroshi SHIBATA 769a28d7dc
[rubygems/rubygems] Removed 2.2
https://github.com/rubygems/rubygems/commit/7fd2460f76
2019-09-26 17:48:01 +09:00
Hiroshi SHIBATA ba8fb735cb
[rubygems/rubygems] Added rvm workflow for Ruby 2.2 and 2.7
https://github.com/rubygems/rubygems/commit/d4ba75dfd2
2019-09-26 17:48:01 +09:00
Hiroshi SHIBATA 01c90f17d9
[rubygems/rubygems] Removed the needless configurations
https://github.com/rubygems/rubygems/commit/7134c49179
2019-09-26 17:48:01 +09:00
Hiroshi SHIBATA f5248f6f50
[rubygems/rubygems] Added the initial workflow file.
https://github.com/rubygems/rubygems/commit/6405a1e51a
2019-09-26 17:48:01 +09:00
bronzdoc 5c872b297c
[rubygems/rubygems] Avoid adding OpenSSL::PKey::RSA instances
https://github.com/rubygems/rubygems/commit/ba021fb4be
2019-09-26 17:48:01 +09:00
bronzdoc d1c97ceb86
[rubygems/rubygems] Update expectation in test_to_ruby_with_rsa_key
https://github.com/rubygems/rubygems/commit/2e65f7d4ae
2019-09-26 17:48:01 +09:00
bronzdoc 2e9c078707
[rubygems/rubygems] Fix indentation in case statement
https://github.com/rubygems/rubygems/commit/8ac0647659
2019-09-26 17:48:00 +09:00
bronzdoc 8f2379b0c5
[rubygems/rubygems] Make ruby_code method handle OpenSSL::PKey::RSA objects
https://github.com/rubygems/rubygems/commit/b1d825ab3a
2019-09-26 17:48:00 +09:00
Ellen Marie Dash 508afe2c26
[rubygems/rubygems] Set SOURCE_DATE_EPOCH env var if not provided.
Fixes #2290.

1. `Gem::Specification.date` returns SOURCE_DATE_EPOCH when defined,
2. this commit makes RubyGems set it _persistently_ when not provided.

This combination means that you can build a gem, check the build time,
and use that value to generate a new build -- and then verify they're
the same.

https://github.com/rubygems/rubygems/commit/d830d53f59
2019-09-26 17:48:00 +09:00
Daniel Berger 8436b2717c
[rubygems/rubygems] Add a gem attr to the Gem::Package class.
https://github.com/rubygems/rubygems/commit/5b81f364ae
2019-09-26 17:48:00 +09:00
Benoit Daloze 6ffc045a81 [EXPERIMENTAL] Make Symbol#to_s return a frozen String
* Always the same frozen String for a given Symbol.
* Avoids extra allocations whenever calling Symbol#to_s.
* See [Feature #16150]
2019-09-26 10:23:02 +02:00
Takashi Kokubun 4a4c502825
Add special runner to benchmark mjit_exec
I wanted to dynamically generate benchmark cases to test various number
of methods. Thus I added a dedicated runner of benchmark-driver.
2019-09-26 16:34:40 +09:00
Takashi Kokubun 5d8f112505
RubyVM::MJIT.pause(wait: true) should wait
for all compilations and compaction.

Prior to this commit, the last-compiled code has not been used because
MJIT worker is stopped before setting the code, and compaction has also
been skipped.

But it was not intentional and `wait: true` pause should wait until
those two things by its feature.
2019-09-26 16:28:34 +09:00
Alan Wu 47a234954a Rename STR_IS_SHARED_M to STR_BORROWED
Since the introduction of STR_SHARED_ROOT, the word "shared"
has become very overloaded with respect to String's internal
states. Use a different name for STR_IS_SHARED_M and explain
its purpose.
2019-09-26 15:30:18 +09:00
Alan Wu 93faa011d3 Tag string shared roots to fix use-after-free
The buffer deduplication codepath in rb_fstring can be used to free the buffer
of shared string roots, which leads to use-after-free.

Introudce a new flag to tag strings that at one point have been a shared root.
Check for it in rb_fstring to avoid freeing buffers that are shared by
multiple strings. This change is based on nobu's idea in [ruby-core:94838].

The included test case test for the sequence of calls to internal functions
that lead to this bug. See attached ticket for Ruby level repros.

[Bug #16151]
2019-09-26 15:30:18 +09:00
Nobuyoshi Nakada 3cee99808d [EXPERIMENTAL] Expression with modifier `in`
[Feature #15865]
2019-09-26 15:10:48 +09:00
Yusuke Endoh 1fe73dc860 include/ruby/ruby.h: suppress a false-positive warning of GCC
GCC emits a lot of false positives for rb_scan_args because:

* `rb_scan_args(argc, argv, "*:", NULL, &opts);` makes `n_mand == 0`,
* `n_mand == argc + 1` implies `argc == -1`, and
* `memcpy(ptr, argv, sizeof(VALUE)*argc);` explodes

However, we know that argc is never so big, thus this is a false
positive.  This change suppresses it by adding a condition `n_mand > 0`.

```
In file included from /usr/include/string.h:494,
                 from ./include/ruby/defines.h:145,
                 from ./include/ruby/ruby.h:29,
                 from ./include/ruby/encoding.h:27,
                 from dir.c:14:
In function 'memcpy',
    inlined from 'ruby_nonempty_memcpy.part.0' at ./include/ruby/ruby.h:1763:17,
    inlined from 'ruby_nonempty_memcpy' at ./include/ruby/ruby.h:1760:1,
    inlined from 'rb_scan_args_set' at ./include/ruby/ruby.h:2594:9,
    inlined from 'dir_s_aref' at dir.c:2774:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: '__builtin___memcpy_chk' pointer overflow between offset 0 and size [-8, 9223372036854775807] [-Warray-bounds]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning:
'__builtin___memcpy_chk' specified size 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
```
2019-09-26 11:35:01 +09:00
Nobuyoshi Nakada 5357ceb1ca
[ruby/io-console] Defer creating VT query string
https://github.com/ruby/io-console/commit/3d69c577a4
2019-09-26 09:59:27 +09:00
Nobuyoshi Nakada 9b10698705
[ruby/io-console] Added IO#console_mode
https://github.com/ruby/io-console/commit/77ed8d5a06
2019-09-26 09:59:27 +09:00
Jeremy Evans 3b302ea8c9 Add Module#ruby2_keywords for passing keywords through regular argument splats
This approach uses a flag bit on the final hash object in the regular splat,
as opposed to a previous approach that used a VM frame flag.  The hash flag
approach is less invasive, and handles some cases that the VM frame flag
approach does not, such as saving the argument splat array and splatting it
later:

  ruby2_keywords def foo(*args)
    @args = args
    bar
  end
  def bar
    baz(*@args)
  end
  def baz(*args, **kw)
    [args, kw]
  end
  foo(a:1)    #=> [[], {a: 1}]
  foo({a: 1}, **{}) #=> [[{a: 1}], {}]

  foo({a: 1}) #=> 2.7: [[], {a: 1}] # and warning
  foo({a: 1}) #=> 3.0: [[{a: 1}], {}]

It doesn't handle some cases that the VM frame flag handles, such as when
the final hash object is replaced using Hash#merge, but those cases are
probably less common and are unlikely to properly support keyword
argument separation.

Use ruby2_keywords to handle argument delegation in the delegate library.
2019-09-25 12:33:52 -07:00
Jeremy Evans 80b5a0ff2a
Make rb_scan_args handle keywords more similar to Ruby methods (#2460)
Cfuncs that use rb_scan_args with the : entry suffer similar keyword
argument separation issues that Ruby methods suffer if the cfuncs
accept optional or variable arguments.

This makes the following changes to : handling.

* Treats as **kw, prompting keyword argument separation warnings
  if called with a positional hash.

* Do not look for an option hash if empty keywords are provided.
  For backwards compatibility, treat an empty keyword splat as a empty
  mandatory positional hash argument, but emit a a warning, as this
  behavior will be removed in Ruby 3.  The argument number check
  needs to be moved lower so it can correctly handle an empty
  positional argument being added.

* If the last argument is nil and it is necessary to treat it as an option
  hash in order to make sure all arguments are processed, continue to
  treat the last argument as the option hash. Emit a warning in this case,
  as this behavior will be removed in Ruby 3.

* If splitting the keyword hash into two hashes, issue a warning, as we
  will not be splitting hashes in Ruby 3.

* If the keyword argument is required to fill a mandatory positional
  argument, continue to do so, but emit a warning as this behavior will
  be going away in Ruby 3.

* If keyword arguments are provided and the last argument is not a hash,
  that indicates something wrong. This can happen if a cfunc is calling
  rb_scan_args multiple times, and providing arguments that were not
  passed to it from Ruby.  Callers need to switch to the new
  rb_scan_args_kw function, which allows passing of whether keywords
  were provided.

This commit fixes all warnings caused by the changes above.

It switches some function calls to *_kw versions with appropriate
kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS
is used.  If creating new arguments, RB_PASS_KEYWORDS is used if
the last argument is a hash to be treated as keywords.

In open_key_args in io.c, use rb_scan_args_kw.
In this case, the arguments provided come from another C
function, not Ruby.  The last argument may or may not be a hash,
so we can't set keyword argument mode.  However, if it is a
hash, we don't want to warn when treating it as keywords.

In Ruby files, make sure to appropriately use keyword splats
or literal keywords when calling Cfuncs that now issue keyword
argument separation warnings through rb_scan_args.  Also, make
sure not to pass nil in place of an option hash.

Work around Kernel#warn warnings due to problems in the Rubygems
override of the method.  There is an open pull request to fix
these issues in Rubygems, but part of the Rubygems tests for
their override fail on ruby-head due to rb_scan_args not
recognizing empty keyword splats, which this commit fixes.

Implementation wise, adding rb_scan_args_kw is kind of a pain,
because rb_scan_args takes a variable number of arguments.
In order to not duplicate all the code, the function internals need
to be split into two functions taking a va_list, and to avoid passing
in a ton of arguments, a single struct argument is used to handle
the variables previously local to the function.
2019-09-25 11:18:49 -07:00
git 4755e23d2e * 2019-09-26 [ci skip] 2019-09-26 00:27:40 +09:00
Nobuyoshi Nakada ae83dbe28d Get rid of `IO.select` to fix multiline paste 2019-09-26 00:26:33 +09:00
Nobuyoshi Nakada 5b1fd79ad9
[DOC] fixed the return value of IO#ready? [ci skip]
IO#ready? returns true or false only, since r50262(1baa57b003).
2019-09-25 20:54:33 +09:00
Koichi Sasada 6d578164f5 check `ARY_SHARED_ROOT_P()`.
ARY_SHARED_ROOT_P(ary) is true, ARY_HEAP_CAPA(ary) should not
be called.
2019-09-25 17:12:55 +09:00
Koichi Sasada 3deeb3fd91 introduce `obj_ary_extracapa`.
Introduce a new debug counter `obj_ary_extracapa` which counts
arrays which are `len < capa`.
2019-09-25 17:01:54 +09:00
Nobuyoshi Nakada 112c9f1430
lldb_inspect: removed unnecessary newline and `end` option 2019-09-25 16:58:24 +09:00
Nobuyoshi Nakada 33c5ad3154
Removed idNUMPARAM_0 2019-09-25 13:52:53 +09:00
Nobuyoshi Nakada 55e1e22b2d
Changed numbered parameters semantics
* `_1` (and no other numbered parameters) to work as `|x|`.
* giving up `_0`.

[ruby-core:95074] [Bug #16178]
2019-09-25 13:01:03 +09:00
Nobuyoshi Nakada e663299a5f
Simplified duplicate code 2019-09-25 10:39:49 +09:00
Kazuhiro NISHIYAMA c99fb0f41e
Revert "[ruby/io-console] Skip cursor position test on Solaris"
This reverts commit 5294ded681.
2019-09-25 09:48:44 +09:00
Kazuhiro NISHIYAMA ca58e83400
Do not use of non-standard escape character '\e' 2019-09-25 09:48:44 +09:00
Nobuyoshi Nakada c60451d9cd [ruby/io-console] Unique paths to be added
https://github.com/ruby/io-console/commit/a3ad851b6c
2019-09-25 09:43:31 +09:00
Nobuyoshi Nakada fc9eb5b9c1 [ruby/io-console] Load the current libraries
https://github.com/ruby/io-console/commit/ab7653c543
2019-09-25 09:43:29 +09:00
git 8e8dd88c80 * 2019-09-25 [ci skip] 2019-09-25 08:24:44 +09:00
Nobuyoshi Nakada 5294ded681 [ruby/io-console] Skip cursor position test on Solaris
It results in a mysterious failure.

https://github.com/ruby/io-console/commit/e3543c3da4
2019-09-25 08:24:19 +09:00
Nobuyoshi Nakada 0e84eecc17 Make numbered parameters exclusive in a scope 2019-09-24 21:57:54 +09:00
Nobuyoshi Nakada ea68bb914a Changed numbered parameter prefix 2019-09-24 21:57:54 +09:00
Nobuyoshi Nakada e73cc3eead Added implicit block parameter 2019-09-24 21:57:54 +09:00
Kazuhiro NISHIYAMA a1dcb9daa5
Rename from ruby-x.y.z.ext.draft to ruby-x.y.z-draft.ext [ci skip] 2019-09-24 21:52:23 +09:00
Nobuyoshi Nakada c5a97d995a
misc/lldb_cruby.py: update for python3 [ci skip]
lldb module bundled with Xcode is for Python 3 now.
2019-09-24 21:05:29 +09:00