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

7495 Коммитов

Автор SHA1 Сообщение Дата
Samuel Williams 0e3b0fcdba
Thread scheduler for light weight concurrency. 2020-05-14 22:10:55 +12:00
Yusuke Endoh 8bd27c547c ext/json/parser/prereq.mk: remove type-limit warning if char is unsigned
Ragel generates a code `0 <= (*p)` where `*p` is char.
As char is unsigned by default on arm and RISC-V, it is warned by gcc:

```
compiling parser.c
parser.c: In function ‘JSON_parse_string’:
parser.c:1566:2: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  if ( 0 <= (*p) && (*p) <= 31 )
  ^
parser.c:1596:2: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  if ( 0 <= (*p) && (*p) <= 31 )
  ^
```

This change removes the warning by substituting the condition with
`0 <= (signed char)(*p)`.
2020-05-14 00:44:35 +09:00
Kazuki Yamaguchi 87662134b5 [ruby/openssl] Ruby/OpenSSL 2.2.0
https://github.com/ruby/openssl/commit/41587f69e1
2020-05-13 15:47:51 +09:00
Kazuki Yamaguchi cc26638cae [ruby/openssl] ssl: temporarily remove SSLContext#add_certificate_chain_file
Let's revert the changes for now, as it cannot be included in the 2.2.0
release.

My comment on #257:

> A blocker is OpenSSL::SSL::SSLContext#add_certificate_chain_file. It
> has a pending change and I don't want to include it in an incomplete
> state.
>
> The initial implementation in commit 46e4bdba40c5 was not really
> useful. The issue is described in #305. #309 extended it
> to take the corresponding private key together. However, the new
> implementation was incompatible on Windows and was reverted by #320 to
> the initial one.
>
> (The prerequisite to implement it in) an alternative way is #288, and
> it's still cooking.

This effectively reverts the following commits:

 - dacd08937ccd ("ssl: suppress test failure with SSLContext#add_certificate_chain_file", 2020-03-09)
 - 46e4bdba40c5 ("Add support for SSL_CTX_use_certificate_chain_file. Fixes #254.", 2019-06-13)

https://github.com/ruby/openssl/commit/ea925619a9
2020-05-13 15:47:51 +09:00
Kazuki Yamaguchi 6f008c9d2f [ruby/openssl] pkey: add PKey#inspect and #oid
Implement OpenSSL::PKey::PKey#oid as a wrapper around EVP_PKEY_id().
This allows user code to check the type of a PKey object.

EVP_PKEY can have a pkey type for which we do not provide a dedicated
subclass. In other words, an EVP_PKEY that is not any of {RSA,DSA,DH,EC}
can exist. It is currently not possible to distinguish such a pkey.

Also, implement PKey#inspect to include the key type for convenience.

https://github.com/ruby/openssl/commit/dafbb1b3e6
2020-05-13 15:47:51 +09:00
Bart de Water a7145c3de4 [ruby/openssl] Fix signing example to not use Digest instance
https://github.com/ruby/openssl/commit/033fb4fbe4
2020-05-13 15:47:51 +09:00
Bart de Water c85789f9b2 [ruby/openssl] Look up cipher by name instead of constant
https://github.com/ruby/openssl/commit/b08ae7e73d
2020-05-13 15:47:51 +09:00
Bart de Water b44cc9f040 [ruby/openssl] Remove 'mapping between Digest class and sn/ln'
This is not present in the referenced files anymore, and not useful to most users

https://github.com/ruby/openssl/commit/eae30d2b96
2020-05-13 15:47:51 +09:00
Bart de Water 0b2c70eaa1 [ruby/openssl] Look up digest by name instead of constant
https://github.com/ruby/openssl/commit/b28fb2f05c
2020-05-13 15:47:51 +09:00
Bart de Water 3f8665fe0e [ruby/openssl] Add Marshal support to PKey objects
https://github.com/ruby/openssl/commit/c4374ff041
2020-05-13 15:47:51 +09:00
Yusuke Endoh 61d451d6ce ext/bigdecimal/bigdecimal.c, ext/date/date_core.c: undef NDEBUG
`#define NDEBUG` produces "macro redefined" warnings when it is already
defined via cppflags
2020-05-13 13:49:21 +09:00
Yusuke Endoh 3bca1b6aad ext/openssl/ossl.h: Remove a variable that is used only in assert
It produces "unused variable" warnings in NDEBUG mode
2020-05-13 13:45:31 +09:00
Yusuke Endoh b68dab8667 ext/fiddle/extconf.rb: Fix the condition of libffi <= 3.1
ver is [3, 1, 0] which is not less then or equal to [3, 1]
2020-05-13 10:57:14 +09:00
Yusuke Endoh 9cfa811b0f Do not try ffi_closure_alloc if libffi is <= 3.1
Maybe due to e1855100e4, CentOS, RHEL, and
Fedora CIs have started failing with SEGV.  Try to avoid
ffi_closure_alloc on those environments.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos8/ruby-master/log/20200512T183004Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/fedora32/ruby-master/log/20200512T183004Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20200512T183003Z.fail.html.gz
2020-05-13 08:42:48 +09:00
Yusuke Endoh e1855100e4 ext/fiddle/extconf.rb: check if ffi_closure_alloc is available
to define HAVE_FFI_CLOSURE_ALLOC.
The macro is used in closure.c, so have_func check is needed.

If pkg-config is not installed, extconf.rb fails to detect the version
of libffi, and does not add "-DUSE_FFI_CLOSURE_ALLOC=1" even when system
libffi version is >= 3.2.

If USE_FFI_CLOSURE_ALLOC is not defined, closure.c attempts to check if
HAVE_FFI_CLOSURE_ALLOC is defined or not, but have_func was removed with
528a3a1797, so the macro is always not
defined.

This resulted in this deprecation warning:

https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu2004/ruby-master/log/20200512T123003Z.log.html.gz
```
compiling closure.c
closure.c: In function 'initialize':
closure.c:265:5: warning: 'ffi_prep_closure' is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
  265 |     result = ffi_prep_closure(pcl, cif, callback, (void *)self);
      |     ^~~~~~
In file included from ./fiddle.h:42,
                 from closure.c:1:
/usr/include/x86_64-linux-gnu/ffi.h:334:1: note: declared here
  334 | ffi_prep_closure (ffi_closure*,
      | ^~~~~~~~~~~~~~~~
```
2020-05-13 01:17:30 +09:00
Nobuyoshi Nakada 317fdd6df2 fiddle: share the same config tools 2020-05-12 15:57:47 +09:00
Nobuyoshi Nakada d1748484e8 extlibs.rb: added variable references
Reduce duplicate parts such as package name and version numbers.
2020-05-12 15:57:47 +09:00
卜部昌平 9e41a75255 sed -i 's|ruby/impl|ruby/internal|'
To fix build failures.
2020-05-11 09:24:08 +09:00
卜部昌平 d7f4d732c1 sed -i s|ruby/3|ruby/impl|g
This shall fix compile errors.
2020-05-11 09:24:08 +09:00
Nobuyoshi Nakada f169931414
win32ole: separate global variable declarations and definitions
https://gcc.gnu.org/gcc-10/changes.html#c

> * GCC now defaults to `-fno-common`.  As a result, global
>   variable accesses are more efficient on various targets.  In
>   C, global variables with multiple tentative definitions now
>   result in linker errors.  With `-fcommon` such definitions are
>   silently merged during linking.
2020-05-10 21:37:59 +09:00
Nobuyoshi Nakada be575a6eef
[ruby/io-console] Use sys_fail_fptr macro
https://github.com/ruby/io-console/commit/2b8ba023c8
2020-05-09 17:05:14 +09:00
Nobuyoshi Nakada 0ce45db115 [ruby/io-console] Show path name at error
https://github.com/ruby/io-console/commit/6a4b1c1a6d
2020-05-09 13:56:55 +09:00
Kazuki Tsujimoto 6ed7bc83ec
Fix indentation 2020-05-04 13:27:25 +09:00
Nobuyoshi Nakada b7e1eda932
Suppress warnings by gcc 10.1.0-RC-20200430
* Folding results should not be empty.

  If `OnigCodePointCount(to->n)` were 0, `for` loop using `fn`
  wouldn't execute and `ncs` elements are not initialized.

  ```
  enc/unicode.c:557:21: warning: 'ncs[0]' may be used uninitialized in this function [-Wmaybe-uninitialized]
    557 |  for (i = 0; i < ncs[0]; i++) {
        |                  ~~~^~~
  ```

* Cast to `enum yytokentype`

  Additional enums for scanner events by ripper are not included
  in `yytokentype`.

  ```
  ripper.y:7274:28: warning: implicit conversion from 'enum <anonymous>' to 'enum yytokentype' [-Wenum-conversion]
  ```
2020-05-04 12:28:24 +09:00
Nobuyoshi Nakada 520ac5da22
[pty] do not check openpty twice if found in util library 2020-05-01 10:58:27 +09:00
Kazuhiro NISHIYAMA 6560ff6e36
Fix a typo [ci skip] 2020-04-27 00:54:16 +09:00
Nobuyoshi Nakada 75a0447c15
Suppress C4267 "possible loss of data" warnings
Just cast down explicitly.
2020-04-17 09:24:46 +09:00
Nobuyoshi Nakada a0bc3f2a1c
Suppress C4267 "possible loss of data" warnings 2020-04-17 00:53:26 +09:00
Nobuyoshi Nakada 7a85d31c29
[ruby/date] Suppress -Wchar-subscripts warnings by Cygwin gcc 9.3.0
https://github.com/ruby/date/commit/9968eb69f0
2020-04-14 15:13:40 +09:00
卜部昌平 defc0ee9d1 ext/-test-/cxxanyargs: add #pragma for icc. 2020-04-10 16:17:30 +09:00
Nobuyoshi Nakada 97f73bd0e2
Ignore upper bits of pw_change on macOS too 2020-04-09 12:23:15 +09:00
Nobuyoshi Nakada f099bb040c
Ignore upper bits of pw_expire on macOS
`pw_expire` is declared as `time_t`, but actually not, and
`getpwuid` returns a garbage there.

Also the declaration of `struct passwd` in pwd.h and the manual
page contradict each other, interal `pw_fields` is mentioned only
in the latter.  Maybe there is a confusion.
2020-04-09 09:44:18 +09:00
Nobuyoshi Nakada d8720eb7de
Suppress -Wshorten-64-to-32 warnings 2020-04-08 16:28:38 +09:00
Nobuyoshi Nakada e474c189da
Suppress -Wswitch warnings 2020-04-08 15:13:37 +09:00
卜部昌平 9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Kazuhiro NISHIYAMA 810d66f3e7
Fix a typo [ci skip] 2020-04-03 14:37:28 +09:00
Nobuyoshi Nakada 78b6eb9f9f
[ruby/etc] Deprecate names under `Struct`
https://github.com/ruby/etc/commit/25c538120c
2020-04-02 22:01:01 +09:00
Nobuyoshi Nakada bd0a7d8dd5
Revert "[ruby/etc] Deprecate names under `Struct`"
This reverts commit 69f698d85a.

Again.
2020-04-02 22:00:00 +09:00
Nobuyoshi Nakada 11ddfd4c91
Revert "[ruby/etc] Hack to get rid of linking against static library"
This reverts commit 5885550c8c.

It didn't work without `--enable-shared`.
2020-04-02 21:59:33 +09:00
Nobuyoshi Nakada 5885550c8c
[ruby/etc] Hack to get rid of linking against static library 2020-04-02 21:32:36 +09:00
Nobuyoshi Nakada 69f698d85a
[ruby/etc] Deprecate names under `Struct`
https://github.com/ruby/etc/commit/25c538120c
2020-04-02 21:20:58 +09:00
Nobuyoshi Nakada fad0a1451b
Revert "[ruby/etc] Deprecate names under `Struct`"
This reverts commit 919b175afc.

Since 604689628d, to let `try_run`
work before LIBRUBY_SO is installed, `try_link` links against the
static library which defines even symbols unexported in the shared
library.
2020-04-01 19:29:39 +09:00
Nobuyoshi Nakada 919b175afc
[ruby/etc] Deprecate names under `Struct`
https://github.com/ruby/etc/commit/25c538120c
2020-04-01 18:34:25 +09:00
Nobuyoshi Nakada 552f05ef27
[ruby/etc] Drop binary gems support
Revert "Added build:mingw" e1674c18f5a0faf881b362363f428d139baef3b4.

https://github.com/ruby/etc/commit/d8f1dd85d3
2020-04-01 18:34:25 +09:00
Yusuke Endoh 61b7f86248 ext/socket/init.c: do not return uninitialized buffer
Resize string buffer only if some data is received in
BasicSocket#read_nonblock and some methods.

Co-Authored-By: Samuel Williams <samuel.williams@oriontransfer.co.nz>
2020-03-31 20:19:00 +09:00
Alan Wu b385f7670f Clear all trace events during teardown
Since 0c2d81dada, not all trace events are cleared during VM teardown.
This causes a crash when there is a tracepoint for
`RUBY_INTERNAL_EVENT_GC_EXIT` active during teardown.

The commit looks like a refactoring commit so I think this change was
unintentional.

[Bug #16682]
2020-03-29 23:41:19 -04:00
Benoit Daloze 5fa12dafa8 The last argument of rb_rescue2() should always be (VALUE)0
* Otherwise it might segfault, since C has no idea of the type of varargs,
  and the C code must assume all varargs are VALUE.
2020-03-28 13:03:17 +01:00
Nobuyoshi Nakada 318be1cb2f
Show libffi version only if set 2020-03-21 16:38:29 +09:00
Nobuyoshi Nakada a8ced388fd [ruby/stringio] Bump version to 0.1.1
https://github.com/ruby/stringio/commit/05d75e5e66
2020-03-15 22:13:23 +09:00
Jean Boussier e257c08f2e
[ruby/stringio] StringIO#initialize default to the source string encoding
[Bug #16497]

https://github.com/ruby/stringio/commit/4958a5ccab
2020-03-15 18:43:01 +09:00