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

57709 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun b0a291f6f6
Split CC_LINKER_ARGS from CC_DLDFLAGS_ARGS
to drop MJIT_DLDFLAGS from compile_c_to_o for OpenBSD failure
https://rubyci.org/logs/rubyci.s3.amazonaws.com/openbsd65/ruby-master/log/20190830T110008Z.fail.html.gz.

8c7f4e8f8b did not work for i686-linux
https://travis-ci.org/ruby/ruby/jobs/578808112.
2019-08-30 22:33:21 +09:00
Takashi Kokubun 8c7f4e8f8b
Try dropping DLDFLAGS from compile_c_to_o
I think this did not work for some environments, but this seems to fix
OpenBSD RubyCI failure:
https://rubyci.org/logs/rubyci.s3.amazonaws.com/openbsd65/ruby-master/log/20190830T110008Z.fail.html.gz

Let me check RubyCI impact by this.
2019-08-30 22:03:37 +09:00
Maciej Mensfeld c45dd4d482 Make the dot-colon method reference frozen
[Feature #16103]

Close: https://github.com/ruby/ruby/pull/2267
2019-08-30 18:24:33 +09:00
Kazuhiro NISHIYAMA 998ee350b9
Revert "require 'pp' before use PP"
of lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb.
This reverts commit 500149709b partially.
2019-08-30 16:09:08 +09:00
Nobuyoshi Nakada 631db0de27
Removed debug print
It seems to be fixed by b870ca5879.
2019-08-30 16:00:18 +09:00
Kazuhiro NISHIYAMA b870ca5879
Add guard as same as `==`
Try to fix failure at https://github.com/ruby/ruby/runs/207580232#step:10:382
```
       undefined method `name' for "Gemfile.lock":String
       /home/runner/work/ruby/ruby/lib/bundler/resolver/spec_group.rb:65:in `eql?'
```
2019-08-30 12:49:27 +09:00
Nobuyoshi Nakada 896d9f967b
Constified local variable `translator` 2019-08-30 12:06:42 +09:00
Nobuyoshi Nakada e9da4f57b3
Adjust indent [ci skip] 2019-08-30 12:06:42 +09:00
Kazuhiro NISHIYAMA 1680bd4e4f
[DOC] Return obj may be different from 1st argument [ci skip] 2019-08-30 12:03:50 +09:00
Yusuke Endoh ba9adcc175 spec/ruby/core/unboundmethod/bind_call_spec.rb: Add ruby_version_is guard 2019-08-30 11:49:42 +09:00
Nobuyoshi Nakada 96b32aad93
Exclude ripper y.output from packages [ci skip] 2019-08-30 11:26:48 +09:00
Nobuyoshi Nakada 98ccdd744a
Export the last modified revision for tags [ci skip] 2019-08-30 11:23:21 +09:00
Nobuyoshi Nakada e593d5b31a
Suppress uninitialized instance variable warnings [ci skip] 2019-08-30 11:23:21 +09:00
Nobuyoshi Nakada 55f496c89b
Support revision in git-svn log 2019-08-30 11:23:21 +09:00
Nobuyoshi Nakada 1191049436
Updated comment of VCS#get_revisions [ci skip] 2019-08-30 11:23:21 +09:00
卜部昌平 43ab88c737 Workaround for https://reviews.llvm.org/D25824
This changeset make it possible to use very old clang.
2019-08-30 11:20:43 +09:00
Yusuke Endoh c9fc82983c lib/pp.rb: Use UnboundMethod#bind_call instead of .bind(obj).call(...)
Related to [Feature #15955].
2019-08-30 11:13:00 +09:00
Yusuke Endoh 09c940b17f spec/ruby/core/unboundmethod/bind_call_spec.rb: Added
For UnboundMethod#bind_call [Feature #15955] introduced in
002e592e0d67bb0271d16314a32380ad947c9ae9.
2019-08-30 11:13:00 +09:00
Yusuke Endoh 83c6a1ef45 proc.c: Add UnboundMethod#bind_call
`umethod.bind_call(obj, ...)` is semantically equivalent to
`umethod.bind(obj).call(...)`.  This idiom is used in some libraries to
call a method that is overridden.  The added method does the same
without allocation of intermediate Method object.  [Feature #15955]

```
class Foo
  def add_1(x)
    x + 1
  end
end
class Bar < Foo
  def add_1(x) # override
    x + 2
  end
end

obj = Bar.new
p obj.add_1(1) #=> 3
p Foo.instance_method(:add_1).bind(obj).call(1) #=> 2
p Foo.instance_method(:add_1).bind_call(obj, 1) #=> 2
```
2019-08-30 11:13:00 +09:00
Kazuhiro NISHIYAMA 500149709b
require 'pp' before use PP
`Kernel#pp` has wrapper, but `PP` does not.

https://github.com/ruby/ruby/runs/207405029#step:10:141
`NameError: uninitialized constant Bundler::Molinillo::Resolver::Resolution::PP`
2019-08-30 10:21:50 +09:00
Charles Oliver Nutter 0a9d74f8cf Move pread + pwrite tests out of RUBY_ENGINE block
These tests were guarded by a RUBY_ENGINE of "ruby" even though they test an official Ruby feature (pread/pwrite added in Ruby 2.5). This commit moves them to the top level of the test case so they will run on other implementations.
2019-08-30 06:58:29 +09:00
Aaron Patterson bdc36094e3
Add some NODE information for lldb
Just adds a conditional in the lldb scripts so we can more easily debug
NODE objects.
2019-08-29 14:51:34 -07:00
schneems 94b79bffb1 Add word "Euler's number" to Math::E docs
When searching for this constant, I landed on the correct page https://ruby-doc.org/core-2.6.4/Math.html however I was using CMD+f to search for "Euler" and did not find it. If we add the full name for this constant then it will be easier to search for and find.
2019-08-29 11:57:23 -07:00
Kazuhiro NISHIYAMA a8b310e14c
7z does not accept gzip's options
e.g. `GZIP=-9`
2019-08-30 00:35:37 +09:00
git c52d38b7b6 * 2019-08-30 [ci skip] 2019-08-30 00:23:35 +09:00
Jeremy Evans e51dca2596 Disallow use of attrset symbols as Struct members
Fixes [Bug #11326]
2019-08-29 08:17:43 -07:00
Nobuyoshi Nakada 01b723ba6d
Refined warnings against literal in flip-flop 2019-08-29 23:06:27 +09:00
Nobuyoshi Nakada 79117d4a9b
NEWS: [Feature #16035] [ci skip] 2019-08-29 22:06:37 +09:00
aycabta 2c1e902cba Don't pick up lib/readline.rb from ruby/reline 2019-08-29 21:49:19 +09:00
aycabta a39b26b594 Check events that console window size changed on Windows 2019-08-29 21:11:53 +09:00
aycabta 3a425c7623 Fix alignment of a SHORT variable
typedef struct _COORD {
  SHORT X;
  SHORT Y; // I wanted to take this...
} COORD, *PCOORD;

typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
  COORD      dwSize;
  COORD      dwCursorPosition; // ...of this one
  WORD       wAttributes;      // But it's combined with first 2bytes of this
  SMALL_RECT srWindow;
  COORD      dwMaximumWindowSize;
} CONSOLE_SCREEN_BUFFER_INFO;

If wAttributes has non-zero value, the code breaks.
2019-08-29 21:05:19 +09:00
aycabta b74dd665c0 CONSOLE_SCREEN_BUFFER_INFO is 22bytes
typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
  COORD      dwSize;              // 4(SHORT X, Y)
  COORD      dwCursorPosition;    // 4
  WORD       wAttributes;         // 2
  SMALL_RECT srWindow;            // 8(SHORT Left, Top, Right, Bottom)
  COORD      dwMaximumWindowSize; // 4
} CONSOLE_SCREEN_BUFFER_INFO;
2019-08-29 21:03:44 +09:00
Jean Boussier a4a19b114b Allow non-finalizable objects in ObjectSpace::WeakMap
[feature #16035]

This goes one step farther than what nobu did in [feature #13498]

With this patch, special objects such as static symbols, integers, etc can be used as either key or values inside WeakMap. They simply don't have a finalizer defined on them.

This is useful if you need to deduplicate value objects
2019-08-29 20:40:52 +09:00
卜部昌平 e4be2fda3d Rule out gcc on Windows
It seems the combination fails at the moment.  Don't know exactly
why but I suspect there can be issues in resolving weak references.
Let's rule them out for now.

https://ci.appveyor.com/project/ruby/ruby/builds/27036383/job/x3c5d54839aacoyt
2019-08-29 18:34:09 +09:00
卜部昌平 3df37259d8 drop-in type check for rb_define_singleton_method
We can check the function pointer passed to
rb_define_singleton_method like how we do so in rb_define_method.
Doing so revealed many arity mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平 bfe5d22f89 drop-in type check for rb_define_private_method
We can check the function pointer passed to rb_define_private_method
like how we do so in rb_define_method.  Doing so revealed some
problematic usages of rb_obj_dummy.  They had to be split according
to their arity.
2019-08-29 18:34:09 +09:00
卜部昌平 9b429eb3b1 drop-in type check for rb_define_protected_method
We can check the function pointer passed to
rb_define_protected_method like how we do so in rb_define_method.
This changeset revealed no prototypes mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平 0b81e7d6e2 drop-in type check for rb_define_method_id
We can check the function pointer passed to rb_define_method_id
like how we do so in rb_define_method.  This method is relatively
rarely used so there are less problems found than the other APIs.
2019-08-29 18:34:09 +09:00
卜部昌平 0766f67168 move docs around [ci skip]
To properly generate documents.
2019-08-29 18:34:09 +09:00
卜部昌平 7bcfd9189a drop-in type check for rb_define_global_function
We can check the function pointer passed to rb_define_global_function
like we do so in rb_define_method.  It turns out that almost anybody
is misunderstanding the API.
2019-08-29 18:34:09 +09:00
卜部昌平 7b6fde4258 drop-in type check for rb_define_module_function
We can check the function pointer passed to rb_define_module_function
like how we do so in rb_define_method.  The difference is that this
changeset reveales lots of atiry mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平 9ef51b0b89 drop-in type check for rb_define_method
The rb_define_method function takes a pointer to ANYARGS-ed functions,
which in fact varies 18 different prototypes.  We still need to
preserve ANYARGS for storages but why not check the consistencies if
possible.

Q&As:

Q: Where did the magic number "18" came from in the description above?

A: Count the case branch of vm_method.c:call_cfunc_invoker_func().
   Note also that the 18 branches has lasted for at least 25 years.
   See also 200e0ee2fd.

Q: What is this __weakref__ thing?

A: That is a kind of function overloading mechanism that GCC provides.
   In this case for instance rb_define_method0 is an alias of
   rb_define_method, with a strong type.

Q: What is this __transparent_union__ thing?

A: That is another kind of function overloading mechanism that GCC
   provides.  In this case the attributed function pointer is either
   VALUE(*)(int,VALUE*,VALUE) or VALUE(*)(int,const VALUE*,VALUE).

   This is better than void* or ANYARGS because we can reject all
   other possibilities than the two.

Q: What does this rb_define_method macro mean?

A: It selects appropriate alias of the rb_define_method function,
   depending on the arity.

Q: Why the prototype change of rb_f_notimplement?

A: Function pointer to rb_f_notimplement is special cased in
   vm_method.c:rb_add_method_cfunc().  That should be handled by the
   __builtin_choose_expr chain inside of rb_define_method macro
   expansion.  In order to do so, comparison like (func ==
   rb_f_notimplement) is inappropriate for __builtin_choose_expr's
   expression (which must be a compile-time integer constant but the
   address of rb_f_notimplement is not fixed until the linker).  So
   instead we are using __builtin_types_compatible_p, and in doing so
   we need to distinguish rb_f_notimplement from others, by type.
2019-08-29 18:34:09 +09:00
卜部昌平 48e346a088 fix arity of bug_start
This is just a trivial mistake introduced in
0f36e8fc03.
2019-08-29 18:34:09 +09:00
卜部昌平 69683968a9 fix arity of rb_mutex_synchronize_m
This is just a trivial mistake introduced in
6c56dae4b2.
2019-08-29 18:34:09 +09:00
Nobuyoshi Nakada abe12d8b96
Freeze method reference operator object
[Feature #16103]
2019-08-29 16:58:21 +09:00
Nobuyoshi Nakada 2ed68d0ff9
Revert "Add pipeline operator [Feature #15799]"
This reverts commits:
* d365fd5a02
* d780c36624
* aa7211836b
* 043f010c28
* bb4dd7c6af05c7821d572e2592ea3d0cc748d81f
* 043f010c28
* f169043d81

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/94645
2019-08-29 15:27:59 +09:00
aycabta 893900dc78 Add stub set_screen_size for other platforms 2019-08-29 15:21:00 +09:00
git 07f9cd96f3 * 2019-08-29 [ci skip] 2019-08-29 15:12:37 +09:00
aycabta 0f405541bf Support SIGWINCH 2019-08-29 14:37:19 +09:00
Kazuhiro NISHIYAMA 682aaf6af5
Replace numbered parameters with named parameters [ci skip] 2019-08-29 14:35:09 +09:00