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

71204 Коммитов

Автор SHA1 Сообщение Дата
Peter Zhu 638fd8774b [Feature #18249] Include ruby.h in extensions to have ABI version
All shared libraries must have `include/ruby/internal/abi.h` to include
the ABI version. Including `ruby.h` will guarantee that.
2022-02-22 09:55:21 -05:00
Peter Zhu 3df16924b4 [Feature #18249] Implement ABI checking
Header file include/ruby/internal/abi.h contains RUBY_ABI_VERSION which
is the ABI version. This value should be bumped whenever an ABI
incompatible change is introduced.

When loading dynamic libraries, Ruby will compare its own
`ruby_abi_version` and the `ruby_abi_version` of the loaded library. If
these two values don't match it will raise a `LoadError`. This feature
can also be turned off by setting the environment variable
`RUBY_RUBY_ABI_CHECK=0`.

This feature will prevent cases where previously installed native gems
fail in unexpected ways due to incompatibility of changes in header
files. This will force the developer to recompile their gems to use the
same header files as the built Ruby.

In Ruby, the ABI version is exposed through
`RbConfig::CONFIG["ruby_abi_version"]`.
2022-02-22 09:55:21 -05:00
Tim Pope 37d5890e49 [ruby/reline] Fix support for emacs-ctlx and emacs-meta keymaps
The existing implementation, given the below .inputrc, erroneously
creates a "C-v" key binding:

	set keymap emacs-ctlx
	"\C-v": "[C-x C-v was pressed]"

This fixes it to instead create a "C-x C-v" keybinding.

https://github.com/ruby/reline/commit/719f52d231
2022-02-22 18:52:52 +09:00
Mau Magnaguagno 50098f4b61 [ruby/zlib] [DOC] Fix typo in Zlib.adler32_combine
https://github.com/ruby/zlib/commit/5e8f0b4164
2022-02-22 18:01:53 +09:00
Yusuke Endoh ae8a8b184e [ruby/rdoc] Prefer `require 'cgi/util'` instead of `require 'cgi'`
RDoc is using only CGI.escape, escapeHTML, and unescape.
We don't have to load the whole source code of cgi gem.

https://github.com/ruby/rdoc/commit/d096222cc2
2022-02-22 17:08:52 +09:00
Hiroshi SHIBATA a49aae2c5e [rubygems/rubygems] Resolve cleaned-up error with temporary gemhome
https://github.com/rubygems/rubygems/commit/623162ad2b
2022-02-22 13:32:59 +09:00
git 7d81ee42ba * 2022-02-22 [ci skip] 2022-02-22 11:56:03 +09:00
Yusuke Endoh 25b0577c92 Factor a "highlight" symbol out 2022-02-22 11:55:40 +09:00
Yusuke Endoh eda10e8102 Remove unneeded newline from detailed_message 2022-02-22 11:55:40 +09:00
Yusuke Endoh 5099f64fa4 Add a test for Exception#detailed_message 2022-02-22 11:55:40 +09:00
Yusuke Endoh 4db986431a Let Exception#full_message pass highlight keywords to #detailed_message
.. even when the argument is not explicitly passed.
2022-02-22 11:55:40 +09:00
Yusuke Endoh 89e446683e test/ruby/test_rubyoptions.rb: Make it pass on Windows 2022-02-22 11:55:40 +09:00
Yusuke Endoh 98ca99cdd0 The default highlight arguments of Exception#detailed_message is false 2022-02-22 11:55:40 +09:00
Yusuke Endoh 35ff545bb6 Exception#detailed_message is added
Also, the default error printer and Exception#full_message use the
method instead of `Exception#message` to get the message string.

`Exception#detailed_message` calls `Exception#message`, decorates and
returns the result. It adds some escape sequences to highlight, and the
class name of the exception to the end of the first line of the message.

[Feature #18370]
2022-02-22 11:55:40 +09:00
Yusuke Endoh 3af316fa8c Refactor out rb_decorate_message from print_errinfo
rb_decorate_message adds bold escape sequences to message, and the class
name of exception (like " (RuntimeError)) of "message (RuntimeError)").
2022-02-22 11:55:40 +09:00
Yusuke Endoh f207f7a193 Do not escape error message
[Feature #18367]
2022-02-22 11:55:40 +09:00
Yusuke Endoh 36e31b09cd error.c: Refactoring
Factor out from rb_error_write the responsibility to check if stderr is
a tty.
2022-02-22 11:55:40 +09:00
Hiroshi SHIBATA c53bdb8ff6
Removed dependency of net-protocol. There is no plan to remove from stdlib 2022-02-21 17:10:56 +09:00
Hiroshi SHIBATA 79b04790e8
Removed dependency of io-wait. There is no plan to remove from stdlib 2022-02-21 17:10:22 +09:00
Nobuyoshi Nakada 8f0e3a97f9
rb_debug_rstring_null_ptr: add newlines in the message [ci skip]
The message should end with a newline, and break the long
paragraph.
2022-02-21 16:22:23 +09:00
Nobuyoshi Nakada f92f08ff23
[DOC] Set the documentation title and main page
Copied from https://github.com/ruby/docs.ruby-lang.org/ to be as
same as docs.ruby-lang.org.
2022-02-21 13:08:06 +09:00
git 1abd068445 * 2022-02-21 [ci skip] 2022-02-21 00:44:42 +09:00
Kazuhiro NISHIYAMA 1f3fe3801b
Fix links [ci skip] 2022-02-21 00:44:19 +09:00
git 9f3b6caf96 * 2022-02-20 [ci skip] 2022-02-20 20:40:16 +09:00
Nobuyoshi Nakada ed8776f960 [MSWin] Tentative measure for a bug of VS2022 [Misc #18362]
Disable the use of `__assume()`, when combinations of `isnan()`,
`isinf()` and `__assume()` will be wrongly optimized due to the
bug of VS2022.
2022-02-20 20:39:48 +09:00
Nobuyoshi Nakada 32af1a3b5e [MSWin] Try VS2022 2022-02-20 20:39:48 +09:00
Nobuyoshi Nakada 71388f9d39 [MSWin] Reduce duplicate configurations 2022-02-20 20:39:48 +09:00
Nobuyoshi Nakada 7470780058 Check if `__assume` is supported 2022-02-19 23:32:52 +09:00
Nobuyoshi Nakada 131154f878 Define `HAVE___BUILTIN_UNREACHABLE` instead of `UNREACHABLE`
`UNREACHABLE` in ruby/internal/has/builtin.h is only used as just
a flag now, and redefined in ruby/backward/2/assume.h then.
2022-02-19 23:32:52 +09:00
S-H-GAMELINKS 6e6ee1e6b3 Replace and Using METACLASS_OF macro 2022-02-19 23:18:51 +09:00
Shugo Maeda c8817d6a3e
Add String#byteindex, String#byterindex, and MatchData#byteoffset (#5518)
* Add String#byteindex, String#byterindex, and MatchData#byteoffset [Feature #13110]

Co-authored-by: NARUSE, Yui <naruse@airemix.jp>
2022-02-19 19:10:00 +09:00
Kazuki Tsujimoto db6b23c76c
Find pattern is no longer experimental [Feature #18585] 2022-02-19 18:45:49 +09:00
Kazuki Tsujimoto 3200d97e95
Fix location of NODE_LIT in p_kw 2022-02-19 18:45:36 +09:00
Nobuyoshi Nakada 4641abf0a2 Use symbols for clock IDs if `clockid_t` is not numeric 2022-02-19 15:33:15 +09:00
Nobuyoshi Nakada b3de25dfee Set static IDs to same name variables 2022-02-19 15:33:15 +09:00
Nobuyoshi Nakada 2ae35ad766 RUBY_REPLACE_TYPE: check if the target type is a pointer 2022-02-19 15:33:15 +09:00
Nobuyoshi Nakada dfa17f46a8
[DOC] prefer rdoc references over generated URLs 2022-02-19 15:14:01 +09:00
Burdette Lamar bec3a1f15a
Enhanced RDoc for io.c (#5573)
Links to options doc added/improved; in particular, new links to new section "Encoding Options" in encoding.rdoc.  Minor inconsistencies ironed out.
2022-02-18 16:17:51 -06:00
git 344f775eff * 2022-02-19 [ci skip] 2022-02-19 04:33:35 +09:00
Burdette Lamar 883fe55c4b
New doc about encoding (#5572)
This is the beginning of an extended explication of Ruby encoding.

One of its more important jobs is to provide link targets for encoding documentation in other classes (String, File, IO, etc.). In particular, they can link to the "Encoding Options" section.

I'll have much to add to this document going forward, along with suitable adjustments in the class documentation.
2022-02-18 13:33:18 -06:00
Peter Zhu 82513c7d71 Remove unused function declaration in dln.c
getenv is no longer used in dln.c.
2022-02-18 09:30:08 -05:00
Shugo Maeda cda5aee74e
LONG2NUM() should be used for rmatch_offset::{beg,end}
https://github.com/ruby/ruby/pull/5518#discussion_r809645406
2022-02-18 22:13:45 +09:00
Burdette Lamar e9a2b30744
Enhanced RDoc concerning command injection (#5537)
Clarifies security vulnerabilities for commands.

Treats:

    Kernel.system
    Kernel.` (backtick)
    IO.popen
    IO.read
    IO.write
    IO.binread
    IO.binwrite
    IO.readlines
    IO.foreach
2022-02-18 06:46:04 -06:00
NARUSE, Yui 542a38f619 gen-mail.rb: support markdown file path 2022-02-18 21:44:22 +09:00
Yuta Saito dff70b50d0 [wasm] vm.c: stop unwinding to main for every vm_exec call by setjmp
the original rb_wasm_setjmp implementation always unwinds to the root
call frame to have setjmp compatible interface, and simulate sjlj's
undefined behavior. Therefore, every vm_exec call unwinds to main, and
a deep call stack makes setjmp call very expensive. The following
snippet from optcarrot takes 5s even though it takes less than 0.3s on
native.

```
[0x0, 0x4, 0x8, 0xc].map do |attr|
  (0..7).map do |j|
    (0...0x10000).map do |i|
      clr = i[15 - j] * 2 + i[7 - j]
      clr != 0 ? attr | clr : 0
    end
  end
end
```

This patch adds a WASI specialized vm_exec which uses lightweight
try-catch API without unwinding to the root frame. After this patch, the
above snippet takes only 0.5s.
2022-02-18 18:28:18 +09:00
Akinori MUSHA ac32b7023a Mention Set as a new builtin class to NEWS 2022-02-18 11:56:24 +09:00
Akinori MUSHA dd3501bb95 Make Set a builtin feature [Feature #16989] 2022-02-18 11:56:24 +09:00
git 7757ccb504 * 2022-02-18 [ci skip] 2022-02-18 01:54:28 +09:00
Jeremy Evans 4c366ec977 Add Thread.each_caller_location
This method takes a block and yields Thread::Backtrace::Location
objects to the block.  It does not take arguments, and always
starts at the default frame that caller_locations would start at.

Implements [Feature #16663]
2022-02-17 08:54:07 -08:00
Nobuyoshi Nakada 4113862c00 Do not search for commands with double tool prefixes [Bug #18504]
The `CC` found by `AC_CHECK_TOOL` is prefixed by the host triplet
when cross compiling.  To search for commands with `AC_CHECK_TOOL`
based on that `CC` means to search also doubly prefixed names.
2022-02-17 22:47:02 +09:00