1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

73077 commits

Author SHA1 Message Date
Takashi Kokubun
ddf96b7693
Drop mswin support of MJIT ()
The current MJIT relies on SIGCHLD and fork(2) to be performant, and
it's something mswin can't offer. You could run Linux MJIT on WSL
instead.

[Misc ]
2022-08-20 18:35:36 -07:00
git
e85db84959 * 2022-08-21 [ci skip] 2022-08-21 08:33:24 +09:00
Takashi Kokubun
dc8d70e461
Execute MJIT in a forked Ruby process ()
[Misc ]
2022-08-20 16:33:03 -07:00
Benoit Daloze
209631a45f Consider resolved-through-zsuper methods equal for compatibility
* Fixes https://bugs.ruby-lang.org/issues/18751
2022-08-20 13:44:00 +02:00
Jeremy Evans
8212aab81a Make Object#method and Module#instance_method not skip ZSUPER methods
Based on c95e7e5329

Among other things, this fixes calling visibility methods (public?,
protected?, and private?) on them.  It also fixes #owner to show the
class the zsuper method entry is defined in, instead of the original
class it references.

For some backwards compatibility, adjust #parameters and #source_location,
to show the parameters and source location of the method originally
defined. Also have the parameters and source location still be shown
by #inspect.

Clarify documentation of {Method,UnboundMethod}#owner.

Add tests based on the description of https://bugs.ruby-lang.org/issues/18435
and based on https://github.com/ruby/ruby/pull/5356#issuecomment-1005298809

Fixes [Bug ] [Bug ]

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2022-08-20 13:44:00 +02:00
Nobuyoshi Nakada
b32a3f1275
[Bug ] Add test for rb_econv_append 2022-08-20 16:25:30 +09:00
Takashi Kokubun
485019c2bd
Rename mjit_exec to jit_exec ()
* Rename mjit_exec to jit_exec

* Rename mjit_exec_slowpath to mjit_check_iseq

* Remove mjit_exec references from comments
2022-08-19 23:57:17 -07:00
S-H-GAMELINKS
fc5382d465 Reuse rb_class_new_instance_kw function 2022-08-20 12:25:01 +09:00
nick evans
01e8d393bc Fix gdb incompatibilies in rp_class, rb_ps_vm
Other changes are needed to bring .gdbinit up-to-date with current ruby.
It looks like lldb is the preferred approach now, and that config *is*
being kept up-to-date.  Still, this might be helpful to someone?
2022-08-20 12:24:37 +09:00
Jeremy Evans
6f3857f6a7 Support Encoding::Converter newline: :lf and :lf_newline options
Previously, newline: :lf was accepted but ignored.  Where it
should have been used was commented out code that didn't work,
but unlike all other invalid values, using newline: :lf did
not raise an error.

This adds support for newline: :lf and :lf_newline, for consistency
with newline: :cr and :cr_newline.  This is basically the same as
universal_newline, except that it only affects writing and not
reading due to RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK.

Add tests for the File.open :newline option while here.

Fixes [Bug ]
2022-08-19 20:23:36 -07:00
Nobuyoshi Nakada
1a2f99275b [Bug ] format string must be ASCII compatible 2022-08-20 10:06:40 +09:00
Nobuyoshi Nakada
43e8d9a050 Check if encoding capable object before check if ASCII compatible 2022-08-20 10:06:40 +09:00
Nobuyoshi Nakada
d2483393cb [Bug ] Negative codepoints are invalid characters 2022-08-20 10:06:16 +09:00
Takashi Kokubun
8f4a53d051
Ignore fc4acf8cae on git blame 2022-08-19 14:45:51 -07:00
Takashi Kokubun
fc4acf8cae
Make benchmark indentation consistent
Related to https://github.com/Shopify/yjit-bench/pull/109
2022-08-19 14:44:08 -07:00
git
745de85a7e * 2022-08-20 [ci skip] 2022-08-20 03:57:35 +09:00
Nobuyoshi Nakada
1ef49de834 [Bug ] format single character for %c 2022-08-20 03:57:13 +09:00
Nobuyoshi Nakada
ce384ef5a9 [Bug ] Check length of argument for %c in proper encoding 2022-08-20 03:57:13 +09:00
Kaíque Kandy Koga
4177f60eed Write interface instead of interfact 2022-08-19 22:18:36 +09:00
Yusuke Endoh
6bcb473d9c [ruby/error_highlight] Apply ErrorHighlight::CoreExt to TypeError and ArgumentError
https://github.com/ruby/error_highlight/commit/defcaf1beb
2022-08-19 18:34:15 +09:00
Hiroshi SHIBATA
17d0e5bee7
syntax_suggest moved to under the ruby organization. 2022-08-19 13:20:20 +09:00
Nobuyoshi Nakada
bd0fe26b81
[DOC] Fix "military timezone"
Not only `J` is called military timezone.
2022-08-19 10:20:52 +09:00
git
61ab06fe8a Update default gems list at 490af8dbdb [ci skip] 2022-08-19 01:03:07 +00:00
schneems
490af8dbdb Sync SyntaxSuggest
```
$ tool/sync_default_gems.rb syntax_suggest
```
2022-08-19 10:02:24 +09:00
schneems
a50df1ab0e Setup SyntaxSuggest as default gem
Adds the `syntax_suggest` syntax error display tool to Ruby through the same mechanism as `error_highlight` and `did_you_mean`. Reference ticket: https://bugs.ruby-lang.org/issues/18159

close 

## What is syntax_suggest?

When a syntax error is raised by requiring a file, dead_end will use a combination of indentation and lexing to identify the problem.

> Note: Previously this tool was named `dead_end`. 

## Known issues

- SyntaxSearch's approach of showing syntax errors only works through integration with `require`, `load`, `autoload`, and `require_relative` (since it monkeypatches them to detect syntax errors). It does not work with direct Ruby file invocations https://github.com/zombocom/dead_end/issues/31.
  - This causes failure in the test suite (test_expected_backtrace_location_when_inheriting_from_basic_object_and_including_kernel) and confusion when inspecting backtraces if there's a different error when trying to require a file such as measuring memory (https://github.com/zombocom/syntax_suggest/issues/124#issuecomment-1006705016).
  - Discussed fix. We previously talked about opening up `SyntaxError` to be monkeypatched in the same way that other gems hook into `NoMethodError`. This is currently not possible and requires development work. When we last talked about it at RubyKaigi Nobu expressed an ability to make such a change.
2022-08-19 10:02:24 +09:00
S-H-GAMELINKS
3541f32951 Reuse opt_nl rule 2022-08-19 09:51:06 +09:00
S-H-GAMELINKS
f095361758 Repalce to NIL_P macro 2022-08-19 09:47:43 +09:00
Nobuyoshi Nakada
35c794b26d Fixed by [Bug ] 2022-08-19 03:05:53 +09:00
Nobuyoshi Nakada
99116da7f0 Scan the code range of the last added portion 2022-08-19 03:05:53 +09:00
Nobuyoshi Nakada
f34280ec6b Scan the code range of the formatted portion 2022-08-19 03:05:53 +09:00
git
59da26789f * remove trailing spaces. [ci skip] 2022-08-19 02:25:54 +09:00
Matt Valentine-House
92603bbd69 [ci skip][Feature ][lldb] Dedup lldb_init
by moving it fully into RbBaseCommand
2022-08-18 13:25:32 -04:00
Matt Valentine-House
b26aec9daa [ci-skip][Feature ][lldb] New directory structure
Push the newly refactored lldb files into a sub-directory so that we're
not cluttering up the misc directory
2022-08-18 13:25:32 -04:00
Matt Valentine-House
a4ef2f1672 [ci-skip][Feature ][lldb] Port rclass_ext to new LLDB Framework 2022-08-18 13:25:32 -04:00
Matt Valentine-House
281bcc8e64 [ci-skip][Feature ][lldb] Port heap_page command to new LLDB framework 2022-08-18 13:25:32 -04:00
Matt Valentine-House
f1ccfa0c2c [ci-skip][Feature ][lldb] Provide class framework for lldb commands
`lldb_cruby.py` manages lldb custom commands using functions. The file
is a large list of Python functions, and an init handler to map some of
the Python functions into the debugger, to enable execution of custom
logic during a debugging session.

Since LLDB 3.7 (September 2015) there has also been support for using
python classes rather than bare functions, as long as those classes
implement a specific interface.

This PR Introduces some more defined structure to the LLDB helper
functions by switching from the function based implementation to the
class based one, and providing an auto-loading mechanism by which new
functions can be loaded.

The intention behind this change is to make working with the LLDB
helpers easier, by reducing code duplication, providing a consistent
structure and a clearer API for developers.

The current function based approach has some advantages and
disadvantages

Advantages:

- Adding new code is easy.
- All the code is self contained and searchable.

Disadvantages:
- No visible organisation of the file contents. This means
  - Hard to tell which functions are utility functions and which are
    available to you in a debugging session
  - Lots of code duplication within lldb functions
- Large files quickly become intimidating to work with - for example,
  `lldb_disasm.py` was implemented as a seperate Python module because
  it was easier to start with a clean slate than add significant amounts
  of code to `lldb_cruby.py`

This PR attempts, to fix the disadvantages of the current approach and
maintain, or enhance, the benefits. The new structure of a command looks
like this;

 ```
 class TestCommand(RbBaseCommand):
    # program is the keyword the user will type in lldb to execute this command
    program = "test"

    # help_string will be displayed in lldb when the user uses the help functions
    help_string = "This is a test command to show how to implement lldb commands"

    # call is where our command logic will be implemented
    def call(self, debugger, command, exe_ctx, result):
        pass
  ```

If the command fulfils the following criteria it will then be
auto-loaded when an lldb session is started:

- The package file must exist inside the `commands` directory and the
  filename must end in `_command.py`
- The package must implement a class whose name ends in `Command`
- The class inherits from `RbBaseCommand` or at minimum a class that
  shares the same interface as `RbBaseCommand`  (at minimum this means
  defining `__init__` and `__call__`, and using `__call__` to call
  `call` which is defined in the subclasses).
- The class must have a class variable `package` that is a String. This
  is the name of the command you'll call in the `lldb` debugger.
2022-08-18 13:25:32 -04:00
Nobuyoshi Nakada
d903e76726 Allow strings in assert_pattern_list 2022-08-19 01:28:31 +09:00
git
8c44b07fa4 * 2022-08-19 [ci skip] 2022-08-19 00:17:06 +09:00
Nobuyoshi Nakada
2652b0da6b
Harden SizedQueue#push timeout test 2022-08-19 00:16:44 +09:00
Nobuyoshi Nakada
7c1ed47097
Add tests for assert_pattern_list 2022-08-18 23:38:56 +09:00
Nobuyoshi Nakada
c53667691a
[DOC] offset argument of Regexp#match 2022-08-18 23:25:05 +09:00
Jean Boussier
b0b9f7201a rb_str_resize: Only clear coderange on truncation
If we are expanding the string or only stripping extra capacity
then coderange won't change, so clearing it is wasteful.
2022-08-18 10:09:08 +02:00
Jean Boussier
fe61cad749 Implement SizedQueue#push(timeout: sec)
[Feature ]

If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
2022-08-18 10:07:37 +02:00
git
b3718edee2 Update bundled gems list at 2022-08-18 2022-08-18 07:04:23 +00:00
Nobuyoshi Nakada
725626d890 [Bug ] Update the code range of appended portion 2022-08-18 14:57:08 +09:00
Yusuke Endoh
2a55c61ee7 ext/pty/extconf.rb: Try libutil only on OpenBSD
icc now seems to provide libutil.so that is not related to pty.
This extconf.rb wrongly finds it and adds `-lutil`, but `ruby -rpty`
fails because it cannot find libutil.so on the runtime.

http://rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20220815T210005Z.fail.html.gz
```
Exception raised:
<#<LoadError: libutil.so: cannot open shared object file: No such file or directory - /home/chkbuild/chkbuild/tmp/build/20220815T210005Z/ruby/.ext/x86_64-linux/pty.so>>
```

This change makes extconf.rb check libutil only on OpenBSD.
2022-08-18 12:46:24 +09:00
Nobuyoshi Nakada
fbaa2f0b3b
Suppress detached head warnings [ci skip]
Check out the revisions for testing as "detached" from the beginning.
2022-08-18 11:05:34 +09:00
git
bfefaf47f0 * 2022-08-18 [ci skip] 2022-08-18 02:26:43 +09:00
Jemma Issroff
b4539dba7a Added vm setivar benchmark from yjit-bench 2022-08-17 10:26:28 -07:00
Peter Zhu
b4daf6e28e Fix flaky test for GC thrashing
GC could be in an intermediate state after creating the objects, so we
should finish GC by running a minor GC.
2022-08-17 10:54:28 -04:00