diff --git a/.github/workflows/zjit-macos.yml b/.github/workflows/zjit-macos.yml index 30024a6d0c9d1b..ab922849f45373 100644 --- a/.github/workflows/zjit-macos.yml +++ b/.github/workflows/zjit-macos.yml @@ -32,7 +32,7 @@ jobs: fail-fast: false matrix: include: - - test_task: 'zjit-test' + - test_task: 'zjit-check' configure: '--enable-yjit=dev --enable-zjit' - test_task: 'ruby' # build test for combo build @@ -84,7 +84,7 @@ jobs: - uses: taiki-e/install-action@v2 with: tool: nextest@0.9 - if: ${{ matrix.test_task == 'zjit-test' }} + if: ${{ matrix.test_task == 'zjit-check' }} - name: Install Rust # TODO(alan): remove when GitHub images catch up past 1.85.0 run: rustup default 1.85.0 diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index de3e98d3585263..c16535c507c9b5 100644 --- a/.github/workflows/zjit-ubuntu.yml +++ b/.github/workflows/zjit-ubuntu.yml @@ -37,7 +37,7 @@ jobs: configure: '--enable-zjit=dev --with-gcc=clang-14' libclang_path: '/usr/lib/llvm-14/lib/libclang.so.1' - - test_task: 'zjit-test' + - test_task: 'zjit-check' configure: '--enable-yjit --enable-zjit=dev' - test_task: 'zjit-test-all' @@ -85,7 +85,7 @@ jobs: - uses: taiki-e/install-action@v2 with: tool: nextest@0.9 - if: ${{ matrix.test_task == 'zjit-test' }} + if: ${{ matrix.test_task == 'zjit-check' }} - uses: ./.github/actions/setup/directories diff --git a/class.c b/class.c index bef54eae2f38c1..24f61fd023e5fd 100644 --- a/class.c +++ b/class.c @@ -734,13 +734,13 @@ static void class_initialize_method_table(VALUE c) { // initialize the prime classext m_tbl - RCLASS_SET_M_TBL_EVEN_WHEN_PROMOTED(c, rb_id_table_create(0)); + RCLASS_SET_M_TBL(c, rb_id_table_create(0)); } static void class_clear_method_table(VALUE c) { - RCLASS_WRITE_M_TBL_EVEN_WHEN_PROMOTED(c, rb_id_table_create(0)); + RCLASS_WRITE_M_TBL(c, rb_id_table_create(0)); } static VALUE @@ -978,7 +978,7 @@ copy_tables(VALUE clone, VALUE orig) RCLASS_WRITE_CVC_TBL(clone, rb_cvc_tbl_dup); } rb_id_table_free(RCLASS_M_TBL(clone)); - RCLASS_WRITE_M_TBL_EVEN_WHEN_PROMOTED(clone, 0); + RCLASS_WRITE_M_TBL(clone, 0); if (!RB_TYPE_P(clone, T_ICLASS)) { rb_fields_tbl_copy(clone, orig); } @@ -1053,9 +1053,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig) struct clone_method_arg arg; arg.old_klass = orig; arg.new_klass = clone; - // TODO: use class_initialize_method_table() instead of RCLASS_SET_M_TBL_* - // after RCLASS_SET_M_TBL is protected by write barrier - RCLASS_SET_M_TBL_EVEN_WHEN_PROMOTED(clone, rb_id_table_create(0)); + class_initialize_method_table(clone); rb_id_table_foreach(RCLASS_M_TBL(orig), clone_method_i, &arg); } @@ -1081,9 +1079,6 @@ rb_mod_init_copy(VALUE clone, VALUE orig) rb_bug("non iclass between module/class and origin"); } clone_p = class_alloc(T_ICLASS, METACLASS_OF(p)); - /* We should set the m_tbl right after allocation before anything - * that can trigger GC to avoid clone_p from becoming old and - * needing to fire write barriers. */ RCLASS_SET_M_TBL(clone_p, RCLASS_M_TBL(p)); rb_class_set_super(prev_clone_p, clone_p); prev_clone_p = clone_p; @@ -1931,6 +1926,11 @@ ensure_origin(VALUE klass) rb_class_set_super(origin, RCLASS_SUPER(klass)); rb_class_set_super(klass, origin); // writes origin into RCLASS_SUPER(klass) RCLASS_WRITE_ORIGIN(klass, origin); + + // RCLASS_WRITE_ORIGIN marks origin as an origin, so this is the first + // point that it sees M_TBL and may mark it + rb_gc_writebarrier_remember(origin); + class_clear_method_table(klass); rb_id_table_foreach(RCLASS_M_TBL(origin), cache_clear_refined_method, (void *)klass); rb_id_table_foreach(RCLASS_M_TBL(origin), move_refined_method, (void *)klass); @@ -1968,7 +1968,7 @@ rb_prepend_module(VALUE klass, VALUE module) if (klass_had_no_origin && klass_origin_m_tbl == RCLASS_M_TBL(subclass)) { // backfill an origin iclass to handle refinements and future prepends rb_id_table_foreach(RCLASS_M_TBL(subclass), clear_module_cache_i, (void *)subclass); - RCLASS_WRITE_M_TBL_EVEN_WHEN_PROMOTED(subclass, klass_m_tbl); + RCLASS_WRITE_M_TBL(subclass, klass_m_tbl); VALUE origin = rb_include_class_new(klass_origin, RCLASS_SUPER(subclass)); rb_class_set_super(subclass, origin); RCLASS_SET_INCLUDER(origin, RCLASS_INCLUDER(subclass)); diff --git a/doc/string.rb b/doc/string.rb index ad1abf29b7f55b..9ed97d49f6fb95 100644 --- a/doc/string.rb +++ b/doc/string.rb @@ -334,7 +334,7 @@ # _Counts_ # # - #length (aliased as #size): Returns the count of characters (not bytes). -# - #empty?: Returns +true+ if +self.length+ is zero; +false+ otherwise. +# - #empty?: Returns whether the length of +self+ is zero. # - #bytesize: Returns the count of bytes. # - #count: Returns the count of substrings matching given strings. # diff --git a/doc/string/each_char.rdoc b/doc/string/each_char.rdoc index e5ae5a18129069..5aa85b28ad9dd1 100644 --- a/doc/string/each_char.rdoc +++ b/doc/string/each_char.rdoc @@ -1,17 +1,22 @@ -Calls the given block with each successive character from +self+; +With a block given, calls the block with each successive character from +self+; returns +self+: - 'hello'.each_char {|char| print char, ' ' } - print "\n" - 'тест'.each_char {|char| print char, ' ' } - print "\n" - 'こんにちは'.each_char {|char| print char, ' ' } - print "\n" + a = [] + 'hello'.each_char do |char| + a.push(char) + end + a # => ["h", "e", "l", "l", "o"] + a = [] + 'тест'.each_char do |char| + a.push(char) + end + a # => ["т", "е", "с", "т"] + a = [] + 'こんにちは'.each_char do |char| + a.push(char) + end + a # => ["こ", "ん", "に", "ち", "は"] -Output: +With no block given, returns an enumerator. - h e l l o - т е с т - こ ん に ち は - -Returns an enumerator if no block is given. +Related: see {Iterating}[rdoc-ref:String@Iterating]. diff --git a/doc/string/each_codepoint.rdoc b/doc/string/each_codepoint.rdoc index 88bfcbd1c0bea5..0e687082d3ed4c 100644 --- a/doc/string/each_codepoint.rdoc +++ b/doc/string/each_codepoint.rdoc @@ -1,18 +1,23 @@ -Calls the given block with each successive codepoint from +self+; -each codepoint is the integer value for a character; +With a block given, calls the block with each successive codepoint from +self+; +each {codepoint}[https://en.wikipedia.org/wiki/Code_point] is the integer value for a character; returns +self+: - 'hello'.each_codepoint {|codepoint| print codepoint, ' ' } - print "\n" - 'тест'.each_codepoint {|codepoint| print codepoint, ' ' } - print "\n" - 'こんにちは'.each_codepoint {|codepoint| print codepoint, ' ' } - print "\n" + a = [] + 'hello'.each_codepoint do |codepoint| + a.push(codepoint) + end + a # => [104, 101, 108, 108, 111] + a = [] + 'тест'.each_codepoint do |codepoint| + a.push(codepoint) + end + a # => [1090, 1077, 1089, 1090] + a = [] + 'こんにちは'.each_codepoint do |codepoint| + a.push(codepoint) + end + a # => [12371, 12435, 12395, 12385, 12399] -Output: +With no block given, returns an enumerator. - 104 101 108 108 111 - 1090 1077 1089 1090 - 12371 12435 12395 12385 12399 - -Returns an enumerator if no block is given. +Related: see {Iterating}[rdoc-ref:String@Iterating]. diff --git a/doc/string/each_grapheme_cluster.rdoc b/doc/string/each_grapheme_cluster.rdoc index 40be95fcaca237..8bc6f78aaa374d 100644 --- a/doc/string/each_grapheme_cluster.rdoc +++ b/doc/string/each_grapheme_cluster.rdoc @@ -1,12 +1,25 @@ -Calls the given block with each successive grapheme cluster from +self+ +With a block given, calls the given block with each successive grapheme cluster from +self+ (see {Unicode Grapheme Cluster Boundaries}[https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries]); returns +self+: - s = "\u0061\u0308-pqr-\u0062\u0308-xyz-\u0063\u0308" # => "ä-pqr-b̈-xyz-c̈" - s.each_grapheme_cluster {|gc| print gc, ' ' } + a = [] + 'hello'.each_grapheme_cluster do |grapheme_cluster| + a.push(grapheme_cluster) + end + a # => ["h", "e", "l", "l", "o"] -Output: + a = [] + 'тест'.each_grapheme_cluster do |grapheme_cluster| + a.push(grapheme_cluster) + end + a # => ["т", "е", "с", "т"] - ä - p q r - b̈ - x y z - c̈ + a = [] + 'こんにちは'.each_grapheme_cluster do |grapheme_cluster| + a.push(grapheme_cluster) + end + a # => ["こ", "ん", "に", "ち", "は"] -Returns an enumerator if no block is given. +With no block given, returns an enumerator. + +Related: see {Iterating}[rdoc-ref:String@Iterating]. diff --git a/doc/string/each_line.rdoc b/doc/string/each_line.rdoc index e254c22d406630..217c188e35fada 100644 --- a/doc/string/each_line.rdoc +++ b/doc/string/each_line.rdoc @@ -1,9 +1,12 @@ -With a block given, forms the substrings ("lines") +With a block given, forms the substrings (lines) that are the result of splitting +self+ -at each occurrence of the given line separator +line_sep+; +at each occurrence of the given +record_separator+; passes each line to the block; -returns +self+: +returns +self+. +With the default +record_separator+: + + $/ # => "\n" s = <<~EOT This is the first line. This is line two. @@ -11,7 +14,6 @@ returns +self+: This is line four. This is line five. EOT - s.each_line {|line| p line } Output: @@ -22,9 +24,10 @@ Output: "This is line four.\n" "This is line five.\n" -With a different +line_sep+: +With a different +record_separator+: - s.each_line(' is ') {|line| p line } + record_separator = ' is ' + s.each_line(record_separator) {|line| p line } Output: @@ -34,7 +37,7 @@ Output: "line four.\nThis is " "line five.\n" -With +chomp+ as +true+, removes the trailing +line_sep+ from each line: +With +chomp+ as +true+, removes the trailing +record_separator+ from each line: s.each_line(chomp: true) {|line| p line } @@ -46,11 +49,12 @@ Output: "This is line four." "This is line five." -With an empty string as +line_sep+, +With an empty string as +record_separator+, forms and passes "paragraphs" by splitting at each occurrence of two or more newlines: - s.each_line('') {|line| p line } + record_separator = '' + s.each_line(record_separator) {|line| p line } Output: @@ -58,3 +62,5 @@ Output: "This is line four.\nThis is line five.\n" With no block given, returns an enumerator. + +Related: see {Iterating}[rdoc-ref:String@Iterating]. diff --git a/encoding.c b/encoding.c index 7c54ba9177e10f..3be39d8e0965b9 100644 --- a/encoding.c +++ b/encoding.c @@ -1177,9 +1177,12 @@ rb_enc_copy(VALUE obj1, VALUE obj2) /* * call-seq: - * obj.encoding -> encoding + * encoding -> encoding * - * Returns the Encoding object that represents the encoding of obj. + * Returns an Encoding object that represents the encoding of +self+; + * see {Encodings}[rdoc-ref:encodings.rdoc]. + * + * Related: see {Querying}[rdoc-ref:String@Querying]. */ VALUE diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c index 5e183e78ed5352..a61b1acbb4e341 100644 --- a/ext/objspace/objspace.c +++ b/ext/objspace/objspace.c @@ -38,10 +38,11 @@ * information as only a *HINT*. Especially, the size of +T_DATA+ may not be * correct. * - * This method is only expected to work with C Ruby. + * This method is only expected to work with CRuby. * - * From Ruby 2.2, memsize_of(obj) returns a memory size includes - * sizeof(RVALUE). + * From Ruby 3.2 with Variable Width Allocation, it returns the actual slot + * size used plus any additional memory allocated outside the slot (such + * as external strings, arrays, or hash tables). */ static VALUE diff --git a/internal/class.h b/internal/class.h index f8cfba3fd963b4..520994170faa59 100644 --- a/internal/class.h +++ b/internal/class.h @@ -259,9 +259,6 @@ static inline void RCLASSEXT_SET_INCLUDER(rb_classext_t *ext, VALUE klass, VALUE static inline void RCLASS_SET_SUPER(VALUE klass, VALUE super); static inline void RCLASS_WRITE_SUPER(VALUE klass, VALUE super); -// TODO: rename RCLASS_SET_M_TBL_WORKAROUND (and _WRITE_) to RCLASS_SET_M_TBL with write barrier -static inline void RCLASS_SET_M_TBL_WORKAROUND(VALUE klass, struct rb_id_table *table, bool check_promoted); -static inline void RCLASS_WRITE_M_TBL_WORKAROUND(VALUE klass, struct rb_id_table *table, bool check_promoted); static inline void RCLASS_SET_CONST_TBL(VALUE klass, struct rb_id_table *table, bool shared); static inline void RCLASS_WRITE_CONST_TBL(VALUE klass, struct rb_id_table *table, bool shared); static inline void RCLASS_WRITE_CALLABLE_M_TBL(VALUE klass, struct rb_id_table *table); @@ -594,25 +591,15 @@ RCLASS_FIELDS_COUNT(VALUE obj) return 0; } -#define RCLASS_SET_M_TBL_EVEN_WHEN_PROMOTED(klass, table) RCLASS_SET_M_TBL_WORKAROUND(klass, table, false) -#define RCLASS_SET_M_TBL(klass, table) RCLASS_SET_M_TBL_WORKAROUND(klass, table, true) - static inline void -RCLASS_SET_M_TBL_WORKAROUND(VALUE klass, struct rb_id_table *table, bool check_promoted) +RCLASS_SET_M_TBL(VALUE klass, struct rb_id_table *table) { - RUBY_ASSERT(!check_promoted || !RB_OBJ_PROMOTED(klass)); RCLASSEXT_M_TBL(RCLASS_EXT_PRIME(klass)) = table; } -#define RCLASS_WRITE_M_TBL_EVEN_WHEN_PROMOTED(klass, table) RCLASS_WRITE_M_TBL_WORKAROUND(klass, table, false) -#define RCLASS_WRITE_M_TBL(klass, table) RCLASS_WRITE_M_TBL_WORKAROUND(klass, table, true) - static inline void -RCLASS_WRITE_M_TBL_WORKAROUND(VALUE klass, struct rb_id_table *table, bool check_promoted) +RCLASS_WRITE_M_TBL(VALUE klass, struct rb_id_table *table) { - RUBY_ASSERT(!check_promoted || !RB_OBJ_PROMOTED(klass)); - // TODO: add write barrier here to guard assigning m_tbl - // see commit 28a6e4ea9d9379a654a8f7c4b37fa33aa3ccd0b7 RCLASSEXT_M_TBL(RCLASS_EXT_WRITABLE(klass)) = table; } diff --git a/string.c b/string.c index ba04d42841bf27..58fe632463c50f 100644 --- a/string.c +++ b/string.c @@ -2417,12 +2417,13 @@ rb_str_bytesize(VALUE str) * call-seq: * empty? -> true or false * - * Returns +true+ if the length of +self+ is zero, +false+ otherwise: + * Returns whether the length of +self+ is zero: * - * "hello".empty? # => false - * " ".empty? # => false - * "".empty? # => true + * 'hello'.empty? # => false + * ' '.empty? # => false + * ''.empty? # => true * + * Related: see {Querying}[rdoc-ref:String@Querying]. */ static VALUE @@ -9677,8 +9678,8 @@ rb_str_enumerate_lines(int argc, VALUE *argv, VALUE str, VALUE ary) /* * call-seq: - * each_line(line_sep = $/, chomp: false) {|substring| ... } -> self - * each_line(line_sep = $/, chomp: false) -> enumerator + * each_line(record_separator = $/, chomp: false) {|substring| ... } -> self + * each_line(record_separator = $/, chomp: false) -> enumerator * * :include: doc/string/each_line.rdoc * @@ -9798,7 +9799,7 @@ rb_str_enumerate_chars(VALUE str, VALUE ary) /* * call-seq: - * each_char {|c| ... } -> self + * each_char {|char| ... } -> self * each_char -> enumerator * * :include: doc/string/each_char.rdoc @@ -9858,7 +9859,7 @@ rb_str_enumerate_codepoints(VALUE str, VALUE ary) /* * call-seq: - * each_codepoint {|integer| ... } -> self + * each_codepoint {|codepoint| ... } -> self * each_codepoint -> enumerator * * :include: doc/string/each_codepoint.rdoc @@ -10028,7 +10029,7 @@ rb_str_enumerate_grapheme_clusters(VALUE str, VALUE ary) /* * call-seq: - * each_grapheme_cluster {|gc| ... } -> self + * each_grapheme_cluster {|grapheme_cluster| ... } -> self * each_grapheme_cluster -> enumerator * * :include: doc/string/each_grapheme_cluster.rdoc diff --git a/test/.excludes-zjit/ErrorHighlightTest.rb b/test/.excludes-zjit/ErrorHighlightTest.rb new file mode 100644 index 00000000000000..2ddee303ddd871 --- /dev/null +++ b/test/.excludes-zjit/ErrorHighlightTest.rb @@ -0,0 +1 @@ +exclude(:test_local_variable_get, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/OSSL.rb b/test/.excludes-zjit/OpenSSL/OSSL.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/OSSL.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestASN1.rb b/test/.excludes-zjit/OpenSSL/TestASN1.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestASN1.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestBN.rb b/test/.excludes-zjit/OpenSSL/TestBN.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestBN.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestBuffering.rb b/test/.excludes-zjit/OpenSSL/TestBuffering.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestBuffering.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestCase.rb b/test/.excludes-zjit/OpenSSL/TestCase.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestCase.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestCipher.rb b/test/.excludes-zjit/OpenSSL/TestCipher.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestCipher.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestConfig.rb b/test/.excludes-zjit/OpenSSL/TestConfig.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestConfig.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestDigest.rb b/test/.excludes-zjit/OpenSSL/TestDigest.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestDigest.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestEC.rb b/test/.excludes-zjit/OpenSSL/TestEC.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestEC.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestEOF1.rb b/test/.excludes-zjit/OpenSSL/TestEOF1.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestEOF1.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestEOF1LowlevelSocket.rb b/test/.excludes-zjit/OpenSSL/TestEOF1LowlevelSocket.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestEOF1LowlevelSocket.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestEOF2.rb b/test/.excludes-zjit/OpenSSL/TestEOF2.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestEOF2.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestEOF2LowlevelSocket.rb b/test/.excludes-zjit/OpenSSL/TestEOF2LowlevelSocket.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestEOF2LowlevelSocket.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestEngine.rb b/test/.excludes-zjit/OpenSSL/TestEngine.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestEngine.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestFIPS.rb b/test/.excludes-zjit/OpenSSL/TestFIPS.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestFIPS.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestHMAC.rb b/test/.excludes-zjit/OpenSSL/TestHMAC.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestHMAC.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestKDF.rb b/test/.excludes-zjit/OpenSSL/TestKDF.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestKDF.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestNSSPI.rb b/test/.excludes-zjit/OpenSSL/TestNSSPI.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestNSSPI.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestOCSP.rb b/test/.excludes-zjit/OpenSSL/TestOCSP.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestOCSP.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestPKCS12.rb b/test/.excludes-zjit/OpenSSL/TestPKCS12.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestPKCS12.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestPKCS7.rb b/test/.excludes-zjit/OpenSSL/TestPKCS7.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestPKCS7.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestPKey.rb b/test/.excludes-zjit/OpenSSL/TestPKey.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestPKey.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestPKeyDH.rb b/test/.excludes-zjit/OpenSSL/TestPKeyDH.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestPKeyDH.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestPKeyDSA.rb b/test/.excludes-zjit/OpenSSL/TestPKeyDSA.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestPKeyDSA.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestPKeyRSA.rb b/test/.excludes-zjit/OpenSSL/TestPKeyRSA.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestPKeyRSA.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestPair.rb b/test/.excludes-zjit/OpenSSL/TestPair.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestPair.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestPairLowlevelSocket.rb b/test/.excludes-zjit/OpenSSL/TestPairLowlevelSocket.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestPairLowlevelSocket.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestProvider.rb b/test/.excludes-zjit/OpenSSL/TestProvider.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestProvider.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestRandom.rb b/test/.excludes-zjit/OpenSSL/TestRandom.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestRandom.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestSSL.rb b/test/.excludes-zjit/OpenSSL/TestSSL.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestSSL.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestSSLSession.rb b/test/.excludes-zjit/OpenSSL/TestSSLSession.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestSSLSession.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestTimestamp.rb b/test/.excludes-zjit/OpenSSL/TestTimestamp.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestTimestamp.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestX509Attribute.rb b/test/.excludes-zjit/OpenSSL/TestX509Attribute.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestX509Attribute.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestX509CRL.rb b/test/.excludes-zjit/OpenSSL/TestX509CRL.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestX509CRL.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestX509Certificate.rb b/test/.excludes-zjit/OpenSSL/TestX509Certificate.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestX509Certificate.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestX509Extension.rb b/test/.excludes-zjit/OpenSSL/TestX509Extension.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestX509Extension.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestX509Name.rb b/test/.excludes-zjit/OpenSSL/TestX509Name.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestX509Name.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestX509Request.rb b/test/.excludes-zjit/OpenSSL/TestX509Request.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestX509Request.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/OpenSSL/TestX509Store.rb b/test/.excludes-zjit/OpenSSL/TestX509Store.rb new file mode 100644 index 00000000000000..87f30945a278d9 --- /dev/null +++ b/test/.excludes-zjit/OpenSSL/TestX509Store.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests fail with ZJIT') diff --git a/test/.excludes-zjit/Prism/DumpTest.rb b/test/.excludes-zjit/Prism/DumpTest.rb new file mode 100644 index 00000000000000..232903bfea982f --- /dev/null +++ b/test/.excludes-zjit/Prism/DumpTest.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests crash with ZJIT') diff --git a/test/.excludes-zjit/Prism/SnippetsTest.rb b/test/.excludes-zjit/Prism/SnippetsTest.rb new file mode 100644 index 00000000000000..232903bfea982f --- /dev/null +++ b/test/.excludes-zjit/Prism/SnippetsTest.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests crash with ZJIT') diff --git a/test/.excludes-zjit/TestBugReporter.rb b/test/.excludes-zjit/TestBugReporter.rb new file mode 100644 index 00000000000000..57d3166d87aa54 --- /dev/null +++ b/test/.excludes-zjit/TestBugReporter.rb @@ -0,0 +1 @@ +exclude(:test_bug_reporter_add, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestERBCore.rb b/test/.excludes-zjit/TestERBCore.rb new file mode 100644 index 00000000000000..9ab398de6f5065 --- /dev/null +++ b/test/.excludes-zjit/TestERBCore.rb @@ -0,0 +1 @@ +exclude(:test_invalid_trim_mode, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestERBCoreWOStrScan.rb b/test/.excludes-zjit/TestERBCoreWOStrScan.rb new file mode 100644 index 00000000000000..9ab398de6f5065 --- /dev/null +++ b/test/.excludes-zjit/TestERBCoreWOStrScan.rb @@ -0,0 +1 @@ +exclude(:test_invalid_trim_mode, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestObjSpace.rb b/test/.excludes-zjit/TestObjSpace.rb new file mode 100644 index 00000000000000..28e97f4578e7cf --- /dev/null +++ b/test/.excludes-zjit/TestObjSpace.rb @@ -0,0 +1,2 @@ +exclude(:test_dump_to_io, 'Test fails with ZJIT') +exclude(:test_dump_to_default, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestResolvDNS.rb b/test/.excludes-zjit/TestResolvDNS.rb new file mode 100644 index 00000000000000..37b6d791039e42 --- /dev/null +++ b/test/.excludes-zjit/TestResolvDNS.rb @@ -0,0 +1,8 @@ +# Only happens when running with other tests +# Panics with: +# +# thread '' panicked at zjit/src/asm/arm64/mod.rs:939:13: +# Expected displacement -264 to be 9 bits or less +# +# May be related to https://github.com/Shopify/ruby/issues/646 +exclude(/test_/, 'Tests make ZJIT panic') diff --git a/test/.excludes-zjit/TestTimeout.rb b/test/.excludes-zjit/TestTimeout.rb new file mode 100644 index 00000000000000..5e1570fb8f57fd --- /dev/null +++ b/test/.excludes-zjit/TestTimeout.rb @@ -0,0 +1,3 @@ +exclude(:test_timeout, 'Test hangs with ZJIT') +exclude(:test_nested_timeout, 'Test hangs with ZJIT') +exclude(:test_nested_timeout_error_identity, 'Test hangs with ZJIT') diff --git a/test/.excludes-zjit/TestTracepointObj.rb b/test/.excludes-zjit/TestTracepointObj.rb new file mode 100644 index 00000000000000..fda524d7bc9c2b --- /dev/null +++ b/test/.excludes-zjit/TestTracepointObj.rb @@ -0,0 +1 @@ +exclude(/test_/, 'TracePoint tests fail intermittently with ZJIT') diff --git a/zjit/zjit.mk b/zjit/zjit.mk index 9a018f1b1ac4cf..43caa2e35a0ba0 100644 --- a/zjit/zjit.mk +++ b/zjit/zjit.mk @@ -52,7 +52,7 @@ zjit-check: .PHONY: zjit-test-all zjit-test-all: - $(MAKE) test-all RUST_BACKTRACE=1 TEST_EXCLUDES='--excludes-dir=$(top_srcdir)/test/.excludes-zjit --name=!/memory_leak/' RUN_OPTS='--zjit-call-threshold=1' TESTS='$(top_srcdir)/test/ruby' + $(MAKE) test-all RUST_BACKTRACE=1 TEST_EXCLUDES='--excludes-dir=$(top_srcdir)/test/.excludes-zjit --name=!/memory_leak/' RUN_OPTS='--zjit-call-threshold=1' ZJIT_BINDGEN_DIFF_OPTS =