87158 Commits

Author SHA1 Message Date
Naoto Ono
509f1b50c2 Lanunchable: Add missing condition statement
Addresses https://github.com/ruby/ruby/pull/11183/files#r1680617485.
2024-07-18 12:22:47 +09:00
Nobuyoshi Nakada
d11d615ba6
Fix utimesat availability condition
As `__has_attribute` macro is always defined in internal/compilers.h,
gcc warns `-Wunguarded-availability-new` as unknown option.  Check if
the warning option is usable instead.
2024-07-18 11:20:17 +09:00
Hartley McGuire
d0c17cbd09
Require space between hash/content in ATX heading (#1140)
While writing some Markdown documentation for Rails, I came across an
interesting case where trying to link to an instance method at the start
of a line would instead parse as an H1 heading:

```markdown
#response_body=
```

Expected:

```html
<a href=""><code>#response_body=</code></a>
```

Actual:

```html
<h1>response_body=</h1>
```

According to the CommonMark spec:

> At least one space or tab is required between the # characters and the
> heading’s contents, unless the heading is empty. Note that many
> implementations currently do not require the space. However, the space
> was required by the original ATX implementation, and it helps prevent
> things like the following from being parsed as headings:
>
> Example 64

So while some implementations do not follow this requirement, I believe
RDoc should because it makes it easy to write text similar to Example 64
(which was used in the new test) and it also enables automatically
linking to instance methods at the start of a line.
2024-07-18 09:40:01 +09:00
Stan Lo
239d54dfbc [ruby/rdoc] Improve rubocop setup
(https://github.com/ruby/rdoc/pull/1139)

* Rename rake rubocop to rake format_generated_files

* Add rubocop rules to ensure spaces are applied consistently

* Improve rubocop related CI workflows

https://github.com/ruby/rdoc/commit/27932d001c
2024-07-17 20:43:08 +00:00
Peter Zhu
573c2893dc Don't disable GC in rb_gc_impl_object_id
Disabling GC when creating the object ID was introduced in commit
67b2c21, but we shouldn't need to disable the GC.
2024-07-17 15:46:41 -04:00
Kevin Newton
2cc20c06e0
[PRISM] Use RSTRING_PTR for Ruby parsing with fgets 2024-07-17 15:45:07 -04:00
Kevin Newton
e77e4aa608 [ruby/prism] Have parse_stream handle NUL bytes
https://github.com/ruby/prism/commit/4a41d298c8
2024-07-17 19:44:32 +00:00
Koichi ITO
0fe816f380 [ruby/prism] [Doc] Tweak example of Prism::Dispatcher
This PR tweaked the documentation to correct an error encountered
when running the example code of `Prism::Dispatcher`.
This aims to make understanding the example smoother.

https://github.com/ruby/prism/commit/165a1a0e78
2024-07-17 18:17:59 +00:00
Kevin Newton
7de2c06352
[PRISM] Use RSTRING_LEN for Prism stream parsing 2024-07-17 14:13:16 -04:00
Nobuyoshi Nakada
278bbd7b45 Revert pending EVENT_RETURN tests
* "Allow ambiguosity of `return` line"
  65b991bc8571b7b718fc22bd33a43c4d269bf52d
* "Move to test/.excludes-prism"
  3b4ff810d2fefdf0194bd774bc04f6f17e2ccae7
* "Pending `EVENT_RETURN` settracefunc tests with Prism"
  a7f33c99c69e3cc62b7a24ce35f51f76cc5bfaa2
2024-07-17 14:06:11 -04:00
Nobuyoshi Nakada
644424941a [Bug #20457] [Prism] Remove redundant return flag 2024-07-17 14:06:11 -04:00
Kevin Newton
7993b88eee [PRISM] Use StringValuePtr for fgets for Prism stream parsing 2024-07-17 13:58:58 -04:00
Alan Wu
99825a539f [DOC] Note that rb_obj_freeze_inline() can raise NoMemoryError
And move it back to a public header because Doxygen might not be
scanning the .c files.

[Feature #18776]
2024-07-17 10:25:20 -04:00
Alan Wu
cd428b490d [DOC] No more is rb_ary_freeze() an alias of rb_obj_freeze()
[Feature #20589]
2024-07-17 10:25:20 -04:00
Peter Zhu
403f44ec2c Make OBJ_ID_INCREMENT == RUBY_IMMEDIATE_MASK + 1
All the non-GC objects (i.e. immediates) have addresses such that
`obj % RUBY_IMMEDIATE_MASK != 0` (except for `Qfalse`, which is 0). We
can define `OBJ_ID_INCREMENT` as `RUBY_IMMEDIATE_MASK + 1` which should
guarantee that GC objects never have conflicting object IDs with
immediates.
2024-07-17 09:01:42 -04:00
Matt Valentine-House
690ea013ca Remove unused variable from GC compaction path 2024-07-17 12:47:27 +01:00
David Rodríguez
3c3cce13c6 [rubygems/rubygems] Fix another case of bundle lock --add-platform doing nothing
https://github.com/rubygems/rubygems/commit/0629e27dda
2024-07-17 11:14:53 +00:00
Hiroshi SHIBATA
58aebcbce1 [rubygems/rubygems] Applied rubocop
https://github.com/rubygems/rubygems/commit/c26054e7e9
2024-07-17 10:17:57 +00:00
Yusuke Endoh
3f65df48bd Report a TracePoint log when the TracePoint tests fail 2024-07-17 18:41:39 +09:00
Hiroshi SHIBATA
af60317861 Removed needless block arguments 2024-07-17 17:37:57 +09:00
Hiroshi SHIBATA
2a12e4ffec To avoid fd leak with fetch request for SSL server 2024-07-17 17:37:57 +09:00
Hiroshi SHIBATA
e55bae4a67 Close leaked TCPServer socket 2024-07-17 17:37:57 +09:00
Hiroshi SHIBATA
76386ba1c0 Close leaked SSLServer socket 2024-07-17 17:37:57 +09:00
Hiroshi SHIBATA
f4c642edb1 Fixed fd leak from TCPServer
```
Leaked file descriptor: HTTPSProxyTest#test_https_proxy_ssl_connection: 8 : #<TCPServer:fd 8, AF_INET, 127.0.0.1, 63104>
```
2024-07-17 17:37:57 +09:00
Naoto Ono
2b3bfbc4c7 Launchable: Fix Python package path 2024-07-17 16:53:58 +09:00
Nobuyoshi Nakada
03a0ade90d
Fix double free when getcwd does not allocate buffer
Do not free the result at normal return from `ruby_getcwd`.
2024-07-17 15:16:21 +09:00
Nobuyoshi Nakada
05502c1dda
Add a macro to initialize struct getattrlist_args 2024-07-17 12:00:27 +09:00
Iskren
371790165f
[DOC] Fix and improve array slicing example in range.c
* [DOC] Fix typo in range.c

  In the example of the beginless range used for array slicing,
  '..' range literal was used while the '...' literal was expected

* [DOC] Add example for array slicing in range.c

  Add an example for the array slice with the beginless range
  using the '..' range literal

* [DOC] Add comments for array slicing in range.c

  Add comments to make crystal clear what the '..' and '...'
  range literals do when used for array slicing as beginless range
2024-07-17 11:42:29 +09:00
Jeremy Evans
dabb6c49aa
Release GVL around {,f}getattrlist calls in dir.c
Fixes [Bug #20587]
2024-07-16 19:20:17 -07:00
Peter Zhu
c083a3ffcd Fix memory leak reported in main ractor when RUBY_FREE_AT_EXIT
STACK OF 1 INSTANCE OF 'ROOT LEAK: <calloc in rb_ractor_main_alloc>':
6   dyld                                  0x1840e20e0 start + 2360
5   miniruby                              0x1006796c8 main + 88  main.c:62
4   miniruby                              0x10072f4a4 ruby_init + 16  eval.c:99
3   miniruby                              0x10072f328 ruby_setup + 104  eval.c:81
2   miniruby                              0x1008d08c0 Init_BareVM + 508  vm.c:4276
1   miniruby                              0x1007f8944 rb_ractor_main_alloc + 76  ractor.c:2034
0   libsystem_malloc.dylib                0x1842a4cac _malloc_zone_calloc_instrumented_or_legacy + 128
====
    1 (96 bytes) ROOT LEAK: <calloc in rb_ractor_main_alloc 0x1347075d0> [96]
2024-07-16 15:50:00 -04:00
Kevin Newton
c4a021ef96 [ruby/prism] Move sample files under sample/prism
https://github.com/ruby/prism/commit/9e9b069404
2024-07-16 19:26:28 +00:00
Kevin Newton
e3c5d73e0f
[PRISM] Omit two more ast tests that will not work without RubyVM::Ast 2024-07-16 14:41:42 -04:00
Kevin Newton
b0a99d0da9 [PRISM] Properly compile branch conditions in their own sequence 2024-07-16 14:40:20 -04:00
Kevin Newton
90e945a7b7 [PRISM] Fix up ensure+loop+break 2024-07-16 14:40:20 -04:00
Stan Lo
4a4e1bf357 [ruby/irb] Group class methods under class << self
(https://github.com/ruby/irb/pull/981)

https://github.com/ruby/irb/commit/cdaa356df2
2024-07-16 15:58:15 +00:00
Peter Zhu
4fe3082b63 [DOC] Fix typo in gc/default.c 2024-07-16 09:55:48 -04:00
Nobuyoshi Nakada
60d3ed5043 [Bug #20457] Drop unreachable return at end of method 2024-07-16 22:11:28 +09:00
Peter Zhu
93489d536b Remove dependency on dtrace when building shared GC 2024-07-16 09:09:41 -04:00
Peter Zhu
db3472d84c Set BUILDING_SHARED_GC when building shared GC 2024-07-16 09:09:41 -04:00
Nobuyoshi Nakada
e722f4c57f Stop using sigsetjmp to hijack SIGCHLD handler
It already has been dead code.
Follow up of 65d3eacc80bbefb29e5cd0f3f9661d886f2e4cee.
2024-07-16 18:41:42 +09:00
git
6dd1ab0f9f Update bundled gems list as of 2024-07-16 2024-07-16 06:59:05 +00:00
Shugo Maeda
e048a073a3 Add MatchData#bytebegin and MatchData#byteend
These methods return the byte-based offset of the beginning or end of the specified match.

[Feature #20576]
2024-07-16 14:48:06 +09:00
卜部昌平
a887b41875 static const char *type_name() implemented
The function body was missing.
2024-07-16 13:09:19 +09:00
卜部昌平
963059a8d2 fix compile error 2024-07-16 13:09:19 +09:00
Hiroshi SHIBATA
7a0e6f1d12
Follow-up resolv and win32 integration
https://github.com/ruby/resolv/pull/54
2024-07-16 12:12:40 +09:00
Kazuhiro NISHIYAMA
b01cf8ccde
Fix a typo
[Misc #20636]
2024-07-16 11:40:50 +09:00
Alan Wu
a1435981e9 [DOC] Document RbConfig::SIZEOF 2024-07-15 21:08:13 -04:00
Alan Wu
3531d22918 [DOC] Document RbConfig::LIMITS 2024-07-15 21:08:13 -04:00
Alan Wu
9bf1049dfb Refactor so RDoc picks up RbConfig::{SIZEOF,LIMITS} 2024-07-15 21:08:13 -04:00
nicholas a. evans
e165d92d37
[ruby/rdoc] Drop reimplementation of Ripper lex state
(https://github.com/ruby/rdoc/pull/1118)

* Drop reimplementation of Ripper lex state

This code was for ruby 2.4 compatibility, but rdoc dropped support for
ruby 2.4 about three years ago, in f480b970c.  This code was almost half
of the lines of code in rdoc/parser/ripper_state_lex.

* Remove unused Ripper constants and const_defined?

This was mostly copied from the diff in @st0012's PR comment.  The
remaining constants have been updated to get their value directly from
Ripper.

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Use Ripper::EXPR_LABEL directly

Since this is only used from outside RipperStateLex, there's no longer
any benefit to using the indirect reference rather than just going
straight to Ripper.

---------

https://github.com/ruby/rdoc/commit/dd8c216263

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-07-16 07:22:11 +09:00