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

7469 Коммитов

Автор SHA1 Сообщение Дата
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
Kazuhiro NISHIYAMA de10631dcf
Add workaround for test-bundler failure
https://github.com/ruby/actions/runs/500526558?check_suite_focus=true#step:16:127
```
Failures:

  1) Bundler.setup when Bundler is bundled doesn't blow up
     Failure/Error: expect(err).to be_empty

       expected `"fatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (o...the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git".empty?` to return true, got false

       Commands:
       $ /home/runner/work/actions/actions/snapshot-master/ruby \
         -I/home/runner/work/actions/actions/snapshot-master/lib:/home/runner/work/actions/actions/snapshot-master/spec/bundler \
         -rsupport/hax -rsupport/artifice/fail \
         /home/runner/work/actions/actions/snapshot-master/libexec/bundle install --retry 0
       Resolving dependencies...
       Using bundler 2.1.4
       Bundle complete! 1 Gemfile dependency, 1 gem now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       fatal: not a git repository (or any of the parent directories): .git
       fatal: not a git repository (or any of the parent directories): .git
       fatal: not a git repository (or any of the parent directories): .git
       # $? => 0

       $ /home/runner/work/actions/actions/snapshot-master/ruby \
         -I/home/runner/work/actions/actions/snapshot-master/lib:/home/runner/work/actions/actions/snapshot-master/spec/bundler \
         -rsupport/hax -rsupport/artifice/fail \
         /home/runner/work/actions/actions/snapshot-master/libexec/bundle exec ruby -e \
         require\ \'bundler\'\;\ Bundler.setup
       fatal: not a git repository (or any of the parent directories): .git
       fatal: not a git repository (or any of the parent directories): .git
       fatal: not a git repository (or any of the parent directories): .git
       # $? => 0
     # ./spec/bundler/runtime/setup_spec.rb:1056:in `block (3 levels) in <top (required)>'
     # ./spec/bundler/spec_helper.rb:111:in `block (3 levels) in <top (required)>'
     # ./spec/bundler/spec_helper.rb:111:in `block (2 levels) in <top (required)>'
     # ./spec/bundler/spec_helper.rb:78:in `block (2 levels) in <top (required)>'
make: *** [yes-test-bundler] Error 1
```
2020-03-12 19:17:08 +09:00
Kazuki Yamaguchi e4a26cd4f8 openssl: sync with upstream repository
Import current master (2c43241dc0ed) of ruby/openssl.git.

Below are the commits that were made since the last batch at commit
b99775b163 (ruby/openssl.git commit f49e7110ca1e). Note that some of
them have been applied already.

----------------------------------------------------------------
Benoit Daloze (1):
      Remove redundant and ignored workflow file

DBL-Lee (1):
      add support for SHA512_256/SHA512_224

Hiroshi SHIBATA (2):
      Guard for OpenSSL::PKey::EC::Group::Error with unsupported platforms
      Fixed inconsistency directory structure with ruby/ruby repo

Jeremy Evans (2):
      Fix keyword argument separation issues in OpenSSL::SSL::SSLSocket#sys{read,write}_nonblock
      Remove taint support

Kazuki Yamaguchi (26):
      config: support .include directive
      random: make OpenSSL::Random.pseudo_bytes alias of .random_bytes
      extconf.rb: get rid of -Werror=deprecated-declarations
      test/openssl/test_ssl: skip test_fallback_scsv if necessary
      ts: simplify OpenSSL::Timestamp::Request#algorithm
      History.md: add missing references to GitHub issues
      config: deprecate OpenSSL::Config#add_value and #[]=
      test/openssl/test_ssl: remove sleep from test_finished_messages
      test/openssl/test_ssl: fix random failure in SSLSocket.open test
      test/openssl/test_ssl: avoid explicitly-sized private keys
      test/openssl/test_ssl: remove commented-out test case
      test/openssl/test_ssl: allow kRSA tests to fail
      ssl: avoid declarations after statements
      engine: revert OpenSSL::Engine.load changes for cloudhsm
      engine: remove really outdated static engines
      engine: do not check for ENGINE_load_builtin_engines()
      engine: fix guards for 'dynamic' and 'cryptodev' engines
      lib/openssl.rb: require openssl/version.rb
      x509: add error code and verify flags constants
      ssl: set verify error code in the case of verify_hostname failure
      .github/workflows: merge CI jobs into a single workflow
      .github/workflows: test against different OpenSSL versions
      .travis.yml: fully migrate to GitHub Actions
      ssl: suppress test failure with SSLContext#add_certificate_chain_file
      ssl: remove test case test_puts_meta from test_pair
      Revert "Use version.rb in gemspec"

MSP-Greg (2):
      .travis.yml - remove 2.3/1.0.2, 2.5/1.1.1, head/1.0.2
      Use version.rb in gemspec

Samuel Williams (1):
      Restore compatibility with older versions of Ruby.

Yusuke Endoh (1):
      Make OpenSSL::OSSL#test_memcmp_timing robust
2020-03-10 17:41:01 +09:00
Kazuki Yamaguchi 28f3e03880 digest: do not depend on ext/openssl/deprecation.rb
ext/openssl/deprecation.rb has been removed in ext/openssl upstream[1].

It was originally introduced to detect and prevent linking against
Apple's bundled (and very outdated) version of OpenSSL. It is long gone
and the header files do not exist in current versions of macOS.

The dependency in ext/digest was introduced by commit 26e258c807.
Note that the original issue[2] is resolved without this dependency.
The commit also added the pkg_config("openss") call to match what
ext/openssl does.

[1] https://github.com/ruby/openssl/pull/333
[2] https://bugs.ruby-lang.org/issues/6379
2020-03-10 17:41:01 +09:00
Jeremy Evans 040cfc89b9 Do not set USE_FFI_CLOSURE_ALLOC=1 in fiddle on OpenBSD
On OpenBSD, USE_FFI_CLOSURE_ALLOC was always set to 0 previously. In
633a1f15d8, the code was modified in a
way that it ended up being set to 1 on OpenBSD.  However, that results
in SIGABRT when running make test-all, inside ffi_closure_free.
Setting USE_FFI_CLOSURE_ALLOC back to 0 fixes the issue.
2020-03-08 17:47:48 -07:00
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

https://rubyci.org/logs/rubyci.s3.amazonaws.com/osx1014/ruby-master/log/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
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/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
https://github.com/ruby/io-console/commit/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

https://github.com/ruby/openssl/commit/890a6476fa
2020-02-17 20:50:47 +09:00
Nobuyoshi Nakada dec802d8b5 [ruby/io-console] [DOC] Improved about `intr:`
https://github.com/ruby/io-console/commit/82b630cd79
2020-02-17 12:05:09 +09:00