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

2035 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun aa3a7d6d74
Remove an unnecessary TODO comment
Fixing 4bcd5981e8/mjit.c (L338)
should be the right solution for this. We may not be able to free the cc immediately.

Plus, we're not copying cc but just holding references to be marked. cc
should be GC-ed once jit_unit is freed.
2020-03-10 01:33:38 -07:00
Takashi Kokubun 4bcd5981e8
Capture inlined iseq's cc entries in root iseq's
jit_unit to avoid marking wrong cc entries when inlined iseq is compiled
multiple times, resolving the TODO added by daf7c48d88.

This obviates pseudo jit_unit in inlined iseq introduced by 7ec2359374
and fixes memory leak of the adhoc unit.
2020-03-10 00:53:35 -07:00
Hiroshi SHIBATA 544ebc669b
Use https for downloading Unicode data.
Retry with 90de118a75

  [Bug #13962][ruby-core:83074]
2020-03-09 13:39:23 +09:00
Nobuyoshi Nakada 2b7409a2f2
Specify explicit separator not to be affected by $; 2020-03-08 17:38:37 +09:00
David Rodríguez 2b6ec768fc
Fix rbinstall bugs (#2930)
* Fix incorrect calls to `Gem.ensure_gem_subdirectories`

This method doesn't take keyword args.

* Remove stuff no longer necessary

Now `Gem.ensure_gem_subdirectories` is doing its job, so some stuff is
no longer needed.

* Use the proper method for default gems

* Respect DESTDIR when creating rubygems folder layout

* Use `Gem.default_specifications_dir`
2020-03-08 10:18:53 +09:00
卜部昌平 f7048f9d55 tool/lib/test/unit: support TESTS='-- -ext-' again
There is a test directory named test/-ext-.  Because this directry
starts with a hyphen, we have to cheat test/unit in order for it to
run the tests underneath.  TESTS='-- -ext' worked for a long time.
Let's not break that maneuver.
2020-03-04 12:30:42 +09:00
Koichi Sasada cf52f37cae Narrow the check target.
Call GC.verify_internal_consistency only for Gem related test
on i386-solaris.
2020-03-04 11:25:43 +09:00
Yusuke Endoh 43ed4eb6d1 Limit the debug code conditon so that it runs only under i386-solaris 2020-03-03 21:00:03 +09:00
Koichi Sasada 1ad9364440 add debug code for Solaris
Check heap consistency after each test to debug.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20200303T012406Z.fail.html.gz
2020-03-03 15:53:46 +09:00
Koichi Sasada 413c98003b show backtrace.
assert_nothing_raised doesn't show the backtrace if an exception
is thrown in a block. This patch shows this backtrace.
2020-03-01 03:02:05 +09:00
Koichi Sasada 28399e4e0f respect --test-order=random
Now --test-order=random is simply ignored. This patch respect
this option.
2020-02-28 17:44:23 +09:00
Vít Ondruch 9bede6e942 Fix wrong RegExp.
The missing `\` in PR #2922 causes the default gems to be installed from
the .gem packages instead from the expanded sources.
2020-02-28 14:32:20 +09:00
Koichi Sasada 6b30638bdb MiniTest::Unit.options has default :seed
MiniTest::Unit (superclass of Test::Unit::Runner) does not has
default seed parameter, but assigned after initializing.
However some tests use MiniTest::Unit without setup of seed option
and it cases unexpected test failures. To solve this issue, add
default seed parameter 42.
2020-02-27 04:06:28 +09:00
Koichi Sasada 14f1790807 `srand($seed)` at the beginning of each test
To avoid `srand(0)` effect in the other tests, call `srand($seed)`
at the beginning of each test (setup).
[Feature #16655]
2020-02-27 03:47:41 +09:00
Koichi Sasada f9d314245b Revert "`srand($seed)` at the beginning of each test"
This reverts commit 7c1553e91d.
It breaks some tests.
2020-02-27 02:45:09 +09:00
Koichi Sasada 7c1553e91d `srand($seed)` at the beginning of each test
To avoid `srand(0)` effect in the other tests, call `srand($seed)`
at the beginning of each test (setup).
[Feature #16655]
2020-02-27 02:29:57 +09:00
Koichi Sasada 116c632095 don't ignore `--seed` option
`--seed N` option is just ignored so respect this option.
[Feature #16655]

Also making "Run options" display pretty.
2020-02-27 02:26:14 +09:00
Takashi Kokubun 69f377a3d6
Internalize rb_mjit_unit definition again
Fixed a TODO in b9007b6c54
2020-02-26 00:27:29 -08:00
Nobuyoshi Nakada 8dab71b9d0
Simplified single script case
Simply use `File.basename` to remove the directory name (and
suffix), instead of `gsub` which can replace unintended parts.
2020-02-26 16:45:35 +09:00
Vít Ondruch 9d6d531527 Cache destination dir.
It is not necessary to strip the `destdir` prefix every iteration, when
it can be done just once.
2020-02-26 11:04:52 +09:00
Vít Ondruch b8a8fdba63 Properly detect mode for binaries.
.gemspec files specifies not just `bin`, but also other directories.
2020-02-26 11:04:52 +09:00
Vít Ondruch e087b029e5 Use class variable `@src_dir` instead of local `path`.
The local `path` variable does not provide any additional value and was
kept around just for clarity for easier review of the `extrac_files`
method move.
2020-02-26 11:04:52 +09:00
Vít Ondruch c9fab1ac06 Use local `{dir,prog,data}_mode` variables instead of globals.
This just gets the `RbInstall::DirPackage` closer by functionality to
`Gem::Package`.
2020-02-26 11:04:52 +09:00
Vít Ondruch 6609940a5e Use `$script_mode` instead of `$prog_mode` for gem inistallation.
rbinstall is using `$script_mode` and `$prog_mode`. However, the
`$script_mode` fallbacks to `$prog_mode` if not provided.

However, RubyGems do not distinguish between `$script_mode` and
`$prog_mode`:

92892bbc3a/lib/rubygems/installer.rb (L196)
92892bbc3a/lib/rubygems/installer.rb (L515)
92892bbc3a/lib/rubygems/installer.rb (L543)

Comparing the usage of `$script_mode` and `$prog_mode`, it seems that
the `$script_mode` should be used where RubyGems expects `$prog_mode`.
2020-02-26 11:04:52 +09:00
Vít Ondruch e960ef6f18 Use `Gem::Package` like object instead of monkey patching.
1. This is similar to what RubyGems does and it is less magic [[1]].
2. It avoids deprecated code paths in RubyGems [[2]].

[1]: 92892bbc3a/lib/rubygems/installer.rb (L151)
[2]: 92892bbc3a/lib/rubygems/installer.rb (L187)
2020-02-26 11:04:52 +09:00
Nobuyoshi Nakada 55bf0ef1aa Share extracted bundled gems with gems for bundler
Extract bundled gems under ".bundle/gems" and get rid of
duplication which cause constant redefinition warnings at
`test-all` after `extract-gems` and `test-bundler`.
2020-02-25 20:40:36 +09:00
Nobuyoshi Nakada f8401732de
Try with and without "v" prefix for numeric tag 2020-02-24 12:40:34 +09:00
Nobuyoshi Nakada 116b9e6a16
Retry checking out the version
rss 0.2.9 is tagged without the "v" prefix.
2020-02-24 12:33:16 +09:00
Koichi Sasada b9007b6c54 Introduce disposable call-cache.
This patch contains several ideas:

(1) Disposable inline method cache (IMC) for race-free inline method cache
    * Making call-cache (CC) as a RVALUE (GC target object) and allocate new
      CC on cache miss.
    * This technique allows race-free access from parallel processing
      elements like RCU.
(2) Introduce per-Class method cache (pCMC)
    * Instead of fixed-size global method cache (GMC), pCMC allows flexible
      cache size.
    * Caching CCs reduces CC allocation and allow sharing CC's fast-path
      between same call-info (CI) call-sites.
(3) Invalidate an inline method cache by invalidating corresponding method
    entries (MEs)
    * Instead of using class serials, we set "invalidated" flag for method
      entry itself to represent cache invalidation.
    * Compare with using class serials, the impact of method modification
      (add/overwrite/delete) is small.
    * Updating class serials invalidate all method caches of the class and
      sub-classes.
    * Proposed approach only invalidate the method cache of only one ME.

See [Feature #16614] for more details.
2020-02-22 09:58:59 +09:00
Koichi Sasada f2286925f0 VALUE size packed callinfo (ci).
Now, rb_call_info contains how to call the method with tuple of
(mid, orig_argc, flags, kwarg). Most of cases, kwarg == NULL and
mid+argc+flags only requires 64bits. So this patch packed
rb_call_info to VALUE (1 word) on such cases. If we can not
represent it in VALUE, then use imemo_callinfo which contains
conventional callinfo (rb_callinfo, renamed from rb_call_info).

iseq->body->ci_kw_size is removed because all of callinfo is VALUE
size (packed ci or a pointer to imemo_callinfo).

To access ci information, we need to use these functions:
vm_ci_mid(ci), _flag(ci), _argc(ci), _kwarg(ci).

struct rb_call_info_kw_arg is renamed to rb_callinfo_kwarg.

rb_funcallv_with_cc() and rb_method_basic_definition_p_with_cc()
is temporary removed because cd->ci should be marked.
2020-02-22 09:58:59 +09:00
Hiroshi SHIBATA 8d3b7f0fda
Fixed net-pop, smtp, protocol and imap task for sync tool 2020-02-21 21:30:04 +09:00
Hiroshi SHIBATA e7f8724fb2
Fixed net-ftp sync task and resync from standalone repo 2020-02-21 21:25:43 +09:00
Hiroshi SHIBATA 9cb1ffaa5c
Promote net-http to the default gems.
test/net/http/test_https.rb: rename fixture methods to read_fixture
  because it conflicts with test-unit gem.
2020-02-21 21:21:14 +09:00
Hiroshi SHIBATA f08d8e5e85
Promote net-ftp to default gems 2020-02-21 19:09:21 +09:00
Hiroshi SHIBATA e9d872a06e
Promote net-imap to the default gems 2020-02-20 21:24:19 +09:00
Takashi Kokubun c4794ed73a
Avoid jumping to a wrong destination
when the next insn is already compiled by former branches.
2020-02-18 23:19:06 -08:00
Hiroshi SHIBATA 0ae9780352
Promote net-protocol to default gems 2020-02-17 22:15:20 +09:00
Hiroshi SHIBATA 05485868cb Workaround for bison provided by scoop on mswin environment 2020-02-15 21:20:25 +09:00
Hiroshi SHIBATA 2c5764ec22
Promote English to the default gems. 2020-02-13 20:35:34 +09:00
Hiroshi SHIBATA bbd1ed626f
Promote tmpdir to the default gems 2020-02-12 20:34:19 +09:00
Hiroshi SHIBATA b8e7bd9f44
Promote tempfile to the default gems. 2020-02-12 19:46:34 +09:00
Hiroshi SHIBATA 56f6973b68
Promote weakref to the default gems 2020-02-11 14:05:04 +09:00
Hiroshi SHIBATA 9b2e671944 Expose assert_no_memory_leak for weakref 2020-02-11 13:29:23 +09:00
Hiroshi SHIBATA a5d7b8e13d Expose assert_normal_exit for weakref 2020-02-11 13:29:23 +09:00
aycabta 6891fd1580 Don't use upstream ext/readline/depend 2020-02-10 19:41:07 +09:00
卜部昌平 115fec062c more on NULL versus functions.
Function pointers are not void*.  See also
ce4ea956d2
8427fca49b
2020-02-07 14:24:19 +09:00
Nobuyoshi Nakada a3fb97465d
Stop auto runner
Auto runner should not run in forked processes in separated tests.
2020-02-07 13:43:50 +09:00
Nobuyoshi Nakada 3d21a75c72
No crafted backtrace for SystemExit
As SystemExit is ignored, it is just useless.
2020-02-07 11:09:19 +09:00
aycabta e323f50a9c Fix readline-ext sync 2020-02-06 21:20:20 +09:00
Nobuyoshi Nakada 5fac54a594
Fixed the output from separated test in parallel test
Redirect the output of separated child process to
`MiniTest::Unit.output`.
2020-02-06 20:53:11 +09:00
Nobuyoshi Nakada f1c230f18b
Add separated assertion count 2020-02-06 20:52:25 +09:00
卜部昌平 72bbf60f3a do not assume GCC for __builtin_setjmp
Namely recent Sun C compiler has this function, and is not a GCC.
Meanwhile the code without RUBY_JMP_BUF assumes GCC.  We have to define
the macro when we detect __builtin_setjmp for non-GCC compilers.
2020-02-06 11:46:51 +09:00
Nobuyoshi Nakada 0226d72e95
Fixed the output from separated test in parallel test
To output to the STDOUT of the parent process according to the
parallel test protocol, should send to the `MiniTest::Unit.output`
instead of each own STDOUT.
2020-02-05 09:39:14 +09:00
Nobuyoshi Nakada 6fe44576b9
Fixed FD leaks 2020-02-05 09:30:12 +09:00
Nobuyoshi Nakada c6cd4206df
Get rid of nested string interpolations to be editor-friendly 2020-02-05 08:53:21 +09:00
NARUSE, Yui 390a9d3b72 just use STDOUT 2020-02-04 21:51:57 +09:00
NARUSE, Yui 9b9a621ae3 On Windows it cannot receive fd except 0..2 2020-02-04 20:54:48 +09:00
NARUSE, Yui 0529fead36 assert_separately uses their own pipe instead of stdout 2020-02-04 19:30:11 +09:00
Nobuyoshi Nakada b68fc08092
Indent ChangeLog contents [ci skip]
Separate each entries more obviously as `page-delimiter' works
fine.
2020-02-01 23:26:53 +09:00
Nobuyoshi Nakada ab35876444
Explicitly set the encoding of ChangeLog file to UTF-8 [ci skip] 2020-02-01 23:10:18 +09:00
Hiroshi SHIBATA 563f177aa4
UnpackedInstaller on rbinstall.rb is inherited from Gem::Installer.
It also needs to explicitly convert from String to Gem::Package
  with initialization.
2020-02-01 11:31:46 +09:00
Hiroshi SHIBATA f8df531bbf
Gem::Installer.new(String, options) is obsoleted. Explicitly converted
to Gem::Package from String instance.
2020-02-01 11:23:34 +09:00
Nobuyoshi Nakada f7f8dc5fd4
Unnamed groups are not captured when named groups are used 2020-01-30 11:31:48 +09:00
Koichi Sasada 20c1c24014 Minitest::Unit.current_repeat_count
This method returns loop counter for multi-run (0 start).
2020-01-28 18:13:58 +09:00
Nobuyoshi Nakada 33d02e6bc7
Skip empty directories to install [Bug #16596] 2020-01-28 10:04:25 +09:00
Hiroshi SHIBATA aacd918340
Do not use `git pull` because origin/master was already fetched. 2020-01-26 07:40:56 +09:00
Hiroshi SHIBATA da2d6ca8f1
Show the repository name before update task 2020-01-26 07:38:20 +09:00
Hiroshi SHIBATA 9e3bfed53c
Added usage documentation for sync_default_gems 2020-01-22 16:02:10 +09:00
aycabta cdaae38f79 Use gem name to specify 2020-01-22 13:44:49 +09:00
Nobuyoshi Nakada 496f295f91
Test bundled gems with timeout 2020-01-19 11:35:10 +09:00
Nobuyoshi Nakada f43940633d
test-bundled-gems.rb: Use real paths for symlinks 2020-01-13 12:27:24 +09:00
Nobuyoshi Nakada b34f39e860
vcs.rb: Allow to empty a part in commit log 2020-01-12 19:43:59 +09:00
Hiroshi SHIBATA 83240f315a Make rss library to the bundle gems
[Feature #16485][ruby-core:96683]
2020-01-12 12:28:29 +09:00
Hiroshi SHIBATA c3ccf23d58 Make rexml library to the bundle gems
[Feature #16485][ruby-core:96683]
2020-01-12 12:28:29 +09:00
Hiroshi SHIBATA e04366056a
Update the upstream repository of bundler 2020-01-10 22:56:46 +09:00
Nobuyoshi Nakada d254d5563e
vcs.rb: Get rid of Kernel#open 2020-01-09 10:04:22 +09:00
Jun Aruga f132825ffa Disable IPv6 on Travis s390x case. (#2819)
This fixes following error that sometimes happens once in a few times
on Travis s390x environment.

```
$ tool/travis_retry.sh sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
+ sudo -E apt-add-repository -y ppa:ubuntu-toolchain-r/test
Error: retrieving gpg key timed out.
```
2020-01-07 12:23:04 +09:00
Takashi Kokubun afd3f64f8c
Redmine /projects/ruby-trunk is now redirected
to /projects/ruby-master
2019-12-31 22:06:19 -08:00
Nobuyoshi Nakada 26ee0af4b3
Test the bundled version minitest instead of master
Minitest has the released tags now.
2019-12-31 17:49:26 +09:00
Nobuyoshi Nakada d7bef803ac Separate builtin initialization calls 2019-12-29 12:34:55 +09:00
Kazuhiro NISHIYAMA 729b7ce270
Add check_warning_flags to leakchecker 2019-12-27 13:06:31 +09:00
卜部昌平 5e22f873ed decouple internal.h headers
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead.  This would significantly
speed up incremental builds.

We take the following inclusion order in this changeset:

1.  "ruby/config.h", where _GNU_SOURCE is defined (must be the very
    first thing among everything).
2.  RUBY_EXTCONF_H if any.
3.  Standard C headers, sorted alphabetically.
4.  Other system headers, maybe guarded by #ifdef
5.  Everything else, sorted alphabetically.

Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
2019-12-26 20:45:12 +09:00
NARUSE, Yui 1002de58ec fix version regexp 2019-12-25 18:02:53 +09:00
NARUSE, Yui a1018b2c5f fix typo 2019-12-25 17:01:26 +09:00
Nobuyoshi Nakada 5de284ec78
Fixed a typo in an exception class name 2019-12-23 10:37:30 +09:00
Nobuyoshi Nakada 5f18635a80
make-snapshot: fixed mode
"X" must be used in conjunction with "+".
2019-12-23 10:10:23 +09:00
Nobuyoshi Nakada 80d5d220b9
Fix typo in commit logs by log-fix notes 2019-12-23 09:29:05 +09:00
NARUSE, Yui 3a29f05ba5 Move stats under a dict 2019-12-22 02:51:22 +09:00
NARUSE, Yui 216b62aa87 use UTC to use previous day in midnight 2019-12-20 14:10:57 +09:00
Nobuyoshi Nakada db16629008
Fixed misspellings
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-12-20 09:32:42 +09:00
Nobuyoshi Nakada 1b86309b04
Squelch filter-branch warning and sleeping 2019-12-17 23:38:18 +09:00
Kazuhiro NISHIYAMA 6545d5bbb9
Use CDN instead of raw.githubusercontent.com 2019-12-16 16:59:23 +09:00
Kazuhiro NISHIYAMA 8b921813aa
Fix open without close [ci skip] 2019-12-16 16:58:21 +09:00
Yusuke Endoh eeb99fb525 tool/gen-mailmap.rb: odaira is removed as he is added in upstream
ddc83bea6f
2019-12-15 22:19:45 +09:00
Yusuke Endoh 48bab6fe1e tool/gen-mailmap.rb: Added for generating git `.mailmap` file
`.mailmap` can be used To show canonical names and email addresses.
It is helpful for statistics of committers.
2019-12-15 22:06:13 +09:00
Koichi Sasada 97a17a51b8 readable function names for inline functions.
Now, C functions written by __builtin_cexpr!(code) and others are
named as "__builtin_inline#{n}". However, it is difficult to know
what the function is. This patch rename them into
"__builtin_foo_#{lineno}" when cexpr! is in 'foo' method.
2019-12-13 17:55:45 +09:00
卜部昌平 12de92a368 implement make test-all TESTS=--gc-compact
79eb5e1aca implemented
RUBY_TEST_GC_COMPACT=1 so why not make it also possible via the command
line argument.
2019-12-12 11:13:42 +09:00
Koichi Sasada 27ac034f19 support gc_compact_checker on parallel test. 2019-12-12 04:27:06 +09:00
Aaron Patterson 7dbbba38a0
Make sure we don't push MOVED or NONE on the stack 2019-12-11 11:07:15 -08:00
Koichi Sasada 79eb5e1aca call GC.compact after each test.
RUBY_TEST_GC_COMPACT=1 enables GC.compact checker which calls
GC.compact after each test.
2019-12-12 03:32:12 +09:00
Kazuhiro NISHIYAMA 7fa821a80d
Try to use `set-output`
because commit info are not necessary in env.
2019-12-11 14:03:30 +09:00
Koichi Sasada bbbf451bff Update tool/mk_builtin_binary.rb
Co-Authored-By: Sutou Kouhei <kou@cozmixng.org>
2019-12-11 11:24:42 +09:00
Koichi Sasada 40026a408d support cross-compilation.
On cross-compilation, compiled binary can no be created because
compiled binary should be created by same interpreter (on cross-
compilation, host ruby is used to build ruby (BASERUBY)).
So that cross-compilation system loads required scripts in text.
It is same as miniruby.
2019-12-11 11:24:42 +09:00
Koichi Sasada 9c2807b2df remove prelude.c
prelude.c is an automatically generated file by template/prelude.c.tmpl.
However it does not contain any required functions. So remove it from
dependency.

Also miniprelude.c is included by mini_builtin.c and does not need
to make miniprelude.o.
2019-12-11 11:24:42 +09:00
Hiroshi SHIBATA 43544f8617
Added the missing gemspec of racc 2019-12-10 17:03:13 +09:00
aycabta be13b897ea Show failed commits only when exists 2019-12-07 22:02:24 +09:00
Aaron Patterson 2c8d186c6e
Introduce an "Inline IVAR cache" struct
This commit introduces an "inline ivar cache" struct.  The reason we
need this is so compaction can differentiate from an ivar cache and a
regular inline cache.  Regular inline caches contain references to
`VALUE` and ivar caches just contain references to the ivar index.  With
this new struct we can easily update references for inline caches (but
not inline var caches as they just contain an int)
2019-12-05 13:37:02 -08:00
Takashi Kokubun 72cff5f3af
MJIT_CC and MJIT_SUPPORT are not a prefix
0b19e15a12 was also for "MJIT_SUPPORT"
too.
2019-12-04 22:18:43 -08:00
Takashi Kokubun 5fbb4555b4
Prefer using MJIT_CC for JIT support check
because Solaris might have CC=cc and we'd like to check full path
MJIT_CC=/opt/developerstudio12.5/bin/cc instead.
2019-12-04 22:16:08 -08:00
Alan Wu df76f2c577
Make TracePoint.stat a singleton method again (#2726)
[Bug #16399]
2019-12-04 21:02:21 -05:00
Yusuke Endoh 409e4ab740 tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io
`(ulimit -n 30; make test-tool)` fails with unexplicit message:
"undefined method `write' for nil:NilClass" due to lack of stdout.

This change makes it explicit.  [Bug #5577]
2019-12-03 17:26:12 +09:00
Kevin Deisz 171803d5d3 Promote did_you_mean to default gem
At the moment, there are some problems with regard to bundler + did_you_mean because of did_you_mean being a bundled gem. Since the vendored version of thor inside bundler and ruby itself explicitly requires did_you_mean, it can become difficult to load it when using Bundler.setup. See this issue: https://github.com/yuki24/did_you_mean/issues/117#issuecomment-482733159 for more details.
2019-11-30 21:08:19 -05:00
David Rodríguez a2fc6a51dd [ruby/fileutils] Fix test failure under ruby 2.4
`Exception#full_message` is only defined on ruby 2.5.0 and above.

https://github.com/ruby/fileutils/commit/a8968f41ed
2019-12-01 08:23:05 +09:00
David Rodríguez fa0f3eff22 [ruby/fileutils] Fix error printing test failure
`exception_details` is not defined anywhere.

This commit fixes the following test crash in ruby 2.4

```
Error: test_assert_output_lines(TestFileUtils): NoMethodError: undefined method `exception_details' for #<TestFileUtils:0x00005556ef699178>
```

And replaces it with an actual test failure:

```
[Test::Unit::CoreAssertions::MiniTest::Assertion] exception expected, not #<NoMethodError: undefined method `full_message' for #<RuntimeError: ok>
Did you mean?  message>.
```

https://github.com/ruby/fileutils/commit/2f38ba6e82
2019-12-01 08:22:37 +09:00
Hiroshi SHIBATA 80705e2c4f
Add to support the single commit for sync_default_gems.rb 2019-11-30 14:48:26 +09:00
Hiroshi SHIBATA 0b1b2f2442 Remove e2mmap from sync_default_gems.rb 2019-11-30 08:00:40 +09:00
NARUSE, Yui 76871dea6b Use more template feature of w.r-l.o 2019-11-28 23:49:28 +09:00
Koichi Sasada a3e6f52c17 rename __builtin_inline!(code) and introduce others.
rename __builtin_inline!(code) to __builtin_cstmt(code).
Also this commit introduce the following inlining C code features.

* __builtin_cstmt!(STMT)

(renamed from __builtin_inline!)

Define a function which run STMT implicitly and call this function at
evatuation time. Note that you need to return some value in STMT.
If there is a local variables (includes method parameters), you can
read these values.

  static VALUE func(ec, self) {
    VALUE x = ...;
    STMT
  }

Usage:
  def double a
    # a is readable from C code.
    __builtin_cstmt! 'return INT2FIX(FIX2INT(a) * 2);'
  end

* __builtin_cexpr!(EXPR)

Define a function which invoke EXPR implicitly like `__builtin_cstmt!`.
Different from cstmt!, which compiled with `return EXPR;`.
(`return` and `;` are added implicitly)

  static VALUE func(ec, self) {
    VALUE x = ...;
    return EXPPR;
  }

Usage:
  def double a
    __builtin_cexpr! 'INT2FIX(FIX2INT(a) * 2)'
  end

* __builtin_cconst!(EXPR)

Define a function which invoke EXPR implicitly like cexpr!.
However, the function is called once at compile time, not evaluated time.
Any local variables are not accessible (because there is no local variable
at compile time).

Usage:
  GCC = __builtin_cconst! '__GNUC__'

* __builtin_cinit!(STMT)

STMT are writtein in auto-generated code.
This code does not return any value.

Usage:

  __builtin_cinit! '#include <zlib.h>'
  def no_compression?
    __builtin_cconst! 'Z_NO_COMPRESSION ? Qtrue : Qfalse'
  end
2019-11-27 03:55:28 +09:00
Nobuyoshi Nakada 7db719c516
Write rbinc files to the source directory
Update the target file itself of the dependency on this script.
Fall back to the current working directory if unwritable.
2019-11-26 21:49:42 +09:00
Hiroshi SHIBATA 82525fcce1
Add sync task for ruby/openssl 2019-11-26 18:26:08 +09:00
NARUSE, Yui 35608760ff Add github repo to remove_tag 2019-11-22 19:05:58 +09:00
Kazuhiro NISHIYAMA 8eb0a9e566
Use jsDelivr instead of raw.githubusercontent.com
Try to fix download error on Solaris CI

https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191121T162422Z.fail.html.gz
```
tool/downloader.rb:243:in `rescue in download': failed to download config.guess (RuntimeError)
Net::HTTPFatalError: 503 "Service Unavailable": https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.guess
```
2019-11-22 13:55:59 +09:00
Nobuyoshi Nakada f09fc1b034
Dependents on probes.h need the dummy header too 2019-11-18 23:16:22 +09:00
Nobuyoshi Nakada 39492d6ce6
Build ruby-runner 2019-11-18 18:42:40 +09:00
Nobuyoshi Nakada 227220b25a
Skip dependencies on timestamp files 2019-11-18 18:42:40 +09:00
Jeremy Evans c5c05460ac Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02:00
Hiroshi SHIBATA 57dc3ff73d
Removed sync library from sync tool 2019-11-13 15:37:21 +09:00
Dylan Thacker-Smith ac112f2b5d Avoid top-level search for nested constant reference from nil in defined?
Fixes [Bug #16332]

Constant access was changed to no longer allow top-level constant access
through `nil`, but `defined?` wasn't changed at the same time to stay
consistent.

Use a separate defined type to distinguish between a constant
referenced from the current lexical scope and one referenced from
another namespace.
2019-11-13 15:36:58 +09:00
Kazuhiro NISHIYAMA c4064aef7f Add commit number of today to notification of GitHub Actions 2019-11-13 14:25:30 +09:00
Nobuyoshi Nakada b0fb9bda9a
Strip the last line which become trailing spaces 2019-11-12 16:16:46 +09:00
Nobuyoshi Nakada 2de3feab44
Get rid of `__` prefix which is presereved by C standard 2019-11-12 16:09:36 +09:00
Yusuke Endoh c02de30efb tool/lib/leakchecker.rb: show the code location that allocated leaked fd
by using ObjectSpace.trace_object_allocations.

`make test-all LEAK_CHECKER_TRACE_OBJECT_ALLOCATION=true` will print not
only leaked fds but also where it was created.
2019-11-12 01:47:18 +09:00
NARUSE, Yui b2b1279272 format-release uses the result of GitHub Actions 2019-11-12 01:22:59 +09:00
NARUSE, Yui 0ba1ea7fbf Always use git.ruby-lang.org as origin
naruse sets remote.origin.pushUrl = nonexistent as fail-safe
configuration to avoid accidentally push a new branch to origin.
2019-11-12 01:22:59 +09:00
Hiroshi SHIBATA bcfe94b7f2
Revert "Revert "Promote uri to default gems""
This reverts commit fdfad90522.

  f1f27da6c4 resolved this.
2019-11-11 22:21:43 +09:00
Koichi Sasada 3141642380 __builtin_inline!
Add an experimental `__builtin_inline!(c_expression)` special intrinsic
which run a C code snippet.
In `c_expression`, you can access the following variables:
  * ec (rb_execution_context_t *)
  * self (const VALUE)
  * local variables (const VALUE)
Not that you can read these variables, but you can not write them.
You need to return from this expression and return value will be a
result of __builtin_inline!().

Examples:
  `def foo(x) __builtin_inline!('return rb_p(x);'); end` calls `p(x)`.
  `def double(x) __builtin_inline!('return INT2NUM(NUM2INT(x) * 2);')`
  returns x*2.
2019-11-11 16:47:50 +09:00
Nobuyoshi Nakada 390293525a
Remove binary data at installation
And revert "Relaxed warning assertions",
6f9be8505d.
2019-11-11 12:20:03 +09:00
David Rodríguez f48655d04d Remove unneeded exec bits from some files
I noticed that some files in rubygems were executable, and I could think
of no reason why they should be.

In general, I think ruby files should never have the executable bit set
unless they include a shebang, so I run the following command over the
whole repo:

```bash
find . -name '*.rb' -type f -executable -exec bash -c 'grep -L "^#!" $1 || chmod -x $1' _ {} \;
```
2019-11-09 21:36:30 +09:00
Hiroshi SHIBATA fdfad90522
Revert "Promote uri to default gems"
This reverts commit c5b4d2a259.

  This commit affects with activation feature of RubyGems.
  [Bug #16337][ruby-core:95768]
2019-11-09 20:16:03 +09:00
Nobuyoshi Nakada e3c8524411
Full-path of builtin scripts no longer needed 2019-11-09 19:43:14 +09:00
Kazuhiro NISHIYAMA 50bc7e7e9f
Add debug print
http://ci.rvm.jp/results/trunk-mjit@silicon-docker/2380788
```
test_all             #<Thread:0x000055b6c8e9fca8@/tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:42 run> terminated with exception (report_on_exception is true):
<internal:pack>:134:in `pack': no implicit conversion of false into String (TypeError)
	from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:160:in `_report'
	from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:45:in `block in _run_suite'
```
2019-11-09 15:20:52 +09:00
Hiroshi SHIBATA c5b4d2a259
Promote uri to default gems 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 8c9438d219
Promote yaml to default gems 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 2a0ed5691e
Promote timeout to default gems 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 5f206cebb9
Promote observer to default gems. But not yet released 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA 3d731c3694
Promote readline to default gems named readline-ext 2019-11-09 07:32:34 +09:00
Hiroshi SHIBATA fc1d06b25d
Added gemspec for readline gem that is wrapper library for reline and readline extension 2019-11-09 07:32:34 +09:00
Koichi Sasada b5d8849220 Revert "don't embed full-path."
This reverts commit dfac2e9eb3.

It does not work if cwd is different from builddir...
2019-11-09 07:09:01 +09:00
Koichi Sasada dfac2e9eb3 don't embed full-path.
miniruby load *.rb from srcdir. To specify file path,
tool/mk_builtin_loader.rb embed full path of each *.rb file.
However it prevent to pre-generation of required files for tarball.
This patch generate srcdir/*.rb from __FILE__ information.
2019-11-09 06:57:58 +09:00
Nobuyoshi Nakada 88b9a0f7fe
Prettify builtin_binary format 2019-11-09 00:21:44 +09:00
Yusuke Endoh 882179a0ec tool/mk_builtin_loader.rb: check if op is an array or not
The insn array includes not only an array but also some literal objects.
2019-11-08 23:29:50 +09:00
Nobuyoshi Nakada 2e29b65109
Add file mode to generated files [ci skip] 2019-11-08 16:37:42 +09:00
Nobuyoshi Nakada 20971799f2
Renamed `load_*.inc` as `*.rbinc` to utilize a suffix rule 2019-11-08 16:30:28 +09:00
Koichi Sasada 2eb02dfd3b Stop compiling if type mismatch was found.
If there is a type mismatch between expected builtin function type
and actual function type, C compiler shows warning.

For example, `__builtin_func(1, 2)` expects
`func(rb_ec_t*, VALUE self, VALUE p1, VALUE p2)` function definition.

However, it is easy to overlook "warning" messages. So this patch
changes to stop compiling as an error if there is a mismatch.
2019-11-08 15:29:02 +09:00
Koichi Sasada e2a45cb984 use builtin for TracePoint.
Define TracePoint in trace_point.rb and use __builtin_ syntax.
2019-11-08 09:09:29 +09:00
Koichi Sasada 46acd0075d support builtin features with Ruby and C.
Support loading builtin features written in Ruby, which implement
with C builtin functions.
[Feature #16254]

Several features:

(1) Load .rb file at boottime with native binary.

Now, prelude.rb is loaded at boottime. However, this file is contained
into the interpreter as a text format and we need to compile it.
This patch contains a feature to load from binary format.

(2) __builtin_func() in Ruby call func() written in C.

In Ruby file, we can write `__builtin_func()` like method call.
However this is not a method call, but special syntax to call
a function `func()` written in C. C functions should be defined
in a file (same compile unit) which load this .rb file.

Functions (`func` in above example) should be defined with
  (a) 1st parameter: rb_execution_context_t *ec
  (b) rest parameters (0 to 15).
  (c) VALUE return type.
This is very similar requirements for functions used by
rb_define_method(), however `rb_execution_context_t *ec`
is new requirement.

(3) automatic C code generation from .rb files.

tool/mk_builtin_loader.rb creates a C code to load .rb files
needed by miniruby and ruby command. This script is run by
BASERUBY, so *.rb should be written in BASERUBY compatbile
syntax. This script load a .rb file and find all of __builtin_
prefix method calls, and generate a part of C code to export
functions.

tool/mk_builtin_binary.rb creates a C code which contains
binary compiled Ruby files needed by ruby command.
2019-11-08 09:09:29 +09:00
卜部昌平 d45a013a1a extend rb_call_cache
Prior to this changeset, majority of inline cache mishits resulted
into the same method entry when rb_callable_method_entry() resolves
a method search.  Let's not call the function at the first place on
such situations.

In doing so we extend the struct rb_call_cache from 44 bytes (in
case of 64 bit machine) to 64 bytes, and fill the gap with
secondary class serial(s).  Call cache's class serials now behavies
as a LRU cache.

Calculating -------------------------------------
                           ours         2.7         2.6
vm2_poly_same_method     2.339M      1.744M      1.369M i/s - 6.000M times in 2.565086s 3.441329s 4.381386s

Comparison:
             vm2_poly_same_method
                ours:   2339103.0 i/s
                 2.7:   1743512.3 i/s - 1.34x  slower
                 2.6:   1369429.8 i/s - 1.71x  slower
2019-11-07 17:41:30 +09:00
Hiroshi SHIBATA fc85bdeb77
Promote cgi to default gems 2019-11-07 16:36:14 +09:00
Hiroshi SHIBATA 223d3c460a
Promote net-smtp to default gems 2019-11-07 16:36:14 +09:00
Hiroshi SHIBATA eb0b13596d
Promote net-pop to default gems 2019-11-07 16:36:14 +09:00
Hiroshi SHIBATA 77c94e0dd8
Promote benchmark to default gems 2019-11-07 16:36:14 +09:00
Hiroshi SHIBATA 1159dbf305
Promote delegate to default gems 2019-11-07 16:36:14 +09:00
Hiroshi SHIBATA 3b0bd34001
Promote pstore to default gems 2019-11-07 16:36:14 +09:00
Hiroshi SHIBATA 478f6e2b34
Fixed an Errno::ENOENT with non-test libraries 2019-11-07 16:36:13 +09:00
Hiroshi SHIBATA d1630d41ad
Promote open3 to default gems 2019-11-07 07:16:27 +09:00
Hiroshi SHIBATA ec2603c353
fallback standard structure library to sync_lib_gem method 2019-11-07 07:16:26 +09:00
Hiroshi SHIBATA 91135f6d29
Promote singleton to default gems 2019-11-07 07:16:26 +09:00
Nobuyoshi Nakada c7632fa80c Do not occupy `ARGV` by XRUBY command
Instead run test-bundled-gems.rb by `ENV['RUBY']`, which should be
set by runruby.rb.
2019-11-05 08:45:19 +09:00
Nobuyoshi Nakada 823f25bb96
sync_default_gems.rb: Show the progress at fetching
It looks like hanging up when fetching from a remote first time.
2019-11-04 09:40:26 +09:00
Hiroshi SHIBATA c38ba75780
Fixed the sync task for json
* Ignode to change ext/json/depend
  * Fixed to ignore json_pure files
2019-10-31 10:19:57 +09:00
Hiroshi SHIBATA 1c03026ea3 Try to run assert_output_unchanged with racc tests 2019-10-31 08:39:48 +09:00
Hiroshi SHIBATA d3272fcba3
Update the latest structure for racc upstream 2019-10-30 21:00:01 +09:00
Yusuke Endoh 1820aeeeb2 tool/lib/minitest/unit.rb: add "omit" as an alias to "skip"
According to rdoc, test-unit provides omit instead of skip.
This is a compatibility layer to make it work with both test-unit and
tool/lib/minitest.
2019-10-29 13:15:09 +09:00
Nobuyoshi Nakada 48f982aba7
test-bundled-gems.rb: fixed for out-of-place build 2019-10-28 19:14:38 +09:00
卜部昌平 356e203a3a more on struct rb_call_data
Replacing adjacent struct rb_call_info and struct rb_call_cache
into a struct rb_call_data.
2019-10-25 12:24:22 +09:00
Alan Wu 89e7997622 Combine call info and cache to speed up method invocation
To perform a regular method call, the VM needs two structs,
`rb_call_info` and `rb_call_cache`. At the moment, we allocate these two
structures in separate buffers. In the worst case, the CPU needs to read
4 cache lines to complete a method call. Putting the two structures
together reduces the maximum number of cache line reads to 2.

Combining the structures also saves 8 bytes per call site as the current
layout uses separate two pointers for the call info and the call cache.
This saves about 2 MiB on Discourse.

This change improves the Optcarrot benchmark at least 3%. For more
details, see attached bugs.ruby-lang.org ticket.

Complications:
 - A new instruction attribute `comptime_sp_inc` is introduced to
 calculate SP increase at compile time without using call caches. At
 compile time, a `TS_CALLDATA` operand points to a call info struct, but
 at runtime, the same operand points to a call data struct. Instruction
 that explicitly define `sp_inc` also need to define `comptime_sp_inc`.
 - MJIT code for copying call cache becomes slightly more complicated.
 - This changes the bytecode format, which might break existing tools.

[Misc #16258]
2019-10-24 18:03:42 +09:00
Hiroshi SHIBATA 2791989a31
Fixed sync path of e2mmap structure for gemspec. 2019-10-24 16:11:01 +09:00
Nobuyoshi Nakada 601f1fb456
Catch syntax error even if fatal 2019-10-23 02:05:28 +09:00
NARUSE, Yui 99ca5705a2 tool/release.sh uses ruby-actions' result
https://github.com/ruby/actions
2019-10-22 22:15:52 +09:00
NARUSE, Yui d736511e42 Move format-release to tool and fix bugs 2019-10-22 21:44:19 +09:00
Nobuyoshi Nakada ed3333f873
make-snapshot: Regexp#match raises on nil now 2019-10-22 21:05:52 +09:00
Nobuyoshi Nakada f8fb51c976
Revert "alias assert_raise_message for compatibility with test-unit"
This reverts commit 43015275b9.

`assert_raise_message` in test-unit is different from
`assert_raise_with_message`.  It checks the exception message
only, but not the exception class,
2019-10-16 21:00:36 +09:00
Nobuyoshi Nakada 43015275b9
alias assert_raise_message for compatibility with test-unit 2019-10-16 17:44:51 +09:00
Kazuhiro NISHIYAMA 7abb02771a
Fix typo [ci skip]
pointed out by ruby-trunk-changes
2019-10-08 00:00:24 +09:00
Kazuhiro NISHIYAMA 3374e1450c
Write yaml and json under destdir and print to stdout 2019-10-07 19:33:33 +09:00
Kazuhiro NISHIYAMA 96753e8475
Create info.yml and info.json
- `info.yml` is for ruby/www.ruby-lang.org/_data/releases.yml
- `info.json` is meta data for users of snapshot
2019-10-07 19:05:42 +09:00
Kazuhiro NISHIYAMA bb86611c9b
Remove `-s3` option
It will not use in `ruby/actions`, and `default=tmp` is not correct.
2019-10-07 19:03:06 +09:00
Nobuyoshi Nakada 8f7fca784a
make-snapshot: touch updated files after prepared
Align mtime of files updated by `make prepare-package` to make
packages reproducible.
2019-10-03 19:14:49 +09:00
Nobuyoshi Nakada 8142a9b43d
make-snapshot: suppress make error messages unless failed 2019-10-03 19:12:03 +09:00
Nobuyoshi Nakada 47d143be17
make-snapshot: copy cache files instead of linking
To get rid of setting mode and mtime of the original cache files.
2019-10-03 19:09:16 +09:00
Nobuyoshi Nakada b7ae26e2ee
vcs.rb: fix to export git-svn version
* Use the given branch name instead of implicit 'HEAD".
* Format like as git-svn when `from` or `to` is SVN revision
  number.
2019-10-03 19:07:48 +09:00
Hiroshi SHIBATA c14755e9ca
[ruby/fileutils] improve the compatibility of minitest
https://github.com/ruby/fileutils/commit/f16f5a0dd6
2019-10-03 18:32:21 +09:00
卜部昌平 84fc1de512 use bind_call for test-all --gc-stress
This one allocation of Method object is worth avoiding.  We don't
want to test UnboundMethod#bind right here.  GC need not run.
2019-10-03 15:24:09 +09:00
Koichi Sasada 9759e3c9f0 fix assertion number.
On parallel test, there are additional tests because of implicit
checkers which are enabled on 84cbce3d88.
2019-10-02 17:19:14 +09:00
Nobuyoshi Nakada 4ed51b3956
Fixed failure message for `clean-cache` 2019-10-02 17:03:55 +09:00
Koichi Sasada 84cbce3d88 Enable checkers on parallel test.
parallel test (`make test-all TESTS=-j8`) runs tests on specified
number of processes. However, some test checkers written in
`runner.rb` are not loaded. This fix enable these checkers on
parallel tests.

See also: https://github.com/ruby/ruby/pull/2508
2019-10-02 16:23:00 +09:00
NAKAMURA Usaku a61ae414b6 Fix the order of executing `after-update` task 2019-10-02 13:00:17 +09:00
NAKAMURA Usaku 5af2c8735a Should fail if `system` failed 2019-10-02 12:59:59 +09:00
Hiroshi SHIBATA 15606963de expose assert_raise and assert_join_threads 2019-10-01 22:19:18 +09:00
Koichi Sasada 945560008f Revert "introduce debug check."
This reverts commit c3b84f2de8.
Backtrace shows it is before running tests and debug check was
nonsense.
2019-09-30 17:59:10 +09:00