aboutsummaryrefslogtreecommitdiffstats
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Unify length field for embedded and heap strings (#7908)Peter Zhu2023-06-061-3/+2
| | | | | | | | * Unify length field for embedded and heap strings The length field is of the same type and position in RString for both embedded and heap allocated strings, so we can unify it. * Remove RSTRING_EMBED_LEN
* Revert "Revert "Fix cvar caching when class is cloned""eileencodes2023-06-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 10621f7cb9a0c70e568f89cce47a02e878af6778. This was reverted because the gc integrity build started failing. We have figured out a fix so I'm reopening the PR. Original commit message: Fix cvar caching when class is cloned The class variable cache that was added in ruby#4544 changed the behavior of class variables on cloned classes. As reported when a class is cloned AND a class variable was set, and the class variable was read from the original class, reading a class variable from the cloned class would return the value from the original class. This was happening because the IC (inline cache) is stored on the ISEQ which is shared between the original and cloned class, therefore they share the cache too. To fix this we are now storing the `cref` in the cache so that we can check if it's equal to the current `cref`. If it's different we don't want to read from the cache. If it's the same we do. Cloned classes don't share the same cref with their original class. This will need to be backported to 3.1 in addition to 3.2 since the bug exists in both versions. We also added a marking function which was missing. Fixes [Bug #19379] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* Ripper does not depend on Bison [ci skip]yui-knk2023-06-031-1/+0
| | | | It also uses Lrama then no dependency on Bison.
* [ruby/stringio] Development of 3.0.8 started.Hiroshi SHIBATA2023-06-021-1/+1
| | | | https://github.com/ruby/stringio/commit/1587d3698e
* No need to define "BISON" on extconf.rbyui-knk2023-06-021-10/+1
| | | | "BISON" is defined in "ext/ripper/depend".
* Revert "Fix cvar caching when class is cloned"Aaron Patterson2023-06-011-5/+0
| | | | This reverts commit 77d1b082470790c17c24a2f406b4fec5d522636b.
* Fix cvar caching when class is clonedeileencodes2023-06-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The class variable cache that was added in https://github.com/ruby/ruby/pull/4544 changed the behavior of class variables on cloned classes. As reported when a class is cloned AND a class variable was set, and the class variable was read from the original class, reading a class variable from the cloned class would return the value from the original class. This was happening because the IC (inline cache) is stored on the ISEQ which is shared between the original and cloned class, therefore they share the cache too. To fix this we are now storing the `cref` in the cache so that we can check if it's equal to the current `cref`. If it's different we don't want to read from the cache. If it's the same we do. Cloned classes don't share the same cref with their original class. This will need to be backported to 3.1 in addition to 3.2 since the bug exists in both versions. We also added a marking function which was missing. Fixes [Bug #19379] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* [ruby/stringio] Avoid direct struct usage.Samuel Williams2023-06-011-2/+2
| | | | | | | (https://github.com/ruby/stringio/pull/54) We will eventually want to refactor this, but for now this is compatible enough.
* Restores the changes in `io-console` without breaking backwards ↵Samuel Williams2023-06-012-191/+171
| | | | | | | | compatibility. (#7882) This reverts commit 35da41b29bf0a1a8fd2cd7e1d7fcb036ca8c2c7c. This updates `io-console` to avoid accessing the internal details of `rb_io_t` and instead use `rb_io_descriptor` and `rb_io_path` etc.
* Hide the usage of `rb_io_t` where possible. (#7880)Samuel Williams2023-06-011-31/+23
| | | This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
* Revert https://github.com/ruby/io-console/pull/43Hiroshi SHIBATA2023-06-012-171/+191
| | | | | | | This reverts commit 1889133c04f337fec3969cb5040a544088249046 and commit 764207e47ce38d1b73774a8e65114c87bc888298. Followed up with https://github.com/ruby/ruby/commit/85dcc4866d9ff29834596e9186cc97d622ee06f8
* Revert "Hide most of the implementation of `struct rb_io`. (#6511)"NARUSE, Yui2023-06-014-27/+33
| | | | | | | | | This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2. fix [Bug #19704] https://bugs.ruby-lang.org/issues/19704 This breaks compatibility for extension libraries. Such changes need a discussion.
* [ruby/io-nonblock] Add TruffleRuby support and add it in CIBenoit Daloze2023-05-301-0/+5
| | | | | | * Do not use a C extension on TruffleRuby for these 3 methods. https://github.com/ruby/io-nonblock/commit/1b8e52abfa
* [ruby/io-nonblock] Use the correct pattern for the fallback of ↵Benoit Daloze2023-05-301-1/+2
| | | | | | | | rb_io_descriptor() * See https://github.com/ruby/io-console/pull/43/commits/d1d9aef45ceb14365fdf0ebee3e5ea06f27da682 https://github.com/ruby/io-nonblock/commit/dadb42422b
* Hide most of the implementation of `struct rb_io`. (#6511)Samuel Williams2023-05-304-33/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add rb_io_path and rb_io_open_descriptor. * Use rb_io_open_descriptor to create PTY objects * Rename FMODE_PREP -> FMODE_EXTERNAL and expose it FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but FMODE_EXTERNAL is clearer about what the file descriptor represents and aligns with language in the IO::Buffer module. * Ensure that rb_io_open_descriptor closes the FD if it fails If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be responsible for closing your file, eventually, if you pass it to rb_io_open_descriptor, even if it raises an exception. * Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P * Expose `rb_io_closed_p`. * Add `rb_io_mode` to get IO mode. --------- Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
* [ruby/cgi] Add TruffleRuby support and add it in CIBenoit Daloze2023-05-291-1/+5
| | | | https://github.com/ruby/cgi/commit/1240fec9c9
* [ruby/etc] Use the correct pattern for the fallback of rb_io_descriptor()Benoit Daloze2023-05-291-1/+2
| | | | | | * See https://github.com/ruby/io-console/pull/43/commits/d1d9aef45ceb14365fdf0ebee3e5ea06f27da682 https://github.com/ruby/etc/commit/5185685003
* [ruby/openssl] Remove usage of IO internals.Samuel Williams2023-05-292-20/+33
|
* [ruby/io-console] Remove trailing whitespace.Samuel Williams2023-05-291-1/+1
| | | | https://github.com/ruby/io-console/commit/55f1586463
* [ruby/io-console] Remove usage of IO internals.Samuel Williams2023-05-292-192/+172
| | | | | | | | (https://github.com/ruby/io-console/pull/43) https://github.com/ruby/io-console/commit/4b839a504f Co-authored-by: Benoit Daloze <eregontp@gmail.com>
* [ruby/io-nonblock] Remove usage of IO internals.Samuel Williams2023-05-282-25/+40
| | | | | | (https://github.com/ruby/io-nonblock/pull/11) https://github.com/ruby/io-nonblock/commit/caa2b94d19
* [ruby/io-nonblock] Revert "Remove usage of IO internals."Samuel Williams2023-05-282-33/+23
| | | | | | This reverts commit https://github.com/ruby/io-nonblock/commit/9772b6dcb63c. https://github.com/ruby/io-nonblock/commit/08cabf78e1
* [ruby/io-nonblock] Remove usage of IO internals.Samuel Williams2023-05-282-23/+33
| | | | https://github.com/ruby/io-nonblock/commit/9772b6dcb6
* [ruby/io-wait] Remove usage of IO internals.Samuel Williams2023-05-282-2/+10
| | | | | | (https://github.com/ruby/io-wait/pull/25) https://github.com/ruby/io-wait/commit/e5854b46c7
* [ruby/etc] Remove usage of IO internals.Samuel Williams2023-05-282-4/+12
| | | | | | (https://github.com/ruby/etc/pull/26) https://github.com/ruby/etc/commit/ea15eceb13
* [ruby/nkf] Bump up nkf-0.1.3Hiroshi SHIBATA2023-05-251-1/+1
| | | | https://github.com/ruby/nkf/commit/bc90e2ed39
* [ruby/nkf] Added mission extension configurationHiroshi SHIBATA2023-05-251-0/+1
| | | | https://github.com/ruby/nkf/commit/e627a39dff
* [flori/json] Call `super` in `included` hookUfuk Kayserilioglu2023-05-241-0/+1
| | | | | | | | | | The C extension defines an `included` hook for the `JSON::Ext::Generator::GeneratorMethods::String` module but neglects to call `super` in the hook. This can break the functionality of various other code that rely on the fact that `included` on `Module` will always be called. https://github.com/flori/json/commit/cd8bbe56a3
* `rb_bug` prints a newline after the messageNobuyoshi Nakada2023-05-202-16/+16
|
* [ruby/openssl] Fix warnings about the OPENSSL_FIPS macro in OpenSSL 1.1.Jun Aruga2023-05-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit <https://github.com/ruby/openssl/commit/c5b2bc1268bc> made the warnings below in the case of OpenSSL 1.1 where the `OPENSSL_FIPS` macro is not defined. ``` $ bundle install --standalone $ bundle exec rake compile -- \ --with-openssl-dir=$HOME/.local/openssl-1.1.1t-debug \ --with-cflags="-Wundef" mkdir -p tmp/x86_64-linux/openssl/3.2.1 cd tmp/x86_64-linux/openssl/3.2.1 /usr/local/ruby-3.2.1/bin/ruby -I. -r.rake-compiler-siteconf.rb ../../../../ext/openssl/extconf.rb -- --with-openssl-dir=/home/jaruga/.local/openssl-1.1.1t-debug --with-cflags=-Wundef ... gcc -I. -I/usr/local/ruby-3.2.1/include/ruby-3.2.0/x86_64-linux -I/usr/local/ruby-3.2.1/include/ruby-3.2.0/ruby/backward -I/usr/local/ruby-3.2.1/include/ruby-3.2.0 -I../../../../ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -I/home/jaruga/.local/openssl-1.1.1t-debug/include -fPIC -Wundef -o ossl.o -c ../../../../ext/openssl/ossl.c ../../../../ext/openssl/ossl.c: In function ‘ossl_fips_mode_get’: ../../../../ext/openssl/ossl.c:425:7: warning: "OPENSSL_FIPS" is not defined, evaluates to 0 [-Wundef] 425 | #elif OPENSSL_FIPS | ^~~~~~~~~~~~ ../../../../ext/openssl/ossl.c: In function ‘ossl_fips_mode_set’: ../../../../ext/openssl/ossl.c:460:7: warning: "OPENSSL_FIPS" is not defined, evaluates to 0 [-Wundef] 460 | #elif OPENSSL_FIPS | ^~~~~~~~~~~~ ../../../../ext/openssl/ossl.c: In function ‘Init_openssl’: ../../../../ext/openssl/ossl.c:1218:7: warning: "OPENSSL_FIPS" is not defined, evaluates to 0 [-Wundef] 1218 | #elif OPENSSL_FIPS | ^~~~~~~~~~~~ ... cp tmp/x86_64-linux/openssl/3.2.1/openssl.so tmp/x86_64-linux/stage/lib/openssl.so ``` https://github.com/ruby/openssl/commit/b4228cbcd6
* [ruby/openssl] Implement FIPS functions on OpenSSL 3.Jun Aruga2023-05-191-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is to implement the `OpenSSL::OPENSSL_FIPS`, `ossl_fips_mode_get` and `ossl_fips_mode_set` to pass the test `test/openssl/test_fips.rb`. It seems that the `OPENSSL_FIPS` macro is not used on the FIPS mode case any more, and some FIPS related APIs also were removed in OpenSSL 3. See the document <https://github.com/openssl/openssl/blob/master/doc/man7/migration_guide.pod#removed-fips_mode-and-fips_mode_set> the section OPENSSL 3.0 > Main Changes from OpenSSL 1.1.1 > Other notable deprecations and changes - Removed FIPS_mode() and FIPS_mode_set() . The `OpenSSL::OPENSSL_FIPS` returns always true in OpenSSL 3 because the used functions `EVP_default_properties_enable_fips` and `EVP_default_properties_is_fips_enabled` works with the OpenSSL installed without FIPS option. The `TEST_RUBY_OPENSSL_FIPS_ENABLED` is set on the FIPS mode case on the CI. Because I want to test that the `OpenSSL.fips_mode` returns the `true` or 'false' surely in the CI. You can test the FIPS mode case by setting `TEST_RUBY_OPENSSL_FIPS_ENABLED` on local too. Right now I don't find a better way to get the status of the FIPS mode enabled or disabled for this purpose. I am afraid of the possibility that the FIPS test case is unintentionally skipped. I also replaced the ambiguous "returns" with "should return" in the tests. https://github.com/ruby/openssl/commit/c5b2bc1268
* Process parse.y without temporary filesNobuyoshi Nakada2023-05-151-1/+1
|
* Add user argument to some macros used by bisonNobuyoshi Nakada2023-05-141-4/+1
|
* Preprocess input parse.y from stdinNobuyoshi Nakada2023-05-142-19/+26
|
* Use Lrama LALR parser generator instead of Bisonv3_3_0_preview1Yuichiro Kaneko2023-05-122-5/+7
| | | | | https://bugs.ruby-lang.org/issues/19637 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* Extract ext/readlineHiroshi SHIBATA2023-05-098-2867/+0
|
* [ruby/stringio] Drop support for ruby 2.6 or earlierNobuyoshi Nakada2023-05-083-83/+1
| | | | | | (https://github.com/ruby/stringio/pull/47) `rb_io_extract_modeenc` has been exported since ruby 2.7.
* Redirect to `IO::NULL` for the portabilityNobuyoshi Nakada2023-05-051-1/+1
|
* [ruby/stringio] Update write-barrier at copyingNobuyoshi Nakada2023-05-031-3/+7
| | | | | | | | | | | http://ci.rvm.jp/results/trunk-asserts@ruby-sp2-docker/4552803 ``` verify_internal_consistency_reachable_i: WB miss (O->Y) 0x00007f752ddd5550 [3LM ] strio (StringIO)strio -> 0x00007f752d19b7d0 [0 ] T_STRING (String) len: 8, capa: 15 "to_strio" <internal:/tmp/ruby/src/trunk-asserts/lib/rubygems/core_ext/kernel_require.rb>:53: [BUG] gc_verify_internal_consistency: found internal inconsistency. ``` https://github.com/ruby/stringio/commit/2e8ab43cba
* [ruby/syslog] Improve the version extractionAkinori MUSHA2023-04-251-9/+3
| | | | https://github.com/ruby/syslog/commit/34da65a002
* [ruby/syslog] Raise required_ruby_versionAkinori MUSHA2023-04-251-1/+1
| | | | https://github.com/ruby/syslog/commit/5289373016
* [ruby/syslog] Expose Syslog::VERSIONHiroshi SHIBATA2023-04-252-1/+16
| | | | https://github.com/ruby/syslog/commit/ff5d72fcb9
* [ruby/win32ole] Reuse WIN32OLE_VERSION for gem versionHiroshi SHIBATA2023-04-212-2/+12
| | | | https://github.com/ruby/win32ole/commit/bff3ea8b0b
* [ruby/fcntl] Expose Fcntl::VERSIONHiroshi SHIBATA2023-04-212-1/+17
| | | | https://github.com/ruby/fcntl/commit/cb8e414e9f
* [ruby/stringio] Development of 3.0.7 started.Sutou Kouhei2023-04-141-1/+1
| | | | https://github.com/ruby/stringio/commit/5d39880f70
* [ruby/readline-ext] Expose Readline::GEM_VERSIONHiroshi SHIBATA2023-04-142-1/+15
| | | | https://github.com/ruby/readline-ext/commit/70aa84b80e
* [ruby/nkf] Expose NKF::GEM_VERSIONHiroshi SHIBATA2023-04-142-1/+14
| | | | https://github.com/ruby/nkf/commit/0d0fb3a162
* [ruby/pathname] Expose Pathname::VERSIONHiroshi SHIBATA2023-04-142-2/+11
| | | | https://github.com/ruby/pathname/commit/2b0b1a82ee
* [ruby/bigdecimal] fix: typo in document comments of `f_BigDecimal` functionHoNooD2023-04-081-1/+1
| | | | https://github.com/ruby/bigdecimal/commit/13abe1fd78
* [ruby/bigdecimal] Remove set but unused variableNobuyoshi Nakada2023-04-081-7/+0
| | | | | | This `prec` has not been used since https://github.com/ruby/bigdecimal/commit/1f5c46dbdd1c. https://github.com/ruby/bigdecimal/commit/08a0ad563d