Commit graph

7441 commits

Author SHA1 Message Date
Hiroshi SHIBATA
47a1872cd8
Use osuosl instead of GitHub releases
Because the package provided by GitHub releases is different from sourceware.
2020-03-07 20:45:09 +09:00
Hiroshi SHIBATA
8602216746
Switch to download libffi source package to github releases from sourceware.org 2020-03-07 19:57:28 +09:00
Nobuyoshi Nakada
e4a9e926f0
Fixed a typo 2020-03-05 13:31:25 +09:00
Nobuyoshi Nakada
261569d4aa
[ruby/fiddle] always use ffi_closure_alloc on Windows 2020-03-05 11:31:08 +09:00
Nobuyoshi Nakada
528a3a1797
[ruby/fiddle] use ffi_closure_alloc only with 3.2 or later 2020-03-04 23:19:35 +09:00
Nobuyoshi Nakada
95f387f61a
[ruby/fiddle] ffi_closure_free is available in the bundled libffi 2020-03-04 18:41:47 +09:00
Nobuyoshi Nakada
633a1f15d8
[ruby/fiddle] Use ffi_closure_free if available 2020-03-04 18:14:18 +09:00
Yusuke Endoh
d732bc51bd Revert "Revert "Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)"""
This reverts commit 87f6154bb4.

It turned out that the change fails to build on macOS

20200304T074503Z.fail.html.gz
```
+ make 'TESTS=--hide-skip -v fiddle' RUBYOPT=-w test-all
dyld: lazy symbol binding failed: Symbol not found: _ffi_closure_alloc
  Referenced from: /Users/hsbt/Documents/cb/tmp/build/20200304T074503Z/ruby/.ext/x86_64-darwin18/fiddle.bundle
  Expected in: flat namespace

dyld: Symbol not found: _ffi_closure_alloc
  Referenced from: /Users/hsbt/Documents/cb/tmp/build/20200304T074503Z/ruby/.ext/x86_64-darwin18/fiddle.bundle
  Expected in: flat namespace

make: *** [yes-test-all] Abort trap: 6
```
2020-03-04 17:28:21 +09:00
Yusuke Endoh
87f6154bb4 Revert "Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)""
This reverts commit efd641ffab.

This changeset seems to be needed to suppress a warning on Ubuntu 20.04
20200304T033004Z.log.html.gz
```
closure.c:264:5: warning: 'ffi_prep_closure' is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
  264 |     result = ffi_prep_closure(pcl, cif, callback, (void *)self);
      |     ^~~~~~
```

I guess there was a reason why the commit was reverted (maybe some CIs
failed?), so try it again.
2020-03-04 15:46:26 +09:00
Kazuhiro NISHIYAMA
761528e8aa
Add #write and #binwrite to IO section [ci skip] 2020-03-02 16:05:44 +09:00
Takashi Kokubun
7da11ed738
Suppress security alerts
https://github.com/advisories/GHSA-jppv-gw3r-w3q8
2020-02-28 21:05:08 -08:00
Koichi Sasada
b3983c68dd should not expose hidden object.
Hidden object (T_CLASS) can be exposed (BUG).
Also rename rb_mInternalObjectWrapper to rb_cInternalObjectWrapper
because it is a class.
2020-02-29 04:22:17 +09:00
Hiroshi SHIBATA
229ba1215f
Merge racc from upstream repository.
* Support Ruby 2.4's frozen string literals.
  * Remove VCS revisions headers.
2020-02-27 13:33:51 +09:00
卜部昌平
0febd07c69 ext/-test-/cxxanyargs: use try_link instead
We would like to skip this extension library when libstdc++ is missing.
To avoid such situation let's use try_link instead of try_compile.
2020-02-25 13:39:46 +09:00
Masataka Pocke Kuwabara
fa1ec60424 Fix wrong documentation for return value of Pathname#fnmatch 2020-02-25 16:53:35 +13: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
卜部昌平
4e6bae47c8 ext/-test-/cxxanyargs: prevent have_devel check
The `cxx.try_compile` command in this file kicks `cxx.have_devel?`
internally, which recursively calls `cxx.try_link` with a different
source code.  We don't want that happen (the source code compiled in
this file must be the first one).  We need to fake the system.
2020-02-20 11:46:54 +09:00
Nobuyoshi Nakada
2115a3937d
[ruby/io-console] bump up to 0.5.6 2020-02-18 11:34:38 +09:00
Nobuyoshi Nakada
5ef383552d
[ruby/io-console] Just ignore the extension on other than CRuby
41b6f09574
2020-02-18 11:33:06 +09:00
Kazuki Yamaguchi
99b191d83f [ruby/openssl] ts: simplify OpenSSL::Timestamp::Request#algorithm
Stop the special treatment of invalid hashAlgorithm of the message
imprint. Those invalid values can only appear after the object is
instantiated, before the user sets an actual message digest algorithm.

OpenSSL::Timestamp::TokenInfo#algorithm already does the same.

Also, remove the test case "test_create_request" since it does not make
much sense. Those fields are to be set by the user after creation of
the object and checking the initial value is pointless.

Fixes: https://github.com/ruby/openssl/issues/335

890a6476fa
2020-02-17 20:50:47 +09:00
Nobuyoshi Nakada
dec802d8b5 [ruby/io-console] [DOC] Improved about intr:
82b630cd79
2020-02-17 12:05:09 +09:00
Yusuke Endoh
0b55f8a14f ext/openssl/extconf.rb: avoid -Werror=deprecated-declarations
It fails to build on Solaris:

20200216T090008Z.log.html.gz
```
ossl_cipher.c: 関数 ‘ossl_cipher_init’ 内:
ossl_cipher.c:228:2: エラー: ‘EVP_md5’ is deprecated [-Werror=deprecated-declarations]
  228 |  EVP_BytesToKey(EVP_CIPHER_CTX_cipher(ctx), EVP_md5(), iv,
      |  ^~~~~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:73,
                 from /usr/include/openssl/x509v3.h:63,
                 from ossl.h:23,
                 from ossl_cipher.c:10:
/usr/include/openssl/evp.h:732:26: 備考: ここで宣言されています
  732 | DEPRECATED const EVP_MD *EVP_md5(void);
      |                          ^~~~~~~
```
2020-02-16 19:14:23 +09:00
Hiroshi SHIBATA
b99775b163
Import openssl-2.2.0 (#2693)
Import the master branch of ruby/openssl for preparing to release openssl-2.2.0
2020-02-16 15:21:29 +09:00
Hiroshi SHIBATA
05485868cb Workaround for bison provided by scoop on mswin environment 2020-02-15 21:20:25 +09:00
Kazuhiro NISHIYAMA
79ad50d219
Fix call-seq of Pathname#{,l}ch{mod,own} [ci skip] 2020-02-15 12:14:12 +09:00
Nobuyoshi Nakada
78282d4655
[ruby/io-console] Prefer keyword arguments
5facbfc4c8
2020-02-14 20:30:34 +09:00
Alan Wu
9c5a2fed85 Fix readline build dependency 2020-02-09 11:27:32 -05:00
aycabta
f3471174bb [ruby/readline-ext] Use rake/extensiokntask to build
b0b5f709bd
2020-02-09 20:22:12 +09:00
aycabta
108a288079 [ruby/readline-ext] Add spec.extensions
8c33abb13c
2020-02-09 20:22:12 +09:00
aycabta
a629f147cd [ruby/readline-ext] The ruby/assert.h is adopted by Ruby 2.7 or later
106c31fc1b
2020-02-09 20:22:12 +09:00
aycabta
05711adfb4 [ruby/readline-ext] Remove unnecessary -I$(top_srcdir) when it's an individual gem
efaca4a5f4
2020-02-09 20:22:12 +09:00
aycabta
9dcb324fbe Revert "[ruby/readline-ext] Include ruby/assert.h in ruby/ruby.h so that assertions can be there"
This reverts commit 425b2064d3.

This cherry-pick was a mistake.
2020-02-09 20:22:12 +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
Kazuhiro NISHIYAMA
3c7a09ece8
Add call-seq to Pathname#open from File.open
before:
```
  open(p1 = v1, p2 = v2, p3 = v3)
```
2020-02-04 20:56:13 +09:00
Mikhail Novosyolov
7c165bd7d9 Fix linkage of popen_deadlock test
DEBUG: BUILDSTDERR: /usr/bin/ld: infinite_loop_dlsym.o: in function `native_loop_dlsym':
DEBUG: BUILDSTDERR: /builddir/build/BUILD/ruby-2.7.0/ext/-test-/popen_deadlock/infinite_loop_dlsym.c:16: undefined reference to `dlsym'
DEBUG: BUILDSTDERR: collect2: error: ld returned 1 exit status

Ruby was built with LibreSSL.
2020-02-04 08:04:13 +09:00
卜部昌平
7cff2f4585 fix delete unnecessary return
Was my mistake to put return here.
2020-02-01 14:02:59 +09:00
卜部昌平
cdd75d4e7f support C++ std::nullptr_t
C++ keyword `nullptr` represents a null pointer (note also that NULL is
an integer in C++ due to its design flaw).  Its type is `std::nullptr_t`,
defined in <cstddef> standard header.  Why not support it when the
backend implementation can take a null pointer as an argument.
2020-01-31 13:01:52 +09:00
Nobuyoshi Nakada
4942adf68c
Return the makefile content
Block for `create_makefile` is expected to return the content of
the makefile.
2020-01-31 12:52:22 +09:00
NARUSE, Yui
ca2888fb3d Move .IGNORE in extconf.rb 2020-01-31 08:00:56 +09:00
NARUSE, Yui
9aed421d70 Support nmake 2020-01-31 06:47:55 +09:00
NARUSE, Yui
53adb53c9a Ignore expected errors on compiling C++ source [Bug #16331]
BSD make can run parallel more aggressively than GNU make. It communicate
with other make process through -J option in MAKEFLAGS environment variable
to notify a build failure happend in an other pararell make process.
https://www.freebsd.org/cgi/man.cgi?make

It usually works well but ext/-test-/cxxanyargs/Makefile has two targets
which are expected to fail (failure.o and failurem1.o).

Additional note:
To test and debug this issue, following command will speed up it.
`make -f exts.mk -j8 clean all`
2020-01-31 03:05:51 +09:00
卜部昌平
83d6487ae5 fix rb_define_global_function to take const VALUE*
It was unable for rb_define_global_function to take VALUE(*)(int argc,
const VLAUE *argv, VALUE self) -style function.  Test added.
2020-01-28 17:29:57 +09:00
卜部昌平
bbe3420cce add test for rb_define_global_function
was missing.
2020-01-28 17:09:42 +09:00
卜部昌平
16592d6b69 add test for rb_define_method_id
was missing.
2020-01-28 17:09:42 +09:00
卜部昌平
3c3eb418f9 improved support for rb_f_notimplement
rb_f_notimplement should be accepted for all possible arities.

Test provided for that.
2020-01-28 17:09:42 +09:00
Nobuyoshi Nakada
27ac1c615d
Revert pathname, rb_warn_deprecated* are not public API 2020-01-23 21:49:58 +09:00
Nobuyoshi Nakada
aefb13eb63
Added rb_warn_deprecated_to_remove
Warn the deprecation and future removal, with obeying the warning
flag.
2020-01-23 21:42:15 +09:00
Nobuyoshi Nakada
425b2064d3 [ruby/readline-ext] Include ruby/assert.h in ruby/ruby.h so that assertions can be there
4d44c12832
2020-01-23 13:31:19 +09:00
Jeremy Evans
e18b817b1f Make taint warnings non-verbose instead of verbose 2020-01-22 11:19:13 -08:00