Commit graph

68050 commits

Author SHA1 Message Date
Samuel Williams
649c87bd86 Add C interface spec. 2021-09-20 18:30:51 +12:00
Samuel Williams
88ba5fe547 Expose rb_fiber_raise and tidy up the internal implementation. 2021-09-20 18:30:51 +12:00
Nobuyoshi Nakada
2e3d43e577 Allow to include uninitialized modules [Bug #18177]
The module that is about to be included is considered initialized.
2021-09-20 15:23:00 +09:00
git
d2d549032c * 2021-09-20 [ci skip] 2021-09-20 00:15:48 +09:00
Lars Kanis
576b2e64cd MINGW-UCRT: Set CONFIG['arch'] and RUBY_PLATFORM to "x64-mingw-ucrt"
This allows easy differentiation between ABI incompatible platforms like MSWIN64 and MSVCRT-based MINGW32.
This also implicates a distinct rubygem platform which is also "x64-mingw-ucrt".

Although the term "mingw32" is the OS-part for 64 bit systems as well, the "32" is misleading and confusing for many users.
Therefore the new platform string drops the "32" from the OS part to just "mingw".
This conforms to the common practice of windows platform testing per RUBY_PLATFORM=~/mswin|mingw/ .
2021-09-20 00:15:30 +09:00
Lars Kanis
52cc54ce6f CI: Enable MINGW-UCRT build and test in github actions
This enables a temporary branch on ruby/setup-ruby and MSP-Greg/setup-ruby-pkgs for UCRT-capable action setup.
They set correct PATH and MINGW_PACKAGE_PREFIX for UCRT, if a UCRT based ruby is used.
See here for more details: https://github.com/ruby/setup-ruby/issues/193
To enable correct UCRT settings this therefore uses rubyinstaller-head as base ruby, since it is already UCRT based.
2021-09-20 00:15:30 +09:00
Lars Kanis
70cefcfa0f Adjust test to set+get big values on all platforms and add MINGW-UCRT
Previously the test verified on MSWIN that huge values can not be stored in environment variables but that they can on others.
IMHO the intention of the test should not change between platforms.
Therefore this adjusts the test to have the same intention - that is to store a big value.

This also fixes compatibility with MINGW-UCRT, which previously failed with:
  <Errno::EINVAL: Invalid argument - ruby_setenv(foo)>
    test/ruby/test_env.rb:512:in `[]='
    test/ruby/test_env.rb:512:in `block in test_huge_value'
2021-09-20 00:15:30 +09:00
xtkoba (Tee KOBAYASHI)
e32fe3ce76 MINGW: _WIN64 is not defined on i386-mingw32 + ucrt. 2021-09-20 00:15:30 +09:00
xtkoba (Tee KOBAYASHI)
637d7288f3 MINGW: More permissive pattern matching for coroutine
Pattern matching for target_os in configure script should be permissive if we consider suffixing something onto "mingw32".
2021-09-20 00:15:30 +09:00
xtkoba (Tee KOBAYASHI)
8bda512878 MINGW: set rb_cv_msvcrt=ucrt and RT_VER=140 when UCRT is used 2021-09-20 00:15:30 +09:00
xtkoba (Tee KOBAYASHI)
4705ebd907 MINGW: Fix build error on Windows UCRT 2021-09-20 00:15:30 +09:00
Nobuyoshi Nakada
c0a892a7f0
Fix a typo [Bug #17048] 2021-09-19 22:39:18 +09:00
Nobuyoshi Nakada
d531f12e28
Enable shallow clone on appveyor
https://www.appveyor.com/docs/how-to/repository-shallow-clone/
2021-09-19 17:17:03 +09:00
Nobuyoshi Nakada
70624ae43d
Extract hook macro for attributes 2021-09-19 16:27:47 +09:00
Jeremy Evans
162ad65fdd Revert "Do not load file with same realpath twice when requiring"
This reverts commit ddb85c5d2b.

This commit causes unexpected warnings in TestTranscode#test_loading_race
occasionally in CI.
2021-09-18 17:37:35 -07:00
git
f9fd04ffbc * 2021-09-19 [ci skip] 2021-09-19 01:05:40 +09:00
Jeremy Evans
ddb85c5d2b Do not load file with same realpath twice when requiring
This fixes issues with paths being loaded twice in certain cases
when symlinks are used.

It took me multiple attempts to get this working.  My original
attempt tried to convert paths to realpaths before adding them
to $LOADED_FEATURES.  Unfortunately, this doesn't work well
with the loaded feature index, which is based off load paths
and not realpaths. While I was able to get require working, I'm
fairly sure the loaded feature index was not being used as
expected, which would have significant performance implications.
Additionally, I was never able to get that approach working with
autoload when autoloading a non-realpath file. It also broke
some specs.

This takes a more conservative approach. Directly before loading the
file, if the file with the same realpath has been required, the
loading of the file is skipped. The realpaths are stored as
fstrings in a hidden hash.

When rebuilding the loaded feature index, the hash of realpaths
is also rebuilt.  I'm guessing this makes rebuilding process
slower, but I don think that is a hot path. In general, modifying
loaded features is only done when reloading, and that tends to be
in non-production environments.

Change test_require_with_loaded_features_pop test to use 30 threads
and 300 iterations, instead of 4 threads and 1000 iterations.
I saw only sporadic failures with 4/1000, but consistent failures
30/300 threads. These failures were due to the fact that the
concurrent deletions from $LOADED_FEATURES in other threads can
result in rb_ary_entry returning nil when rebuilding the loaded
features index.

To avoid concurrency issues when rebuilding the loaded features
index, the building of the index itself is left alone, and
afterwards, a separate loop is done on a copy of the loaded feature
snapshot in order to rebuild the realpaths hash.

Fixes [Bug #17885]
2021-09-18 07:05:23 -09:00
Yusuke Endoh
1b300789ff ast.c: AST.of against C method should return nil (as Ruby 2.6--3.0) 2021-09-18 21:52:18 +09:00
Yusuke Endoh
ed9d9cee76 ast.c: AST.of checks if a given method object is defined in C
[Bug #18178]
2021-09-18 21:28:35 +09:00
Burdette Lamar
1c07c98229
Enhanced RDoc for Range (#4847)
Treated:

    #to_s
    #inspect
    #===
    #include?
    #cover?
    #count
2021-09-18 07:27:02 -05:00
git
593cc4ca83 * 2021-09-18 [ci skip] 2021-09-18 18:04:12 +09:00
Nobuyoshi Nakada
ec4ecb6d6d Include the invalid value in invalid_utc_offset error 2021-09-18 18:03:54 +09:00
Jose Galisteo
b45fe48fbb
[rubygems/rubygems] Trigger install command by default on remove
Closes https://github.com/rubygems/rubygems/issues/4889

2b1754479c
2021-09-17 20:46:18 +09:00
Nobuyoshi Nakada
fd918d1afa
Removed Module.allocate [Bug #17048] 2021-09-17 11:14:08 +09:00
Nobuyoshi Nakada
178ee1e801
Already initialized modules cannot be replaced [Bug #17048] 2021-09-17 11:14:04 +09:00
Nobuyoshi Nakada
8f41c791b1
Add spec for MatchData#match and MatchData#match_length [Feature #18172] 2021-09-17 10:27:00 +09:00
John Hawthorn
5a048829a4 Add WB_PROTECTED to mutexes
mutex_mark is (basically) NULL, so we don't have any references to mark.
This means we should safely be able to mark Mutex as WB_PROTECTED
without changing anything else.
2021-09-17 10:03:39 +09:00
Nobuyoshi Nakada
34d6720fee
Prohibit test method redefinition 2021-09-17 08:54:18 +09:00
git
8450b6a91d * 2021-09-17 [ci skip] 2021-09-17 08:39:26 +09:00
Nobuyoshi Nakada
475a4651b6
[Feature #18172] Fix duplicate test name 2021-09-17 08:38:29 +09:00
Nobuyoshi Nakada
cbbda3e648
Adjust indent in string.c [ci skip] 2021-09-16 23:49:16 +09:00
Nobuyoshi Nakada
aa3d8388c0
NEWS for [Feature #18172] [ci skip] 2021-09-16 19:55:31 +09:00
Nobuyoshi Nakada
f2cb6288bc
[Feature #18172] Add MatchData#match_length
The method to return the length of the matched substring
corresponding to the given argument.
2021-09-16 19:55:06 +09:00
Nobuyoshi Nakada
09d724e6f8
[Feature #18172] Add MatchData#match
The method to return the single matched substring corresponding to
the given argument.
2021-09-16 19:55:06 +09:00
Nobuyoshi Nakada
ddb32e6616
[Bug #18173] Update loaded_features_index
If $LOADED_FEATURES is changed in the just required file, also the
index table needs to be updated before loaded_features_snapshot is
reset.  If the snapshot is reset without updating the table, the
name of the added feature will not be found.
2021-09-16 18:48:20 +09:00
Shugo Maeda
5f1385bec0
Add a newline [ci skip] 2021-09-16 17:31:39 +09:00
Shugo Maeda
81fd91ab1b
Add details of Hash value ommission [ci skip] 2021-09-16 17:29:48 +09:00
S.H
68bd5626c3
Remove unneeded ruby_reset_leap_second_info function declaration (#4824) 2021-09-16 13:21:06 +09:00
Burdette Lamar
745287d43a
Enhanced RDoc for Range#minmax (#4846) 2021-09-15 15:51:54 -05:00
Burdette Lamar
e967740d07
Enhanced RDoc for Range#max (#4844) 2021-09-15 14:48:47 -05:00
git
67e3727d71 * 2021-09-16 [ci skip] 2021-09-16 03:37:51 +09:00
Burdette Lamar
97374c7eec
Enhanced RDoc for Range#min (#4842) 2021-09-15 13:37:34 -05:00
Peter Zhu
db51bcada4 Fix total_freed_objects for invalidated pages
When the object is moved back into the T_MOVED, the flags of the T_MOVED
is not copied, so the FL_FROM_FREELIST flag is lost. This causes
total_freed_objects to always be incremented.
2021-09-15 09:59:37 -04:00
Peter Zhu
a65ac2d6fa Don't overwrite free_slots count during sweeping
gc_compact_finish may invalidate pages, which may move objects from this
page to other pages, which updates the free_slots of this page.
2021-09-15 09:00:42 -04:00
Peter Zhu
e624d0d202 Update the free_slots count of the original page
When invalidating a page during compaction, the free_slots count should
be updated for the page of the object and not the page of the forwarding
address (since the object gets moved back to the forwarding address).
2021-09-15 09:00:42 -04:00
Olle Jonsson
92ac1721c2 [ruby/racc] gemspec: Link to https in homepage [ci skip]
96075f7720
2021-09-15 16:55:12 +09:00
Olle Jonsson
645acf5771 [ruby/racc] Prefer __dir__ over File.dirname(__FILE__)
c49df40658
2021-09-15 16:20:18 +09:00
Shugo Maeda
fae0f2486d
Add test cases for constants and keywords 2021-09-15 16:11:40 +09:00
Nobuyoshi Nakada
a27c274f04
[DOC] Fix broken links [ci skip]
* As the "doc/" prefix is specified by the `--page-dir` option,
  remove from the rdoc references.
* Refer to the original .rdoc instead of the converted .html.
2021-09-15 14:16:14 +09:00
卜部昌平
63ab2fedc8 include/ruby/atomic.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-15 09:25:23 +09:00