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

2889 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA 6b2b9e0019 [rubygems/rubygems] Also added x86_64-darwin-21
https://github.com/rubygems/rubygems/commit/c03e7e1564
2022-09-15 12:50:48 +09:00
Hiroshi SHIBATA ec0d9a6a6f [rubygems/rubygems] Added arm64-darwin-22 to lockfiles for testing
https://github.com/rubygems/rubygems/commit/d7956e9ce5
2022-09-15 12:50:48 +09:00
Nobuyoshi Nakada c28a4e0340
Replace "Fixes"/"Fixed" in commit logs as well as vcs.rb [ci skip]
Use the same regexp to replace "(#NNNN)" and "GH-NNNN" style
references in vcs.rb, too.
2022-09-14 11:24:06 +09:00
Benoit Daloze 92b907d12d Enable deprecation warnings for test-all
* So deprecated methods/constants/functions are dealt with early,
  instead of many tests breaking suddenly when removing a deprecated
  method/constant/function.
* Follows https://bugs.ruby-lang.org/issues/17591
2022-09-10 13:14:18 +02:00
Nobuyoshi Nakada 9faa9ced96 Support sub-library in builtin-loader
Previously, it was supported in prelude.c, but has not followed up the
builtin-loader system.
2022-09-09 15:47:24 +09:00
Aaron Patterson 56e5210cde
More robust macro parser (#6343)
I want to use more complicated macros with MJIT.  For example:

```
  # define SHAPE_MASK (((unsigned int)1 << SHAPE_BITS) - 1)
```

This commit adds a simple recursive descent parser that produces an AST
and a small visitor that converts the AST to Ruby.
2022-09-09 15:19:23 +09:00
Nobuyoshi Nakada 59eadf3d25
Ignore EACCES on Windows 2022-09-09 11:36:15 +09:00
Nobuyoshi Nakada bcf82b7c26
Process token IDs from id.def without id.h
Fixes id.h error during updating ripper.c by `make after-update`.

While it used to update id.h in the build directory, but was trying to
update ripper.c in the source directory.  In principle, files in the
source directory can or should not depend on files in the build
directory.
2022-09-08 18:22:47 +09:00
Nobuyoshi Nakada 35c493ecf5
Dump cross.rb only when verbose [ci skip] 2022-09-07 14:48:54 +09:00
Takashi Kokubun 06eb9af8c0
Add mjit-bindgen workflow (#6327) 2022-09-05 01:06:37 -07:00
Takashi Kokubun c2986f7d28
Fix warnings from private_constant
`private_constant *constants` seems to be warned for some reason
2022-09-05 00:27:49 -07:00
Hiroshi SHIBATA 3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00
Takashi Kokubun 3767c6a90d
Ruby MJIT (#6028) 2022-09-04 21:53:46 -07:00
Nobuyoshi Nakada 4d469472e2
Debugging snapshot [ci skip] 2022-09-05 13:08:23 +09:00
Nobuyoshi Nakada 85a483169f
Use cross compiling settings as fake.rb for snapshots 2022-09-05 11:16:20 +09:00
Nobuyoshi Nakada 2767cb2825
Now fake.rb is needed to prepare sources 2022-09-03 21:57:17 +09:00
John Hawthorn 679ef34586 New constant caching insn: opt_getconstant_path
Previously YARV bytecode implemented constant caching by having a pair
of instructions, opt_getinlinecache and opt_setinlinecache, wrapping a
series of getconstant calls (with putobject providing supporting
arguments).

This commit replaces that pattern with a new instruction,
opt_getconstant_path, handling both getting/setting the inline cache and
fetching the constant on a cache miss.

This is implemented by storing the full constant path as a
null-terminated array of IDs inside of the IC structure. idNULL is used
to signal an absolute constant reference.

    $ ./miniruby --dump=insns -e '::Foo::Bar::Baz'
    == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,13)> (catch: FALSE)
    0000 opt_getconstant_path                   <ic:0 ::Foo::Bar::Baz>      (   1)[Li]
    0002 leave

The motivation for this is that we had increasingly found the need to
disassemble the instructions between the opt_getinlinecache and
opt_setinlinecache in order to determine the constant we are fetching,
or otherwise store metadata.

This disassembly was done:
* In opt_setinlinecache, to register the IC against the constant names
  it is using for granular invalidation.
* In rb_iseq_free, to unregister the IC from the invalidation table.
* In YJIT to find the position of a opt_getinlinecache instruction to
  invalidate it when the cache is populated
* In YJIT to register the constant names being used for invalidation.

With this change we no longe need disassemly for these (in fact
rb_iseq_each is now unused), as the list of constant names being
referenced is held in the IC. This should also make it possible to make
more optimizations in the future.

This may also reduce the size of iseqs, as previously each segment
required 32 bytes (on 64-bit platforms) for each constant segment. This
implementation only stores one ID per-segment.

There should be no significant performance change between this and the
previous implementation. Previously opt_getinlinecache was a "leaf"
instruction, but it included a jump (almost always to a separate cache
line). Now opt_getconstant_path is a non-leaf (it may
raise/autoload/call const_missing) but it does not jump. These seem to
even out.
2022-09-01 15:20:49 -07:00
Nobuyoshi Nakada 462a8be511
VCS#revision_header: Make arguments optional 2022-09-01 20:57:30 +09:00
Nobuyoshi Nakada 55b1600987
Update revision.h in packages using `VCS#revision_header` 2022-09-01 18:45:09 +09:00
Nobuyoshi Nakada ee09f75a6b
Extract `VCS#revision_header` 2022-09-01 18:01:40 +09:00
Nobuyoshi Nakada 762fca9b12
Prefer `File` class methods to write a string 2022-09-01 18:01:40 +09:00
Hiroshi SHIBATA f3becd73e3
Ignore test libraries like assert_ractor from did_you_mean 2022-09-01 17:02:55 +09:00
Hiroshi SHIBATA f229b36087
Fix test fail with assert_ractor outside of ruby/ruby repo
Revert 806583c093
2022-09-01 16:15:51 +09:00
Hiroshi SHIBATA 41a275c89a
Support main branch for syntax_suggest 2022-08-29 09:52:09 +09:00
Hiroshi SHIBATA 1cbee173be Sync examples and cli from syntax_suggest 2022-08-26 12:15:47 +09:00
Takashi Kokubun a60507f616
Rename mjit_compile.c to mjit_compiler.c
I'm planning to introduce mjit_compiler.rb, and I want to make this
consistent with it. Consistency with compile.c doesn't seem important
for MJIT anyway.
2022-08-21 11:33:06 -07:00
Takashi Kokubun b93d554be9
Fix a typo [ci skip] 2022-08-20 18:36:52 -07:00
Takashi Kokubun ddf96b7693
Drop mswin support of MJIT (#6265)
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 #18968]
2022-08-20 18:35:36 -07:00
Takashi Kokubun 485019c2bd
Rename mjit_exec to jit_exec (#6262)
* 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
Hiroshi SHIBATA 17d0e5bee7
syntax_suggest moved to under the ruby organization. 2022-08-19 13:20:20 +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 #4845

## 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
Nobuyoshi Nakada d903e76726 Allow strings in assert_pattern_list 2022-08-19 01:28:31 +09:00
Nobuyoshi Nakada 7c1ed47097
Add tests for assert_pattern_list 2022-08-18 23:38:56 +09:00
Nobuyoshi Nakada ac890ec062
Make date in installed gemspec files stable
Set `date` member to `RUBY_RELEASE_DATE` instead of the date at the
build time, to make installed files reproducible.
2022-08-17 00:58:56 +09:00
Nobuyoshi Nakada cc443f6cde
Refactor `RbInstall::Specs::FileCollector`
- Split into `Ext` and `Lib` classes.
- `Ext#files` should not include built extension libraries.
- `Ext#files` should include scripts under its own `lib`.
- `Lib#files` should be prefixed with `lib/`.
2022-08-17 00:58:56 +09:00
Nobuyoshi Nakada e44445596f
Preserve each column positions in gems/bundled_gems 2022-08-12 23:51:55 +09:00
Nobuyoshi Nakada a3a6d2d9a3 No bundled gems to be installed from gem now 2022-08-12 15:55:40 +09:00
Nobuyoshi Nakada 04815ea968 All extensions in bundled gems are built by build-ext now
`RbInstall::GemInstaller#build_extensions` has nothing to do.
2022-08-12 15:55:40 +09:00
Nobuyoshi Nakada 0bb5525eb2
Fix files for gemspec files direct-under lib
Collected `files` lacked `lib` prefix.
2022-08-07 17:01:22 +09:00
Burdette Lamar 412da2c221
Sync new doc in Date (#6215) 2022-08-05 13:05:38 -05:00
Nobuyoshi Nakada 5791171201
Load gemspec file at that directory
Gemspec files generated by old bundler run `git` without changing the
working directory.
Or some gemspec files expect an owned file at the top exists ath the
current working directory.
2022-08-05 09:52:20 +09:00
Nobuyoshi Nakada 44a0a66559
Move to tool/lib/bundled_gem.rb 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 6a8f1a9e5c
Copy from bundled gem source for test 2022-08-05 09:44:18 +09:00
Alan Wu e5a3f23256 Use $(bindir) for path to executable in mkmf
For the macOS -bundle_loader linker option, we need a path to the
Ruby exectuable. $(RUBY) is not necessarily a path since it could
be a command line invocation. That happens during build with
runruby.rb and can happen post installation if the user passes
the --ruby option to a extconf.rb. Use $(bindir) to locate
the executable instead.

Before installation, $(bindir) doesn't exist, so we need to be
able to override $(BUILTRUBY) in such situations so test-spec
and bundled extensions could build. Use a new mkmf global,
$builtruby, to do this; set it in fake.rb and in extmk.rb.

Our build system is quite complex...
2022-08-04 16:29:22 +09:00
Hiroshi SHIBATA 62849b3379 Keep gitignore for libyaml source with psych 2022-07-29 19:10:10 +09:00
Nobuyoshi Nakada 464f73a5f0
Do not load library files from repository only for test
What we want to test should be the bundled and to be installed files,
but not the upstream.
2022-07-27 17:36:45 +09:00
Nobuyoshi Nakada 456e1d1eaa
Try the tag without "v" prefix to checkout upstream repositories 2022-07-26 21:12:58 +09:00
Hiroshi SHIBATA b404a5f106
8fa66467de is broken with rubygems/rubygems and flori/json.
Revert "Fix sync_default_gems.rb to use absolute path"

This reverts commit 8fa66467de.
2022-07-26 13:42:37 +09:00
Peter Zhu 8fa66467de Fix sync_default_gems.rb to use absolute path 2022-07-25 16:29:14 -04:00
Burdette Lamar 43c11f6c49
For rdoc, copy doc/rdoc to doc/ (#6181) 2022-07-25 14:58:41 -05:00
Nobuyoshi Nakada b291c972fa Use built bundled gems in test-bundled-gems 2022-07-25 08:50:07 +09:00
Nobuyoshi Nakada e0a7e5e131
Kill bundled gem tests when interrupted 2022-07-24 16:36:33 +09:00
Takashi Kokubun 5b21e94beb Expand tabs [ci skip]
[Misc #18891]
2022-07-21 09:42:04 -07:00
Jemma Issroff 85ea46730d Separate TS_IVC and TS_ICVARC in is_entries buffers
This allows us to treat cvar caches differently than ivar caches.
2022-07-18 14:06:30 -07:00
Nobuyoshi Nakada 64cff78005 `Gem.unpack` extracts gems so able to execute
Creates simple bin stubs to load the extracted executable files.
After only extracted under `gems` directory, the gems are considered
installed but the executable scripts are not found.
Also the second argument is now the parent of the previous second and
third arguments.
2022-07-17 19:57:48 +09:00
Nobuyoshi Nakada d20886dd22
Create build-only gemspec files only if having an extension 2022-07-17 10:30:56 +09:00
Nobuyoshi Nakada 6c1d7dab52
Fix conversion from absolute path to relative path 2022-07-16 17:58:52 +09:00
Nobuyoshi Nakada c093e7d645
Avoid to symlink under symlink 2022-07-16 16:38:03 +09:00
Nobuyoshi Nakada 5101671cbc
Disable parallel built in test-bundled-gems 2022-07-16 15:28:05 +09:00
Nobuyoshi Nakada 78d2be69b5
Move copying/linking extra files to Makefile so removed by `clean` 2022-07-16 10:11:42 +09:00
Peter Zhu 7424ea184f Implement Objects on VWA
This commit implements Objects on Variable Width Allocation. This allows
Objects with more ivars to be embedded (i.e. contents directly follow the
object header) which improves performance through better cache locality.
2022-07-15 09:21:07 -04:00
Nobuyoshi Nakada 9d900620ca Set `GEM_PATH` environment variable in runruby.rb 2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada 416cba90c1 Try to install also gemspec files under gem directories
Gemspec files having extension libraries are placed under each gem
directories now.
2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada a2c66f52f4 Make dependency-free gemspec files
The default gems have not been installed yet in the build directory,
bundled gems depending on them can not work.  As those dependencies
should be usable there even without rubygems, make temporary gemspec
files without the dependencies, and use them in the build directory.
2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada e1a4e44f14 Extract gemspec files to each gem directories
Since extension libraries can not be built in the source directory,
rubygems warns gems have extension libraries as the extensions are not
built.  To order to suppress this warnings, extract such gemspec files
under each gem directories instead of the common `specifications`
directory.
2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada d5c5fcb80a
Bundled gem extensions are out of scope of update-deps 2022-07-13 22:14:30 +09:00
Hiroshi SHIBATA 437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
Nobuyoshi Nakada 1150a54afe
Use `File::PATH_SEPARATOR` for the portability 2022-07-09 19:00:56 +09:00
Nobuyoshi Nakada 67e54ce408
Fallback `mkdir_p` to `as_mkdir_p`
Assume `mkdir -p` to be race-free on recent systems.
And we do not provide install-sh anyway.
2022-07-07 15:06:10 +09:00
Nobuyoshi Nakada 5921bfc7ce
Add `--stdout-on-failure`, the reverse of `--stderr-on-failure` 2022-07-05 14:40:19 +09:00
Nobuyoshi Nakada 1b34bd07c1
Separate failed output option
It is unrelated to `GlobOption` at all.
2022-07-05 14:40:19 +09:00
Nobuyoshi Nakada 841521b7c1
Adjust indent [ci skip] 2022-06-30 10:50:31 +09:00
Aaron Patterson 8d157bc806 Move function to `static inline` so we don't have leaked globals
This function shouldn't leak and is only needed during instruction
assembly
2022-06-29 16:21:48 -07:00
Nobuyoshi Nakada f159bbd17d
Prevent accidental use of assert_raises 2022-06-25 19:09:06 +09:00
David Rodríguez 12a5fa408b Sync RubyGems & Bundler with upstream repo 2022-06-24 10:52:02 +09:00
Nobuyoshi Nakada 7fd51c0241
vcs.rb: ignore configuration files get rid of aliases [ci skip] 2022-06-22 09:33:25 +09:00
Nobuyoshi Nakada bc77cda8fd
vcs.rb: just one log to check if `--date` option works [ci skip] 2022-06-22 09:32:01 +09:00
Nobuyoshi Nakada 0dcd25b711
vcs.rb: show diagnostic/progressing messages when debugging [ci skip] 2022-06-22 09:31:19 +09:00
Alan Wu 4b7c4bb92e tool/extlibs.rb: Use Exception#message for older rubies
This script runs with BASERUBY, which can be as old as 2.2.x.
Exception#full_message is new in 2.5.0.

I saw a NoMethodError on the AppVeyor CI where BASERUBY is 2.4.6:
https://ci.appveyor.com/project/ruby/ruby/builds/43870654/job/kae4uo2xbhuhqmdw#L121
2022-06-17 18:13:19 -04:00
Nobuyoshi Nakada 983f2688db
Hack to avoid leak checker 2022-05-25 18:48:01 +09:00
Nobuyoshi Nakada 78785fb990 [ruby/date] Constify gperf-generated table
https://github.com/ruby/date/commit/6d7ab08ffc
2022-05-24 17:23:42 +09:00
Takashi Kokubun ead96e7b44
Rename test_jit to test_mjit
to avoid confusion with YJIT
2022-05-20 21:32:55 -07:00
Jun Aruga dccfff943c Add `make test-annocheck` to detect security issues.
* Note that as the annocheck binary package is not available on Ubuntu, and it
  is working in progress in Debian, the script uses Fedora container, and
  it requires docker or podman command.
  https://www.debian.org/devel/wnpp/itp.en.html
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926470
* .github/workflows/compilers.yml: Add "gcc-11 annocheck" case.
  To pass the CI, set `TEST_ANNOCHECK_OPTS: "--skip-pie --skip-notes"` for now.
  See <https://bugs.ruby-lang.org/issues/18061>.
* Skip MJIT tests in case of annocheck case.
  The MJIT tests fail in the annocheck case.
  See <https://bugs.ruby-lang.org/issues/18781>.
2022-05-16 10:10:16 +02:00
Kazuhiro NISHIYAMA 2d1032075a
Stop `build_extensions` when DESTDIR set
Try to fix `make install without root privilege` failures on snapshot CIs.

example: https://github.com/ruby/actions/actions/runs/2315349280
2022-05-13 08:44:17 +09:00
Nobuyoshi Nakada c7d2247e35
Honor --with-thread option to enable pthread 2022-05-10 09:24:28 +09:00
Alan Wu b989c7c6ac
[DOC] Move :nodoc: so rdoc finds `RbConfig.ruby`
Rdoc [build] of `master` did not have this method but the reference manual [did].

[build]: https://docs.ruby-lang.org/en/master/RbConfig.html
[did]: https://docs.ruby-lang.org/ja/master/class/RbConfig.html#S_RUBY
2022-04-25 14:28:39 -04:00
Alan Wu 79fa27acc4 rbinstall: Also do `Gem.ruby` patching for unpacked bundled gems
Pointing `Gem.ruby` to the newly installed ruby gives mkmf the right
inputs to build extensions in bundled gems. Previously, this patching
was only done for compressed bundled gems.

This patch also prevents `tool/fake.rb` from propagating to the child
process running mkmf for the native extension. The way `tool/fake.rb`
changes mkmf variables using `Kernel#trace_var` created spooky action at
a distance which made debugging difficult.

AppVeyor Windows CI started to fail starting with
8a3663789c because it enabled extension
building for bundled gems on mswin. This patch should address the CI
failures.
2022-04-22 16:21:48 -04:00
Hiroshi SHIBATA c506ddac6c
Added assert_true and assert_false same as test-unit gem 2022-04-20 14:13:10 +09:00
Nobuyoshi Nakada a3ef0746ce
Extract `pipe_readlines` method which reads from the pipeline 2022-04-16 17:13:24 +09:00
Nobuyoshi Nakada b09e96341e
Simplify the condition expression to ignore commits 2022-04-16 16:45:46 +09:00
Nobuyoshi Nakada 492185e39c
Do not import any files under rakelib 2022-04-16 16:45:11 +09:00
Nobuyoshi Nakada 8a3663789c
Fix bundled gems installation when relative loading 2022-04-16 09:03:51 +09:00
Kazuhiro NISHIYAMA 7e4ac434b9
Skip build extensions again on cross compiling too 2022-04-13 14:40:24 +09:00
Kazuhiro NISHIYAMA 3112475469
Skip build extensions again on mswin and mingw 2022-04-13 13:40:57 +09:00
Kazuhiro NISHIYAMA 4246e102d4
Enabled to build extensions with the bundled gems again
cbb115213c
5c1b76a3a5
2022-04-13 11:09:23 +09:00
Nobuyoshi Nakada 5c1b76a3a5 Install built gem extension binaries 2022-04-07 09:47:10 +09:00
Nobuyoshi Nakada bb0a22a8c0 Obey spec file locations to rubygems 2022-04-07 09:47:10 +09:00
Alan Wu 21c8b9eb99 Copyedit parallel test harness crash message
Mea culpa.

Co-authored-by: Kaíque Kandy Koga <kaiquekandykoga@gmail.com>
2022-04-06 18:39:27 -04:00
Alan Wu 399ef463f7 Copyedit parallel test harness crash message 2022-04-06 18:11:43 -04:00
Kazuhiro NISHIYAMA d9c6f8d45c
Try to fix NoMethodError on slow environments
```
  1) Failure:
TestParallel::TestParallel#test_hungup [/home/user/ruby/tool/test/testunit/test_parallel.rb:215]:
Expected /^Retrying hung up testcases\.+$/ to match "Run options: \n" +
"  --seed=43403\n" +
"  --ruby\n" +
"  \"./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems\"\n" +
"  -j\n" +
"  t1\n" +
"  --worker-timeout=1\n" +
"\n" +
"# Running tests:\n" +
"\n" +
"/home/user/ruby/tool/lib/test/unit.rb:687:in `block in _run_parallel': undefined method `<' for nil:NilClass (NoMethodError)\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:538:in `block in quit_workers'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:537:in `reject!'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:537:in `quit_workers'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:687:in `_run_parallel'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:810:in `_run_suites'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:849:in `_run_suites'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1479:in `_run_anything'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1263:in `_run_anything'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1654:in `run_tests'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1641:in `block in _run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1640:in `each'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1640:in `_run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1682:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1034:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:882:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:154:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1761:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1765:in `run'\n" +
"\tfrom /home/user/ruby/tool/test/testunit/tests_for_parallel/runner.rb:14:in `<main>'\n".
```
2022-04-05 19:23:38 +09:00
Benoit Daloze 4f25207e72 Use latest RSpec to get rspec-mocks ruby2_keywords fix 2022-04-05 11:42:02 +02:00
Kevin Newton 6068da8937 Finer-grained constant cache invalidation (take 2)
This commit reintroduces finer-grained constant cache invalidation.
After 8008fb7 got merged, it was causing issues on token-threaded
builds (such as on Windows).

The issue was that when you're iterating through instruction sequences
and using the translator functions to get back the instruction structs,
you're either using `rb_vm_insn_null_translator` or
`rb_vm_insn_addr2insn2` depending if it's a direct-threading build.
`rb_vm_insn_addr2insn2` does some normalization to always return to
you the non-trace version of whatever instruction you're looking at.
`rb_vm_insn_null_translator` does not do that normalization.

This means that when you're looping through the instructions if you're
trying to do an opcode comparison, it can change depending on the type
of threading that you're using. This can be very confusing. So, this
commit creates a new translator function
`rb_vm_insn_normalizing_translator` to always return the non-trace
version so that opcode comparisons don't have to worry about different
configurations.

[Feature #18589]
2022-04-01 14:48:22 -04:00
Nobuyoshi Nakada 663c297e34
Remove CI configuration files from extracted bundled gems 2022-03-31 10:49:56 +09:00
Nobuyoshi Nakada 8d27d00af5
Fix locations of the second argument 2022-03-30 14:38:33 +09:00
Nobuyoshi Nakada 5568cd5a55
Fix a missing comma 2022-03-28 17:02:02 +09:00
Nobuyoshi Nakada 152bb3c0b4
Use m4 comments outside macros in m4 files 2022-03-28 17:01:28 +09:00
Nobuyoshi Nakada 2cb3efffcf
Extract RUBY_REQUIRE_FUNCS 2022-03-28 16:56:15 +09:00
Nobuyoshi Nakada 69967ee64e
Revert "Finer-grained inline constant cache invalidation"
This reverts commits for [Feature #18589]:
* 8008fb7352
  "Update formatting per feedback"
* 8f6eaca2e1
  "Delete ID from constant cache table if it becomes empty on ISEQ free"
* 629908586b
  "Finer-grained inline constant cache invalidation"

MSWin builds on AppVeyor have been crashing since the merger.
2022-03-25 20:29:09 +09:00
Kevin Newton 629908586b Finer-grained inline constant cache invalidation
Current behavior - caches depend on a global counter. All constant mutations cause caches to be invalidated.

```ruby
class A
  B = 1
end

def foo
  A::B # inline cache depends on global counter
end

foo # populate inline cache
foo # hit inline cache

C = 1 # global counter increments, all caches are invalidated

foo # misses inline cache due to `C = 1`
```

Proposed behavior - caches depend on name components. Only constant mutations with corresponding names will invalidate the cache.

```ruby
class A
  B = 1
end

def foo
  A::B # inline cache depends constants named "A" and "B"
end

foo # populate inline cache
foo # hit inline cache

C = 1 # caches that depend on the name "C" are invalidated

foo # hits inline cache because IC only depends on "A" and "B"
```

Examples of breaking the new cache:

```ruby
module C
  # Breaks `foo` cache because "A" constant is set and the cache in foo depends
  # on "A" and "B"
  class A; end
end

B = 1
```

We expect the new cache scheme to be invalidated less often because names aren't frequently reused. With the cache being invalidated less, we can rely on its stability more to keep our constant references fast and reduce the need to throw away generated code in YJIT.
2022-03-24 09:14:38 -07:00
Peter Zhu 5f10bd634f Add ISEQ_BODY macro
Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using
this macro will make it easier for us to change the allocation strategy
of rb_iseq_constant_body when using Variable Width Allocation.
2022-03-24 10:03:51 -04:00
Nobuyoshi Nakada 1bb9e42fa5 extlibs.rb: Add fallback `Colorize`
To get rid of an unnecessary dependency for the case using
in other repositories.
2022-03-24 13:16:13 +09:00
Nobuyoshi Nakada 9ed6875f93 extlibs.rb: Enclose `Vars` in `ExtLibs` class
To get rid of an unnecessary top-level constant for the case using
as a library.
2022-03-24 13:16:13 +09:00
Nobuyoshi Nakada 247f8ecfa4 extlibs.rb: Extract ExtLibs#process
For the case using this script as a library.
- `ExtLibs#process` reads and processes an extlibs file.
- `ExtLibs#process_under` processes all extlibs files under the
  given directory.
- `Extlibs.run` parses `ARGV` and lets an instance process the
  directories.
2022-03-24 13:16:13 +09:00
Hiroshi SHIBATA 0024a76ea0
Ignore pre-release for sync target on sync_default_gems 2022-03-10 13:35:21 +09:00
Hiroshi SHIBATA 1adc7aa630
Added release option to sync only released version of the default gems 2022-03-08 21:08:46 +09:00
Hiroshi SHIBATA ff3d7b720e Merge RubyGems and Bundler master 2022-02-28 11:39:20 +09:00
Nobuyoshi Nakada 7f4345639b
fake.rb: Set prefix to `$topdir`
Not to refer outside the top build directory from rbconfig.
2022-02-27 21:58:59 +09:00
Nobuyoshi Nakada 8780f15fd7 [ruby/date] Use `assert_deprecated_warn`
https://github.com/ruby/date/commit/c55004715a
2022-02-25 20:39:47 +09:00
Peter Zhu 9bd4b2ab14 Add ABI version to RUBY_LIB_VERSION
This commit adds the ABI version as build metadata to
RUBY_LIB_VERSION. This will ensure that gems are installed in a path
with the ABI version.
2022-02-24 09:18:01 -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
Nobuyoshi Nakada 2ae35ad766 RUBY_REPLACE_TYPE: check if the target type is a pointer 2022-02-19 15:33:15 +09:00
NARUSE, Yui 542a38f619 gen-mail.rb: support markdown file path 2022-02-18 21:44:22 +09:00
Koichi Sasada 00c7a0d491 fix parallel test timeout retrying
On the parallel test, workers can be killed because of timeout
and the information for the retrying can be inconsistent.
This patch will skip if the inconsistency is found and report
as an error.

http://ci.rvm.jp/results/trunk-asserts@phosphorus-docker/3834082
2022-02-16 17:57:04 +09:00
Jemma Issroff 2913a2f5cf Treat TS_ICVARC cache as separate from TS_IVC cache 2022-02-02 09:20:34 -08:00
David Rodríguez 517d7c3221 Sync latest Bundler & RubyGems 2022-02-01 08:09:23 +09:00
Jesse Chavez 99d02caed3 [ruby/logger] Fix log rotation inter-process lock failed.
Issue only occurs in JRuby 9.3.0.0 and Windows and the full
console output is:

log rotation inter-process lock failed. D:\log.txt -> D:\log.txt.0: The process cannot access the file because it is being used by another process.
log writing failed. closed stream
log writing failed. closed stream
...

https://github.com/ruby/logger/commit/19fc734638
2022-01-27 12:33:06 +09:00
Koichi Sasada cac6fe9023 add `--stderr-on-failure` option to test-all
Now all failure messages are printed to stdout. This option
makes all failure messages printed into stderr.
2022-01-26 09:56:09 +09:00
David Rodríguez de678cd51e
[ruby/pathname] Officially drop support for ruby 2.6 or older
The gem doesn't even install on old rubies, but since the gemspec claims
it's supported, `gem install pathname` will try to install it and print
an error.

This commit doesn't fix the above issue. The only way to fix it would be
to restore support and release a new version that actually supports old
rubies. However, such a change has been proposed and ignored for a long
time.

So this issue proposes to leave that broken but at least bring the
gemspec manifest and the CI matrix in sync to hopefully avoid this issue
from happening again in the future.

https://github.com/ruby/pathname/commit/3ee010b538
2022-01-25 08:50:31 +09:00
Nobuyoshi Nakada 355bc37196
Reuse the default `AC_LANG_PROGRAM(C)` definition 2022-01-23 01:02:11 +09:00
Nobuyoshi Nakada ad150a1459
Override `AC_C_PROGRAM` on old autoconf
Autoconf 2.69 fails to detect `-Werror=old-style-definition` due
to the old style definition of `main`.
2022-01-22 20:13:46 +09:00
Koichi Sasada 374904b25f remain `RUBY_ON_BUG` for child processes.
`RUBY_ON_BUG` is useful for child processes created by the test
process.
2022-01-19 23:17:14 +09:00
Hiroshi SHIBATA d22511fd75 Merge rubygems/rubygems HEAD.
Picked at 12aeef6ba9a3be0022be9934c1a3e4c46a03ed3a
2022-01-19 15:01:44 +09:00
Yuta Saito 420622b5a7 [wasm] add no thread variant for freestanding environment
This implementation does nothing around preemptive context switching
because there is no native thread.
2022-01-19 11:19:06 +09:00
Yuta Saito 65f95f26ff [wasm] add asyncify based setjmp, fiber, register scan emulation
configure.ac: setup build tools and register objects

main.c: wrap main with rb_wasm_rt_start to handle asyncify unwinds

tool/m4/ruby_wasm_tools.m4: setup default command based on WASI_SDK_PATH
environment variable. checks wasm-opt which is used for asyncify.

tool/wasm-clangw wasm/wasm-opt: a clang wrapper which replaces real
wasm-opt with do-nothing wasm-opt to avoid misoptimization before
asyncify. asyncify is performed at POSTLINK, but clang linker driver
tries to run optimization by wasm-opt unconditionally. inlining pass
at wasm level breaks asyncify's assumption, so should not optimize
before POSTLIK.

wasm/GNUmakefile.in: wasm specific rules to compile objects
2022-01-19 11:19:06 +09:00
Hiroshi SHIBATA 3515867381 Removed skip alias in test suite 2022-01-17 10:39:24 +09:00
Nobuyoshi Nakada 56b45e8c8e Let testunit use omit or pend instead of skip 2022-01-16 21:35:09 +09:00
Nobuyoshi Nakada d3940a533d
Fetch the unmerged revision to test of bundled gems 2022-01-14 14:54:29 +09:00
Yuta Saito e554b17c60 tool/rbinstall.rb: instal ruby.wasm produced by Emscripten 2022-01-06 18:14:24 +09:00
Hiroshi SHIBATA d6311cb1ca Track RubyGems 3.4.0dev and Bundler 2.4.0dev 2021-12-27 10:45:36 +09:00
NARUSE, Yui da4d6dc1ec tag's prefix is "v" 2021-12-25 22:19:02 +09:00
NARUSE, Yui 8325094177 Revert "Do not include external library sources into packages"
This reverts commit a042043487.
2021-12-25 21:22:02 +09:00
NARUSE, Yui 1cc02078e5 Revert "make-snapshot: add -extlibs option"
This reverts commit afa9d65d61.
It prevents installing libffi.
2021-12-25 21:01:37 +09:00
NARUSE, Yui 05faa36028 fix tool/format-release
Pass ruby directory path
2021-12-25 20:57:11 +09:00
Hiroshi SHIBATA da6a5e3ed1 Merge RubyGems-3.3.3 and Bundler-2.3.3 2021-12-25 07:40:52 +09:00
Nobuyoshi Nakada 083cf6a577
sync_default_gems.rb: Expand GH-xxxx style GitHub links [ci skip] 2021-12-24 14:34:14 +09:00
Nobuyoshi Nakada 097c4a2adf
sync_default_gems.rb: GitHub links at word boundary only [ci skip] 2021-12-24 14:27:03 +09:00
Hiroshi SHIBATA b0ad6cb371 Merge RubyGems-3.3.2 and Bundler-2.3.2 2021-12-24 10:35:31 +09:00
Hiroshi SHIBATA fb1ab27f53 Merge RubyGems-3.3.1 and Bundler-2.3.1 2021-12-23 09:44:45 +09:00
Hiroshi SHIBATA 69dc2ea465 Merge RubyGems-3.3.0 and Bundler-2.3.0 2021-12-21 15:27:05 +09:00
Yuta Saito 3c7e95966d rbinstall.rb: install ext only when it's configured [Bug #18414] 2021-12-21 15:14:54 +09:00
Nobuyoshi Nakada c57ac4c6e0 Fix location of extensions in bundled gems when static-linked-ext
Install bundled gem extension files to the gem extension directory
under DESTDIR, when static-linked-ext as well as non-static case.
2021-12-21 02:01:57 +09:00
Yuta Saito f1a02ebfb9 Install gemspec even though no .rb and no .so
When building with --with-static-linked-ext, some exts without rb file
doesn't produce neither .so or .rb under .ext/common. Therefore, change
rbinstall.rb to install gemspec even if there is no .so or .rb for that
case.
2021-12-16 16:17:41 +09:00
Hiroshi SHIBATA 7e084ed707 Merge RubyGems and Bundler master
Merge from 793ad95ecb
2021-12-15 18:05:18 +09:00
Takashi Kokubun 1a63468831
Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
Kazuhiro NISHIYAMA 10eda60e8b
Merge to one regexp 2021-12-14 12:19:44 +09:00
Hiroshi SHIBATA b06e37e242
Followed up f5d80c26d4 for sync_default_gems.rb 2021-12-09 19:33:47 +09:00
Nobuyoshi Nakada e563c6068e
sync_default_gems.rb: convert commit hashes to github URLs [ci skip] 2021-12-06 14:18:01 +09:00
Alan Wu a785e6c356 Make `leaf` const in VM generator
Assigning to `leaf` in insns.def would give undesirable results.
2021-12-05 11:06:05 -05:00
Nobuyoshi Nakada 60fc8dda64
update-bundled_gems.rb: Fix typo and version comparison 2021-12-02 21:13:02 +09:00
Hiroshi SHIBATA 0b53a8895f
Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbd 2021-12-01 11:00:10 +09:00
Nobuyoshi Nakada 438220f063
Let pretty_inspect work once at first
For older pp.rb which did not need io/console, and dealing with
`LoadError`.
2021-11-30 14:16:33 +09:00
Nobuyoshi Nakada d400c44a55
Load io/console earlier
Something goes wrong at loading libraries inside `mu_pp` in the
test overriding `Class.inherited`.
2021-11-30 13:15:22 +09:00
Nobuyoshi Nakada d20a120b03
Recent systems prohibit symlink for relative loading 2021-11-30 12:40:12 +09:00
Nobuyoshi Nakada 4acc7563a1 Consider environment variable case-insensitiveness 2021-11-29 23:00:20 +09:00
Nobuyoshi Nakada 6586783508
Move win32ole.gemspec to the proper place 2021-11-26 11:32:38 +09:00
Nobuyoshi Nakada c8da3b95e7
Add win32ole to sync_default_gems.rb 2021-11-25 23:53:15 +09:00
Alan Wu 3d19c2900e No need to link and install .pdb anymore
With /Z7, no .pdb file is generated, so trying to link it during build
fails on my machine even though it's okay on CI.

By the way, in my local testing, no .pdb is generated in cwd at runtime
even without the /Fd option. I guess we can pass it just in case.
2021-11-24 23:45:57 +09:00
Hiroshi SHIBATA 84fdaaab46
Ignore LUCENSE files of standard libraries for sync target 2021-11-16 20:11:34 +09:00
Hiroshi SHIBATA cc3afdb165
Added LICENSE entry of vendored net-http-persistent to LEGAL 2021-11-16 20:07:30 +09:00
Hiroshi SHIBATA ef11414b1f
Added LICENSE entry of vendored connection_pool to LEGAL 2021-11-16 20:05:07 +09:00
Hiroshi SHIBATA 9a76072873
Added LICENSE entry of vendored molinillo to LEGAL 2021-11-16 19:51:06 +09:00
Hiroshi SHIBATA 1ff7b9cac4
Added LICENSE entry of vendored thor to LEGAL 2021-11-16 19:48:32 +09:00
Hiroshi SHIBATA 018266ca38
Merge digest-3.0.3.pre3 and efd76821b8 2021-11-16 19:42:20 +09:00
NARUSE, Yui 7a816b5fc8 Support preview release
Also add tag property.
2021-11-16 12:34:59 +09:00
Hiroshi SHIBATA cc50e57bf5
Relax extention name for macOS 2021-11-15 16:52:10 +09:00
Koichi Sasada b1b73936c1 `Primitive.mandatory_only?` for fast path
Compare with the C methods, A built-in methods written in Ruby is
slower if only mandatory parameters are given because it needs to
check the argumens and fill default values for optional and keyword
parameters (C methods can check the number of parameters with `argc`,
so there are no overhead). Passing mandatory arguments are common
(optional arguments are exceptional, in many cases) so it is important
to provide the fast path for such common cases.

`Primitive.mandatory_only?` is a special builtin function used with
`if` expression like that:

```ruby
  def self.at(time, subsec = false, unit = :microsecond, in: nil)
    if Primitive.mandatory_only?
      Primitive.time_s_at1(time)
    else
      Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in))
    end
  end
```

and it makes two ISeq,

```
  def self.at(time, subsec = false, unit = :microsecond, in: nil)
    Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in))
  end

  def self.at(time)
    Primitive.time_s_at1(time)
  end
```

and (2) is pointed by (1). Note that `Primitive.mandatory_only?`
should be used only in a condition of an `if` statement and the
`if` statement should be equal to the methdo body (you can not
put any expression before and after the `if` statement).

A method entry with `mandatory_only?` (`Time.at` on the above case)
is marked as `iseq_overload`. When the method will be dispatch only
with mandatory arguments (`Time.at(0)` for example), make another
method entry with ISeq (2) as mandatory only method entry and it
will be cached in an inline method cache.

The idea is similar discussed in https://bugs.ruby-lang.org/issues/16254
but it only checks mandatory parameters or more, because many cases
only mandatory parameters are given. If we find other cases (optional
or keyword parameters are used frequently and it hurts performance),
we can extend the feature.
2021-11-15 15:58:56 +09:00
Soutaro Matsumoto dee2e9b2be
Bundle RBS 1.7.0 (#5105)
* Bundle RBS 1.7.0

* tool/test-bundled-gems.rb: Use a correct path to Check if rbs is built

* tool/test-bundled-gems.rb: lib/rbs/parse.y is no longer created

Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
2021-11-12 02:01:53 +09:00
Nobuyoshi Nakada cc33d07f46
Disable experimental warnings in test/runner.rb 2021-11-10 17:42:09 +09:00
Samuel Williams 81d0ce7e97 Mark IO::Buffer as experimental. 2021-11-10 19:21:05 +13:00
Nobuyoshi Nakada 3ff0a0b40c
Filter method names only if filtering method name only
If sole `filter` option doesn't seem including test case name,
match with method name only.
And if the filter is a Regexp or String, it never matches method
name symbols.
2021-11-09 15:20:44 +09:00
Yusuke Endoh efe7e6e949 Bundle rbs 1.7.0.beta.5 2021-11-09 03:32:46 +09:00
Yusuke Endoh 30886be9f4 Skip bundled gem with an extension library under with-static-linked-ext
.. mainly to fix emscripten CI

http://rubyci.s3.amazonaws.com/crossruby/crossruby-master-wasm64_emscripten/log/20211104T024621Z.fail.html.gz
2021-11-05 09:34:46 +09:00
Yuta Saito 4e0747a8a2 Allow the thread-model to be switched by configure option
This change adds --with-thread=IMPL option to the configure. If not
supplied, default implementation for each platform will be used.
2021-10-30 10:18:33 +09:00
Yuta Saito 8590d61ea9 Select including thread impl file at config time 2021-10-30 10:18:33 +09:00
Yuta Saito ccda26efe7 Split thread-model config into another ac file
This is a first step to allow the thread-model implementation to be
switched by configure's option
2021-10-30 10:18:33 +09:00
Nobuyoshi Nakada 99c60d4b25 Get rid of exponential backtracks found by CodeQL
Since these regexps are used at build/installation, they are not
vulnerabilities.
2021-10-30 02:22:42 +09:00
Yusuke Endoh c1228f833c vm_core.h: Avoid unaligned access to ic_serial on 32-bit machine
This caused Bus error on 32 bit Solaris
2021-10-29 10:57:46 +09:00
Nobuyoshi Nakada e76e1d3ce4
Downloader: retry when RFC 2616 noncompliant dates [ci skip]
zlib.net rarely returns the current time in RFC 2616 noncompliant
format in the response header, and the checksum does not match in
that case (maybe creating the tarball on the fly?).
2021-10-28 17:42:36 +09:00
Vít Ondruch 5086c25f60 Properly exclude test cases.
Lets consider the following scenario:

~~~
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):001:0> p suite
OpenSSL::TestEC
=> OpenSSL::TestEC

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):002:0> p all_test_methods
["test_ECPrivateKey", "test_ECPrivateKey_encrypted", "test_PUBKEY", "test_check_key", "test_derive_key", "test_dh_compute_key", "test_dsa_sign_asn1_FIPS186_3", "test_ec_group", "test_ec_key", "test_ec_point", "test_ec_point_add", "test_ec_point_mul", "test_generate", "test_marshal", "test_sign_verify", "test_sign_verify_raw"]
=>
["test_ECPrivateKey",
 "test_ECPrivateKey_encrypted",
 "test_PUBKEY",
 "test_check_key",
 "test_derive_key",
 "test_dh_compute_key",
 "test_dsa_sign_asn1_FIPS186_3",
 "test_ec_group",
 "test_ec_key",
 "test_ec_point",
 "test_ec_point_add",
 "test_ec_point_mul",
 "test_generate",
 "test_marshal",
 "test_sign_verify",
 "test_sign_verify_raw"]

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):003:0> p filter
/\A(?=.*)(?!.*(?-mix:(?-mix:memory_leak)|(?-mix:OpenSSL::TestEC.test_check_key)))/
=> /\A(?=.*)(?!.*(?-mix:(?-mix:memory_leak)|(?-mix:OpenSSL::TestEC.test_check_key)))/

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):004:0> method = "test_check_key"
=> "test_check_key"
~~~

The intention here is to exclude the `test_check_key` test case.
Unfortunately this does not work as expected, because the negative filter
is never checked:

~~~
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):005:0> filter === method
=> true

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):006:0> filter === "#{suite}##{method}"
=> false

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):007:0> filter === method || filter === "#{suite}##{method}"
=> true
~~~

Therefore always filter against the fully qualified method name
`#{suite}##{method}`, which should provide the expected result.

However, if plain string filter is used, keep checking also only the
method name.

This resolves [Bug #16936].
2021-10-27 19:56:19 +09:00
Koichi Sasada 8a49c7e481 Revert "introduce check code for mysterious EBADF"
This reverts commit 7864efa105.
2021-10-26 17:06:57 +09:00
Koichi Sasada d1424f7f7e Revert "check other IO#close calls"
This reverts commit a1c4cab11d.
2021-10-26 17:06:57 +09:00
Koichi Sasada a1c4cab11d check other IO#close calls
http://ci.rvm.jp/results/trunk@ruby-iga/3690333
> tool/lib/test/unit/parallel.rb:68:in `close': Bad file descriptor (Errno::EBADF)
2021-10-25 17:38:23 +09:00
Koichi Sasada 7864efa105 introduce check code for mysterious EBADF
parallel test randomly failed with EBADF.
This patch checks wich suite causes this error.

ex) http://ci.rvm.jp/results/trunk@ruby-iga/3690219

```
/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:88:in `close': Bad file descriptor (Errno::EBADF)
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:88:in `ensure in _run_suite'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:89:in `_run_suite'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:30:in `block in _run_suites'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:29:in `map'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:29:in `_run_suites'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:128:in `run'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:211:in `<main>'
```
2021-10-25 15:47:09 +09:00
Alan Wu 7c08538aa3 Cleanup diff against upstream. Add comments
I did a `git diff --stat` against upstream and looked at all the files
that are outside of YJIT to come up with these minor changes.
2021-10-20 18:19:42 -04:00
Aaron Patterson 41f405c486 Remove the scraper
Now that we're using the jit function entry point, we don't need the
scraper.  Thank you for your service, scraper. ❤️
2021-10-20 18:19:38 -04:00
Aaron Patterson 30f20d7c38 Remove some MicroJIT vestiges
Just happened to run across this, so lets fix them
2021-10-20 18:19:36 -04:00
Alan Wu 5d834bcf9f YJIT: lazy polymorphic getinstancevariable
Lazily compile out a chain of checks for different known classes and
whether `self` embeds its ivars or not.

* Remove trailing whitespaces

* Get proper addresss in Capstone disassembly

* Lowercase address in Capstone disassembly

Capstone uses lowercase for jump targets in generated listings. Let's
match it.

* Use the same successor in getivar guard chains

Cuts down on duplication

* Address reviews

* Fix copypasta error

* Add a comment
2021-10-20 18:19:31 -04:00
Maxime Chevalier-Boisvert fe3bd57007 Remove trailing whitespaces 2021-10-20 18:19:31 -04:00
Jose Narvaez 4e2eb7695e Yet Another Ruby JIT!
Renaming uJIT to YJIT. AKA s/ujit/yjit/g.
2021-10-20 18:19:31 -04:00
Maxime Chevalier-Boisvert 2e561ff255 Restore interpreter regs in ujit hook. Implement leave bytecode. 2021-10-20 18:19:28 -04:00
Alan Wu 3c7251b41b Tally instructions when taking side exists for --ujit-stats
shopify/ruby#29

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2021-10-20 18:19:28 -04:00
Maxime Chevalier-Boisvert e4c65ec49c Refactor uJIT code into more files for readability 2021-10-20 18:19:26 -04:00
Alan Wu b75169a440 Fix typo 2021-10-20 18:19:26 -04:00
Alan Wu 5f9beb9b1b Include disassembly in MicroJIT scraper output 2021-10-20 18:19:26 -04:00
Alan Wu 11c1daea17 Add to the MicroJIT scraper an example that passes ec 2021-10-20 18:19:25 -04:00
Alan Wu 7662653b4c Fix compilation for OPT_THREADED_CODE=2 2021-10-20 18:19:24 -04:00
Alan Wu 2790428e55 Zero sized array are not standard C 2021-10-20 18:19:24 -04:00
Alan Wu a3e58f4df8 Compile with MicroJIT disabled when scrape fails
This is just so we can build successfully on -O0 and other cases that
are not supported by the code scraper.
2021-10-20 18:19:24 -04:00
Alan Wu f3c961f273 endbr64 is fine 2021-10-20 18:19:24 -04:00
Alan Wu 453218b272 Preliminary GNU/Linux support for code scraper
Let's see if this works on CI
2021-10-20 18:19:24 -04:00
Alan Wu 3d87eadf16 Refactor ujit_examples.h generator. Remove dwarfdump dependency 2021-10-20 18:19:24 -04:00
Maxime Chevalier-Boisvert 3739588811 Remove PC argument from ujit instructions 2021-10-20 18:19:23 -04:00
Alan Wu 16c5ce863c Yeah, this actually works! 2021-10-20 18:19:22 -04:00
Alan Wu cec197696f Add example handler for ujit and scrape it from vm.o 2021-10-20 18:19:22 -04:00
Nobuyoshi Nakada 6c74976aef Remove `Test::Unit::TestCase.make_my_diffs_pretty!`
`Test::Unit::CoreAssertions#mu_pp` is defined always using
`pretty_inspect`.
2021-10-18 17:36:06 +09:00
Nobuyoshi Nakada d1b8544b4d Remove `Test::Unit::Assertions#exception_details`
Never used since fa0f3eff22.
2021-10-18 17:36:06 +09:00
Nobuyoshi Nakada c7eac1be51
Retry hung up tests verbosely 2021-10-17 22:40:31 +09:00
Nobuyoshi Nakada 13716898df Retry hung tests after parallel runs 2021-10-17 16:33:58 +09:00
Nobuyoshi Nakada 478187e9a3 Timeout parallel test worker processes 2021-10-17 16:33:58 +09:00
Nobuyoshi Nakada 5de6e25144
Replace unpack with unpack1 2021-10-17 00:48:45 +09:00
Nobuyoshi Nakada 855db8e9ce
Use `__dir__` 2021-10-15 19:42:39 +09:00
Nobuyoshi Nakada 370fff98ce
Prefer `require_relative` 2021-10-15 18:47:25 +09:00
Nobuyoshi Nakada 679054208e
Use `__dir__` 2021-10-15 15:07:31 +09:00
Hiroshi SHIBATA 9e86a60306
Removed redundant digest namespace 2021-10-14 14:07:50 +09:00
Hiroshi SHIBATA 3265af2f9e
separate pure ruby location under the digest/* extensions 2021-10-14 13:31:45 +09:00
Hiroshi SHIBATA 13772caee2
Move pure ruby files under the ext/gemname/lib directory. 2021-10-14 13:23:45 +09:00
Pavel Rosický 94882df3a2
[ruby/digest] jruby support
https://github.com/ruby/digest/commit/2e9dc14693
2021-10-12 20:46:13 +09:00
Takashi Kokubun b5f0e20936
Add comments in sync_default_gems.rb
to ease the maintenance of ruby-commit-hook/bin/update-default-gem.sh
2021-10-10 23:49:15 -07:00
Takashi Kokubun 69cedee2a6
chmod +x tool/sync_default_gems.rb
I'm too lazy to start the command with `ruby`.
2021-10-10 23:38:51 -07:00
Nobuyoshi Nakada cec61d16d2
Run JIT tests first when random order instead of no-sort 2021-10-10 19:23:52 +09:00
Nobuyoshi Nakada fb9ea391cf
Default the test order to random 2021-10-10 18:30:33 +09:00
Nobuyoshi Nakada c423cc932e
Refactor `Test::Unit::CoreAssertions#assert_nothing_raised`
* Separate exception classes to be rescued or reraised
* Use the filtered backtrace in the failure message
* Raise a new `AssertionFailedError` with the original backtrace
2021-10-09 18:14:21 +09:00
Nobuyoshi Nakada fc913ad21d
Exclude also core_assertions.rb from backtraces 2021-10-09 16:17:37 +09:00
Nobuyoshi Nakada 3932227d96
Unify `Test::Unit::Assertions#message`
Merge `Test::Unit::CoreAssertions#message`.
2021-10-09 16:17:01 +09:00
Nobuyoshi Nakada 489c22b17f
Let `Test::Unit::CoreAssertions::AllFailures#for` yield the key
Similar to `Test::Unit::CoreAssertions::AllFailures#foreach`.
2021-10-09 14:28:27 +09:00
OKURA Masafumi 7e506716d2
Newly generated gems require Ruby 2.6.0
In 2021, Ruby 2.5 and older are EOL.
We can set the default required Ruby version to 2.6.0 to
encourage people to use newer Ruby.
If the command is executed with old Ruby, it falls back to 2.3.0.
It's still possible to create a gem for older Ruby just by changing
two lines of code (one in gemspec and another is in rubocop.yml).
2021-10-09 09:07:47 +09:00
Nobuyoshi Nakada 7c98e673d7
Fix a typo since 688f2e1a89 2021-10-05 18:24:34 +09:00
Koichi Sasada bc96a45f12 introduce debug.gem
For the `test-bundled-gems`, make `debug.so` with extconf.rb and
`make` command directly because `rake-compiler` assume ruby is
installed (but `test-bundled-gems` can run without installation).
2021-10-05 02:07:33 +09:00
Hiroshi SHIBATA cbb115213c Enabled to build extensions with the bundled gems 2021-10-05 02:07:33 +09:00
Nobuyoshi Nakada b44c5187b4 Expose instruction information for debuggers [Feature #18026] 2021-10-04 09:43:09 -07:00
Nobuyoshi Nakada c4570acc86
Refactor ordering of tests
* Split the sorting types into classes.
* Apply the same sorting to method sorting under the parallel
  test.
2021-10-04 20:46:47 +09:00
Nobuyoshi Nakada 44b2e32fb6
Fix a typo 2021-10-04 20:44:38 +09:00
Nobuyoshi Nakada 3842e723da
Leave builddir absolute
So that rubygems installer will work to build extension gems.
2021-10-04 20:04:38 +09:00
Nobuyoshi Nakada 0ad3ed5e0e
Checks for CPU specific header on universal build 2021-10-01 20:30:10 +09:00
Nobuyoshi Nakada c7414f517f
Prefer `printf` like the recent autoconf 2021-10-01 20:30:10 +09:00
Hiroshi SHIBATA 83662f1d99
Removed needless rake and bundler files for rdoc 2021-09-28 16:13:45 +09:00
fedor dd78084ea6 .cirrus.yml: Add Cirrus CI for Arm64 tests.
Co-authored-by: fedor <fedor@cirruslabs.org>
2021-09-22 09:01:43 +02:00
Nobuyoshi Nakada 34d6720fee
Prohibit test method redefinition 2021-09-17 08:54:18 +09:00
Hiroshi SHIBATA 43f49b2d1c
Fixup 455978cd13 2021-09-13 21:15:36 +09:00
Hiroshi SHIBATA ec6f04c092
Use capture_output instead of capture_io 2021-09-13 21:14:42 +09:00
Hiroshi SHIBATA be04006c7d
Rename capture_io to capture_output and deprecate to use capture_io 2021-09-13 20:56:34 +09:00
Hiroshi SHIBATA 455978cd13
Removed unused mu_pp method 2021-09-13 20:41:03 +09:00
Hiroshi SHIBATA f5993331b2
Renamed skip to pend and prepared to deprecate skip method 2021-09-13 19:09:24 +09:00
Nobuyoshi Nakada aaa9805e7e
Add unique token to separated runner
Same as Test::Unit::CoreAssertions#assert_no_memory_leak.
2021-09-13 15:47:45 +09:00
Hiroshi SHIBATA dbdceb8a19 Removed workaround for test_order 2021-09-13 14:39:23 +09:00
Hiroshi SHIBATA 2982464a8e
Revert "Resolved conflict initializers"
This reverts commit 62db6e47b6.

  308183fffa is the correct solution
  about this.
2021-09-13 11:07:32 +09:00
Nobuyoshi Nakada c8a1e57af0
Downloader: accept some RFC 2616 noncompliant dates 2021-09-13 01:48:43 +09:00
Nobuyoshi Nakada bbd105c445
Exclude option_parser from Test::Unit::Runner#inspect 2021-09-12 03:51:19 +09:00
Nobuyoshi Nakada 308183fffa
Prepend the modules in Test::Unit
Needs to override Test::Unit::Runner#run, so that RunCount#run
runs which increments @@run_count.  Previously it worked because
these methods were inserted between Test::Unit::Runner#run and
MiniTest::Unit#run.
2021-09-12 03:45:58 +09:00
Hiroshi SHIBATA 8d0315a2bb
Removed unsed assertions for rubygems 2021-09-11 21:05:15 +09:00
Hiroshi SHIBATA d58e0ffc24
Removed unused alias for run_test 2021-09-11 20:35:18 +09:00
Hiroshi SHIBATA 64e056a4c5
Drop to Ruby 1.8 related code 2021-09-11 18:10:15 +09:00
Hiroshi SHIBATA a13ee1f33c
Removed rubinius support from test suite 2021-09-11 18:10:15 +09:00
Hiroshi SHIBATA aebd0a873e
Removed maglev related code because it's not active status now 2021-09-11 18:10:15 +09:00
Nobuyoshi Nakada 952806cdec
Update comments for minitest 2021-09-11 17:37:49 +09:00
Nobuyoshi Nakada cd83e716d0
Update an option message 2021-09-11 17:32:42 +09:00
Nobuyoshi Nakada 911f62e681
Directly alias orig_run_suite 2021-09-11 17:19:02 +09:00
Nobuyoshi Nakada 46bde60df3
Remove method filter hack for minitest 2021-09-11 17:12:27 +09:00
Nobuyoshi Nakada 30b4da2bc1
Update the test tool path 2021-09-11 16:26:00 +09:00
Hiroshi SHIBATA d9025ee2b5
fixup f73f9e1f89 2021-09-11 15:29:16 +09:00
Hiroshi SHIBATA 806583c093
Change include order for test assertions 2021-09-11 15:17:38 +09:00
Hiroshi SHIBATA f73f9e1f89
Replace minitest to test for backtrace_filter 2021-09-11 15:17:38 +09:00
Hiroshi SHIBATA b178929469
Fixed uninitialized constant Test::Unit::Assertions::MIN_MEASURABLE.
I'm not sure why it's failed under the chkbuild and rubyci.

  http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20210911T000007Z.fail.html.gz
2021-09-11 11:21:37 +09:00
Hiroshi SHIBATA 9583d2057d Added missing Assertions for assert_file_predicate 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA d05383812a Replace Test::Assertion and Test::Skip to Test::Unit::AssertionFailedError and Test::Unit::PendedError 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 7cec81e073 Removed needless require 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 151a1cd45e Fixed inconsistent require order for assertions and core_assertions 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA d7f0b41c7b Surpressing the noisy messages 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 980f61935f Temporary pend unknown behavior of parallel tests 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 566bbc2421 pend non-supported feature 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA bc1c09c6e8 More fixed assertion message tests 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 1c4f0f1eee We prepared Test::Unit::TestCase in default value 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 0fda70e3a3 We don't want to consistent assert and refute assertions 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 47928204b7 Fixed compatible assertion message format 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 0a5844cbdd Removed output assertion tests. Because our default runner is replaced by custom output 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 6b5400ccde Use msg format with test-unit 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 905c04d1e6 Use Test namespace instead of MiniTest in test_parallel.rb 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 9ff614bc13 Use Test::Unit::Assertions migrated with MiniTest::Assertions 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA ad979a5e00 Replace Test::Unit to Test::Unit::Runner migrated with MiniTest::Unit 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 6d206352c3 Use assert_raise instead of assert_raises 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA d5e94bf5db Replace MiniTest to Test 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 8aaa40e55f Move test of minitest to testunit 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA a3b0518672 Removed obsoleted constant 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 4505be6fd0 Removed MiniTest hack for the default gems repo 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 3451d4d941 Removed minitest dir and added LEGAL infomation for based code 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 9b026ca39b Integrate Minitest to Test 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 0598e87abf Use prepend for override to status line 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 8ee38bdd7d Removed duplicated autorun method 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 62db6e47b6 Resolved conflict initializers 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA 7ef0a4634c Removed unused _run_suites 2021-09-11 08:48:03 +09:00