summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2022-10-05Removed the related files for downloading with extlibsHiroshi SHIBATA
2022-10-02[DOC] RDoc changes for IO (#6458)Burdette Lamar
Moves Expect library doc into io.c. Changes certain links to local sections, now pointing to sections in doc/io_streams.rdoc. Removes local sections now superseded by sections in doc/io_streams.rdoc. Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-09-30Revert "This commit implements the Object Shapes technique in CRuby."Aaron Patterson
This reverts commit 68bc9e2e97d12f80df0d113e284864e225f771c2.
2022-09-29[ruby/date] The shrunk words to be copied is limitedNobuyoshi Nakada
Th buffer size is small enough and no need to allocate dynamically. https://github.com/ruby/date/commit/f62bf0a01d
2022-09-29[ruby/date] Narrow ALLOCV region for shrunk wordsNobuyoshi Nakada
https://github.com/ruby/date/commit/f51b038074
2022-09-29Add `Coverage.supported?` to detect what modes are supported.Samuel Williams
2022-09-29Add `eval: true/false` flag to `Coverage.setup`.Samuel Williams
2022-09-28This commit implements the Object Shapes technique in CRuby.Jemma Issroff
Object Shapes is used for accessing instance variables and representing the "frozenness" of objects. Object instances have a "shape" and the shape represents some attributes of the object (currently which instance variables are set and the "frozenness"). Shapes form a tree data structure, and when a new instance variable is set on an object, that object "transitions" to a new shape in the shape tree. Each shape has an ID that is used for caching. The shape structure is independent of class, so objects of different types can have the same shape. For example: ```ruby class Foo def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end class Bar def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end foo = Foo.new # `foo` has shape id 2 bar = Bar.new # `bar` has shape id 2 ``` Both `foo` and `bar` instances have the same shape because they both set instance variables of the same name in the same order. This technique can help to improve inline cache hits as well as generate more efficient machine code in JIT compilers. This commit also adds some methods for debugging shapes on objects. See `RubyVM::Shape` for more details. For more context on Object Shapes, see [Feature: #18776] Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com> Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-28[ruby/date] Check time zone offset elementsNobuyoshi Nakada
Too big parts of fractional hour time zone offset can cause assertion failures. https://github.com/ruby/date/commit/06bcfb2729
2022-09-28[ruby/bigdecimal] Document precision=0 and ndigits=0 for converting from FloatMaciej Rzasa
https://github.com/ruby/bigdecimal/commit/4f0894c6c0
2022-09-28[ruby/psych] Bump snakeyaml from 1.31 to 1.33Chad Wilson
https://github.com/ruby/psych/commit/8a761cdfb7
2022-09-26Revert this until we can figure out WB issues or remove shapes from GCAaron Patterson
Revert "* expand tabs. [ci skip]" This reverts commit 830b5b5c351c5c6efa5ad461ae4ec5085e5f0275. Revert "This commit implements the Object Shapes technique in CRuby." This reverts commit 9ddfd2ca004d1952be79cf1b84c52c79a55978f4.
2022-09-26This commit implements the Object Shapes technique in CRuby.Jemma Issroff
Object Shapes is used for accessing instance variables and representing the "frozenness" of objects. Object instances have a "shape" and the shape represents some attributes of the object (currently which instance variables are set and the "frozenness"). Shapes form a tree data structure, and when a new instance variable is set on an object, that object "transitions" to a new shape in the shape tree. Each shape has an ID that is used for caching. The shape structure is independent of class, so objects of different types can have the same shape. For example: ```ruby class Foo def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end class Bar def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end foo = Foo.new # `foo` has shape id 2 bar = Bar.new # `bar` has shape id 2 ``` Both `foo` and `bar` instances have the same shape because they both set instance variables of the same name in the same order. This technique can help to improve inline cache hits as well as generate more efficient machine code in JIT compilers. This commit also adds some methods for debugging shapes on objects. See `RubyVM::Shape` for more details. For more context on Object Shapes, see [Feature: #18776] Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com> Co-Authored-By: John Hawthorn <john@hawthorn.email> Notes: Merged: https://github.com/ruby/ruby/pull/6386
2022-09-25[ruby/bigdecimal] Remove trailing whitespace.Samuel Williams
https://github.com/ruby/bigdecimal/commit/223d193f01
2022-09-25[ruby/bigdecimal] Improve documentation of BigDecimal#sign Maciek Rząsa
Fixes https://github.com/ruby/bigdecimal/issues/78 by describing behaviour for positive and negative zero in the docs. https://github.com/ruby/bigdecimal/commit/5415b120ab
2022-09-21sockopt adding Linux constants, SO_INCOMING_CPU/SO_INCOMING_NAPI_ID.David Carlier
2022-09-21openbsd sockets add SO_RTABLE constantDavid Carlier
Notes: Merged: https://github.com/ruby/ruby/pull/4635
2022-09-21Introduces FreeBSD's SO_USER_COOKIE among socketopt's options.David Carlier
Notes: Merged: https://github.com/ruby/ruby/pull/4206
2022-09-21sockets add `TCP_CONNECTION_INFO` and `TCP_KEEPALIVE` constants.David CARLIER
Notes: Merged: https://github.com/ruby/ruby/pull/5871
2022-09-21socket add FreeBSD's SO_SETFIB constant.David CARLIER
Notes: Merged: https://github.com/ruby/ruby/pull/5917
2022-09-21proper function prototypes for openssl卜部昌平
Just to reroute compiler warnings. Notes: Merged: https://github.com/ruby/ruby/pull/6358
2022-09-21getenv: is in stdlib.h卜部昌平
getenv is a very basic function that has been in stdlib.h since ISO/IEC 9899:1990. There is absolutely zero need for us to redeclare. pty.c already includes stdlib.h out of the box so we need nothing. Notes: Merged: https://github.com/ruby/ruby/pull/6358
2022-09-21reserved_word: just use gperf 3.1 declaration卜部昌平
The reason why this was commented out was because of gperf 3.0 vs 3.1 differences (see [Feature #13883]). Five years passed, I am pretty confident that we can drop support of old versions here. Ditto for uniname2ctype_p(), onig_jis_property(), and zonetab(). Notes: Merged: https://github.com/ruby/ruby/pull/6358
2022-09-20[DOC] socket: fix wrong sample addresses (#6372)Sutou Kouhei
IPv6 link local address is fe80::/10 not ff80::/10: https://www.rfc-editor.org/rfc/rfc4291.html Link-Local unicast 1111111010 FE80::/10 2.5.6 IPv6 (deprecated) site local address is fec0::/10 not ffc0::/10: https://www.rfc-editor.org/rfc/rfc3513.html Site-local unicast 1111111011 FEC0::/10 2.5.6 Notes: Merged-By: kou <kou@clear-code.com>
2022-09-20Quiet if the target is already linked the same sourceNobuyoshi Nakada
2022-09-20[ruby/psych] Convert some of Parser#parse to RubyAaron Patterson
This commit just converts some of the parse method to Ruby https://github.com/ruby/psych/commit/bca7d2c549
2022-09-19[ruby/bigdecimal] Remove symbol defs in missing.h for old RubiesPeter Zhu
Commit 2885514 added these to support Ruby 2.1. The rb_sym2str function is defined since Ruby 2.2. https://github.com/ruby/bigdecimal/commit/be366c9cf2
2022-09-19[ruby/bigdecimal] Remove array defs in missing.h for old RubiesPeter Zhu
Commit 02b6053 added these to support Ruby 2.0.0. The rb_array_const_ptr function is defined since Ruby 2.3. https://github.com/ruby/bigdecimal/commit/678699ca1b
2022-09-11[ruby/fiddle] Fix PACK_MAP for unsigned types ↵Takashi Kokubun
(https://github.com/ruby/fiddle/pull/110) https://github.com/ruby/fiddle/commit/4a71246645ccff001292c9d80b855b2ef5bf06c1
2022-09-09No longer bundle external library sourcesNobuyoshi Nakada
2022-09-08Process token IDs from id.def without id.hNobuyoshi Nakada
Fixes id.h error during updating ripper.c by `make after-update`. While it used to update id.h in the build directory, but was trying to update ripper.c in the source directory. In principle, files in the source directory can or should not depend on files in the build directory.
2022-09-07[ruby/psych] Bump snakeyaml from 1.28 to 1.31Chad Wilson
Resolves CVE-2022-25857, among other fixes. https://github.com/ruby/psych/commit/918cd25d37
2022-09-07[ruby/psych] Dump Date/DateTime as proleptic Gregorian date as well as TimeNobuyoshi Nakada
Fix ruby/psych#572 https://github.com/ruby/psych/commit/92304269bc
2022-08-18[Bug #18964] Update the code range of appended portionNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6250
2022-08-18ext/pty/extconf.rb: Try libutil only on OpenBSDYusuke Endoh
icc now seems to provide libutil.so that is not related to pty. This extconf.rb wrongly finds it and adds `-lutil`, but `ruby -rpty` fails because it cannot find libutil.so on the runtime. http://rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20220815T210005Z.fail.html.gz ``` Exception raised: <#<LoadError: libutil.so: cannot open shared object file: No such file or directory - /home/chkbuild/chkbuild/tmp/build/20220815T210005Z/ruby/.ext/x86_64-linux/pty.so>> ``` This change makes extconf.rb check libutil only on OpenBSD. Notes: Merged: https://github.com/ruby/ruby/pull/6249
2022-08-16[ruby/cgi] Implement `CGI.url_encode` and `CGI.url_decode`Jean Boussier
[Feature #18822] Ruby is somewhat missing an RFC 3986 compliant escape method. https://github.com/ruby/cgi/commit/c2729c7f33
2022-08-15[ruby/date] [DOC] Enhanced intro for Date (https://github.com/ruby/date/pull/72)Burdette Lamar
https://github.com/ruby/date/commit/59a6673221
2022-08-12Stop defining `RUBY_ABI_VERSION` if released versionsNobuyoshi Nakada
As commented in include/ruby/internal/abi.h, since teeny versions of Ruby should guarantee ABI compatibility, `RUBY_ABI_VERSION` has no role in released versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/6231
2022-08-11Fix Array#[] with ArithmeticSequence with negative steps (#5739)Jeremy Evans
* Fix Array#[] with ArithmeticSequence with negative steps Previously, Array#[] when called with an ArithmeticSequence with a negative step did not handle all cases correctly, especially cases involving infinite ranges, inverted ranges, and/or exclusive ends. Fixes [Bug #18247] * Add Array#slice tests for ArithmeticSequence with negative step to test_array Add tests of rb_arithmetic_sequence_beg_len_step C-API function. * Fix ext/-test-/arith_seq/beg_len_step/depend * Rename local variables * Fix a variable name Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com> Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2022-08-09[ruby/psych] Raise specific error when an anchor isn't definedAlexander Momchilov
https://github.com/ruby/psych/commit/98fbd5247a
2022-08-09[ruby/psych] Raise specific error when aliases are not enabledAlexander Momchilov
https://github.com/ruby/psych/commit/0c11ddcf46
2022-08-08[ruby/date] bump up to 3.2.3Nobuyoshi Nakada
https://github.com/ruby/date/commit/dff37b3dd1
2022-08-08[ruby/date] Fix Time#to_datetime before calendar reformNobuyoshi Nakada
Time is always in the proleptic Gregorian calendar. Also DateTime#to_time should convert to the Gregorian calendar first, before extracting its components. https://bugs.ruby-lang.org/issues/18946#change-98527 https://github.com/ruby/date/commit/b2aee75248
2022-08-07[DOC] New doc about Julian/Gregorian (#70)Burdette Lamar
2022-08-07Create temporary file exclusively and cleanNobuyoshi Nakada
2022-08-04Resolve abi symbol references from miniruby to avoid circular depsYuta Saito
Adding `ruby` to `PREP` causes the following circular dependencies because `PREP` is used as a prerequisite by some targets required to build `ruby` target itself. ``` make: Circular .rbconfig.time <- ruby dependency dropped. make: Circular builtin_binary.inc <- ruby dependency dropped. make: Circular ext/extinit.c <- ruby dependency dropped. make: Circular ruby <- ruby dependency dropped. ``` Adding a new Make variable like `EXTPREP` only for exts may be also reasonable, but it would introduce another complexity into our build system. `-bundle_loader` doesn't care that link-time and run-time loader executables are different as long as bound symbols are provided, so it's ok to resolve from miniruby to simplify our build. Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Use $(bindir) for path to executable in mkmfAlan Wu
For the macOS -bundle_loader linker option, we need a path to the Ruby exectuable. $(RUBY) is not necessarily a path since it could be a command line invocation. That happens during build with runruby.rb and can happen post installation if the user passes the --ruby option to a extconf.rb. Use $(bindir) to locate the executable instead. Before installation, $(bindir) doesn't exist, so we need to be able to override $(BUILTRUBY) in such situations so test-spec and bundled extensions could build. Use a new mkmf global, $builtruby, to do this; set it in fake.rb and in extmk.rb. Our build system is quite complex... Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Link ext bundles with bundle loader option for newer ld64Yuta Saito
ld64 shipped with Xcode 14 emits a warning when using `-undefined dynamic_lookup`. ``` ld: warning: -undefined dynamic_lookup may not work with chained fixups ``` Actually, `-undefined dynamic_lookup` doesn't work when: 1. Link a *shared library* with the option 2. Link it with a program that uses the chained-fixup introduced from macOS 12 and iOS 15 because `-undefined dynamic_lookup` uses lazy-bindings and they won't be bound while dyld fixes-up by traversing chained-fixup info. However, we build exts as *bundles* and they are loaded only through `dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory. So the warning produced by ld64 is false-positive, and it results failure of option checking in configuration. Therefore, it would be an option to ignore the warning during our configuration. On the other hand, `-undefined dynamic_lookup` is already deprecated on all darwin platforms except for macOS, so it's good time to get rid of the option. ld64 also provides `-bundle_loader <executable>` option, which allows to resolve symbols defined in the executable symtab while linking. It behaves almost the same with `-undefined dynamic_lookup`, but it makes the following changes: 1. Require that unresolved symbols among input objects must be defined in the executable. 2. Lazy symbol binding will lookup only the symtab of the bundle loader executable. (`-undefined dynamic_lookup` lookups all symtab as flat namespace) This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC configuration by assuming ruby executable can be linked before building exts. See "New Features" subsection under "Linking" section for chained fixup https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-03[ruby/bigdecimal] Updated to use the correct spec for muilti licenseThomas Winsnes
https://github.com/ruby/bigdecimal/commit/13165b29b8
2022-08-03Updated to use multiple licensesThomas Winsnes
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>