diff options
12161 files changed, 2701354 insertions, 270336 deletions
diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 2332ee6472..0000000000 --- a/.cvsignore +++ /dev/null @@ -1,53 +0,0 @@ -*.bak -*.orig -*.rej -*.sav -*~ -.ccmalloc -.ppack -COPYING.LIB -ChangeLog.pre-alpha -ChangeLog.pre1_1 -Makefile -README.fat-patch -README.v6 -README.atheos -archive -autom4te*.cache -automake -beos -config.cache -config.h -config.h.in -config.log -config.status -configure -foo.rb -libruby.so.* -miniruby -miniruby.elhash -miniruby.elhash2 -miniruby.orig2 -miniruby.plhash -miniruby.plhash2 -modex.rb -newdate.rb -newver.rb -parse.c -parse.y.try -pitest.rb -ppack -rbconfig.rb -rename2.h -repack -riscos -rubicon -ruby -ruby-man.rd.gz -rubyunit -st.c.power -this that -tmp -web -y.output -y.tab.c diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000000..8f4b96445c --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,39 @@ +;; Copyright (c) 2018 Urabe, Shyouhei. All rights reserved. +;; +;; This file is a part of the programming language Ruby. Permission is hereby +;; granted, to either redistribute and/or modify this file, provided that the +;; conditions mentioned in the file COPYING are met. Consult the file for +;; details. + +((nil . + ((indent-tabs-mode . nil) + (require-final-newline . t) + (tab-width . 8) + (show-trailing-whitespace . t) + (whitespace-line-column . 80))) ;; See also [Misc #12277] + + ;; (bat-mode . ((buffer-file-coding-system . utf-8-dos))) + + (ruby-mode . ((ruby-indent-level . 2))) + + (rdoc-mode . ((fill-column . 74))) + + (yaml-mode . ((yaml-indent-offset . 2))) + + (makefile-mode . ((indent-tabs-mode . t))) + + (c-mode . ((c-file-style . "ruby"))) + + (c++-mode . ((c-file-style . "ruby"))) + + (change-log-mode . + ((buffer-file-coding-system . us-ascii) + (indent-tabs-mode . t) + (change-log-indent-text . 2) + (add-log-time-format . (lambda (&optional x y) + (let* ((time (or x (current-time))) + (system-time-locale "C") + (diff (+ (cadr time) 32400)) + (lo (% diff 65536)) + (hi (+ (car time) (/ diff 65536)))) + (format-time-string "%a %b %e %H:%M:%S %Y" (list hi lo) t))))))) diff --git a/.document b/.document new file mode 100644 index 0000000000..82ca602bfb --- /dev/null +++ b/.document @@ -0,0 +1,56 @@ +# This file determines which files in the +# Ruby hierarchy will be processed by the RDoc +# tool when it is given the top-level directory +# as an argument + +# Process all the C source files +*.c +*.y + +# prelude +prelude.rb +rbconfig.rb + +array.rb +ast.rb +dir.rb +gc.rb +hash.rb +io.rb +kernel.rb +marshal.rb +numeric.rb +nilclass.rb +pack.rb +pathname_builtin.rb +ractor.rb +string.rb +symbol.rb +timev.rb +thread_sync.rb +trace_point.rb +warning.rb +yjit.rb +zjit.rb + +# Errno::* +known_errors.inc + +# the lib/ directory (which has its own .document file) +lib + +# and some of the ext/ directory (which has its own .document file) +ext + +# rdoc files +NEWS.md + +README.md +README.ja.md + +COPYING +COPYING.ja + +LEGAL + +doc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..4633a7acae --- /dev/null +++ b/.editorconfig @@ -0,0 +1,30 @@ +root = true + +[*] +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +tab_width = 8 +trim_trailing_whitespace = true + +[*.bat] +end_of_line = crlf + +[*.gemspec] +indent_size = 2 + +[*.rb] +indent_size = 2 + +[*.yml] +indent_size = 2 + +[{*[Mm]akefile*,*.mak,*.mk,depend}] +indent_style = tab + +[enc/*] +indent_size = 2 + +[reg*.[ch]] +indent_size = 2 diff --git a/.gdbinit b/.gdbinit new file mode 100644 index 0000000000..bda544c641 --- /dev/null +++ b/.gdbinit @@ -0,0 +1,1336 @@ +define ruby_gdb_init + init-if-undefined $color_type = "\033[31m" + init-if-undefined $color_highlite = "\033[36m" + init-if-undefined $color_end = "\033[m" +end + +# set prompt \033[36m(gdb)\033[m\040 + +define rp + ruby_gdb_init + if (VALUE)($arg0) & RUBY_FIXNUM_FLAG + printf "FIXNUM: %ld\n", (long)($arg0) >> 1 + else + if ((VALUE)($arg0) & ~(~(VALUE)0<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG + set $id = (($arg0) >> RUBY_SPECIAL_SHIFT) + printf "%sSYMBOL%s: ", $color_type, $color_end + rp_id $id + else + if ($arg0) == RUBY_Qfalse + echo false\n + else + if ($arg0) == RUBY_Qtrue + echo true\n + else + if ($arg0) == RUBY_Qnil + echo nil\n + else + if ($arg0) == RUBY_Qundef + echo undef\n + else + if (VALUE)($arg0) & RUBY_IMMEDIATE_MASK + if ((VALUE)($arg0) & RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG + printf "%sFLONUM%s: %g\n", $color_type, $color_end, (double)rb_float_value($arg0) + else + echo immediate\n + end + else + set $flags = ((struct RBasic*)($arg0))->flags + if ($flags & RUBY_FL_PROMOTED) == RUBY_FL_PROMOTED + printf "[PROMOTED] " + end + if ($flags & RUBY_T_MASK) == RUBY_T_NONE + printf "%sT_NONE%s: ", $color_type, $color_end + print (struct RBasic *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_NIL + printf "%sT_NIL%s: ", $color_type, $color_end + print (struct RBasic *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_OBJECT + printf "%sT_OBJECT%s: ", $color_type, $color_end + print ((struct RObject *)($arg0))->basic + if ($flags & ROBJECT_EMBED) + print/x *((VALUE*)((struct RObject*)($arg0))->as.ary) @ (RSHAPE_CAPACITY(rb_obj_shape_id($arg0))) + else + print (((struct RObject *)($arg0))->as.heap) + if (((struct RObject*)($arg0))->as.heap.numiv) > 0 + print/x *(((struct RObject*)($arg0))->as.heap.ivptr) @ (((struct RObject*)($arg0))->as.heap.numiv) + end + end + else + if ($flags & RUBY_T_MASK) == RUBY_T_CLASS + printf "%sT_CLASS%s%s: ", $color_type, ($flags & RUBY_FL_SINGLETON) ? "*" : "", $color_end + rp_class $arg0 + else + if ($flags & RUBY_T_MASK) == RUBY_T_ICLASS + printf "%sT_ICLASS%s: ", $color_type, $color_end + rp_class $arg0 + else + if ($flags & RUBY_T_MASK) == RUBY_T_MODULE + printf "%sT_MODULE%s: ", $color_type, $color_end + rp_class $arg0 + else + if ($flags & RUBY_T_MASK) == RUBY_T_FLOAT + printf "%sT_FLOAT%s: %.16g ", $color_type, $color_end, (((struct RFloat*)($arg0))->float_value) + print (struct RFloat *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_STRING + printf "%sT_STRING%s: ", $color_type, $color_end + rp_string $arg0 $flags + else + if ($flags & RUBY_T_MASK) == RUBY_T_REGEXP + set $regsrc = ((struct RRegexp*)($arg0))->src + set $rsflags = ((struct RBasic*)$regsrc)->flags + printf "%sT_REGEXP%s: ", $color_type, $color_end + set $len = ((struct RString*)($arg0))->len + set print address off + output *(char *)(($rsflags & RUBY_FL_USER1) ? \ + ((struct RString*)$regsrc)->as.heap.ptr : \ + ((struct RString*)$regsrc)->as.embed.ary) @ $len + set print address on + printf " len:%ld ", $len + if $flags & RUBY_FL_USER6 + printf "(none) " + end + if $flags & RUBY_FL_USER5 + printf "(literal) " + end + if $flags & RUBY_FL_USER4 + printf "(fixed) " + end + printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT + print (struct RRegexp *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_ARRAY + if ($flags & RUBY_FL_USER1) + set $len = (($flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3)) + printf "%sT_ARRAY%s: len=%ld ", $color_type, $color_end, $len + printf "(embed) " + if ($len == 0) + printf "{(empty)} " + else + print/x *((VALUE*)((struct RArray*)($arg0))->as.ary) @ $len + printf " " + end + else + set $len = ((struct RArray*)($arg0))->as.heap.len + printf "%sT_ARRAY%s: len=%ld ", $color_type, $color_end, $len + if ($flags & RUBY_FL_USER2) + printf "(shared) shared=" + output/x ((struct RArray*)($arg0))->as.heap.aux.shared_root + printf " " + else + printf "(ownership) capa=%ld ", ((struct RArray*)($arg0))->as.heap.aux.capa + end + if ($len == 0) + printf "{(empty)} " + else + print/x *((VALUE*)((struct RArray*)($arg0))->as.heap.ptr) @ $len + printf " " + end + end + print (struct RArray *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_FIXNUM + printf "%sT_FIXNUM%s: ", $color_type, $color_end + print (struct RBasic *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_HASH + printf "%sT_HASH%s: ", $color_type, $color_end, + if (((struct RHash *)($arg0))->basic.flags & RHASH_ST_TABLE_FLAG) + set $st = (struct st_table *)((uintptr_t)($arg0) + sizeof(struct RHash)) + printf "st len=%ld ", $st->num_entries + print $st + else + printf "li len=%ld bound=%ld ", \ + ((((struct RHash *)($arg0))->basic.flags & RHASH_AR_TABLE_SIZE_MASK) >> RHASH_AR_TABLE_SIZE_SHIFT), \ + ((((struct RHash *)($arg0))->basic.flags & RHASH_AR_TABLE_BOUND_MASK) >> RHASH_AR_TABLE_BOUND_SHIFT) + print (struct ar_table_struct *)((uintptr_t)($arg0) + sizeof(struct RHash)) + end + else + if ($flags & RUBY_T_MASK) == RUBY_T_STRUCT + set $len = (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \ + ($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \ + ((struct RStruct *)($arg0))->as.heap.len) + printf "%sT_STRUCT%s: len=%ld ", $color_type, $color_end, $len + print (struct RStruct *)($arg0) + output/x *(($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \ + ((struct RStruct *)($arg0))->as.ary : \ + ((struct RStruct *)($arg0))->as.heap.ptr) @ $len + else + if ($flags & RUBY_T_MASK) == RUBY_T_BIGNUM + rp_bignum $arg0 + else + if ($flags & RUBY_T_MASK) == RUBY_T_RATIONAL + printf "%sT_RATIONAL%s: ", $color_type, $color_end + print (struct RRational *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_COMPLEX + printf "%sT_COMPLEX%s: ", $color_type, $color_end + print (struct RComplex *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_FILE + printf "%sT_FILE%s: ", $color_type, $color_end + print (struct RFile *)($arg0) + output *((struct RFile *)($arg0))->fptr + printf "\n" + else + if ($flags & RUBY_T_MASK) == RUBY_T_TRUE + printf "%sT_TRUE%s: ", $color_type, $color_end + print (struct RBasic *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_FALSE + printf "%sT_FALSE%s: ", $color_type, $color_end + print (struct RBasic *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_DATA + if ($flags & RUBY_TYPED_FL_IS_TYPED_DATA) + set $data = (struct RTypedData *)($arg0) + set $type = (const rb_data_type_t *)($data->type & ~1) + printf "%sT_DATA%s(%s): ", $color_type, $color_end, $type->wrap_struct_name + print *$type + if ($data->type & 1) + print (void *)&$data->data + else + print $data + end + else + printf "%sT_DATA%s: ", $color_type, $color_end + print *(struct RData *)($arg0) + end + else + if ($flags & RUBY_T_MASK) == RUBY_T_MATCH + printf "%sT_MATCH%s: ", $color_type, $color_end + print (struct RMatch *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_SYMBOL + printf "%sT_SYMBOL%s: ", $color_type, $color_end + print (struct RSymbol *)($arg0) + set $id_type = ((struct RSymbol *)($arg0))->id & RUBY_ID_SCOPE_MASK + if $id_type == RUBY_ID_LOCAL + printf "l" + else + if $id_type == RUBY_ID_INSTANCE + printf "i" + else + if $id_type == RUBY_ID_GLOBAL + printf "G" + else + if $id_type == RUBY_ID_ATTRSET + printf "a" + else + if $id_type == RUBY_ID_CONST + printf "C" + else + if $id_type == RUBY_ID_CLASS + printf "c" + else + printf "j" + end + end + end + end + end + end + set $id_fstr = ((struct RSymbol *)($arg0))->fstr + rp_string $id_fstr + else + if ($flags & RUBY_T_MASK) == RUBY_T_UNDEF + printf "%sT_UNDEF%s: ", $color_type, $color_end + print (struct RBasic *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_IMEMO + printf "%sT_IMEMO%s(", $color_type, $color_end + output (enum imemo_type)(($flags>>RUBY_FL_USHIFT)&RUBY_IMEMO_MASK) + printf "): " + rp_imemo $arg0 + else + if ($flags & RUBY_T_MASK) == RUBY_T_NODE + printf "%sT_NODE%s(", $color_type, $color_end + output (enum node_type)(($flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT) + printf "): " + print *(NODE *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_ZOMBIE + printf "%sT_ZOMBIE%s: ", $color_type, $color_end + print (struct RData *)($arg0) + else + if ($flags & RUBY_T_MASK) == RUBY_T_MOVED + printf "%sT_MOVED%s: ", $color_type, $color_end + print *(struct RMoved *)$arg0 + else + printf "%sunknown%s: ", $color_type, $color_end + print (struct RBasic *)($arg0) + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end +end +document rp + Print a Ruby's VALUE. +end + +define rp_id + set $id = (ID)$arg0 + if $id == '!' || $id == '+' || $id == '-' || $id == '*' || $id == '/' || $id == '%' || $id == '<' || $id == '>' || $id == '`' + printf "(:%c)\n", $id + else + if $id == idDot2 + printf "(:..)\n" + else + if $id == idDot3 + printf "(:...)\n" + else + if $id == idUPlus + printf "(:+@)\n" + else + if $id == idUMinus + printf "(:-@)\n" + else + if $id == idPow + printf "(:**)\n" + else + if $id == idCmp + printf "(:<=>)\n" + else + if $id == idLTLT + printf "(:<<)\n" + else + if $id == idGTGT + printf "(:>>)\n" + else + if $id == idLE + printf "(:<=)\n" + else + if $id == idGE + printf "(:>=)\n" + else + if $id == idEq + printf "(:==)\n" + else + if $id == idEqq + printf "(:===)\n" + else + if $id == idNeq + printf "(:!=)\n" + else + if $id == idEqTilde + printf "(:=~)\n" + else + if $id == idNeqTilde + printf "(:!~)\n" + else + if $id == idAREF + printf "(:[])\n" + else + if $id == idASET + printf "(:[]=)\n" + else + if $id == idCOLON2 + printf "(:'::')\n" + else + if $id == idANDOP + printf "(:&&)\n" + else + if $id == idOROP + printf "(:||)\n" + else + if $id == idANDDOT + printf "(:&.)\n" + else + if $id <= tLAST_OP_ID + printf "O" + else + set $id_type = $id & RUBY_ID_SCOPE_MASK + if $id_type == RUBY_ID_LOCAL + printf "l" + else + if $id_type == RUBY_ID_INSTANCE + printf "i" + else + if $id_type == RUBY_ID_GLOBAL + printf "G" + else + if $id_type == RUBY_ID_ATTRSET + printf "a" + else + if $id_type == RUBY_ID_CONST + printf "C" + else + if $id_type == RUBY_ID_CLASS + printf "c" + else + printf "j" + end + end + end + end + end + end + end + printf "(%ld): ", $id + print_id $id + echo \n + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end +end +document rp_id + Print an ID. +end + +define output_string + set $flags = ((struct RBasic*)($arg0))->flags + set $len = ((struct RString*)($arg0))->len + if $len > 0 + output *(char *)(($flags & RUBY_FL_USER1) ? \ + ((struct RString*)($arg0))->as.heap.ptr : \ + ((struct RString*)($arg0))->as.embed.ary) @ $len + else + output "" + end +end + +define print_string + set $flags = ((struct RBasic*)($arg0))->flags + set $len = ((struct RString*)($arg0))->len + if $len > 0 + printf "%s", *(char *)(($flags & RUBY_FL_USER1) ? \ + ((struct RString*)($arg0))->as.heap.ptr : \ + ((struct RString*)($arg0))->as.embed.ary) @ $len + end +end + +define rp_string + output_string $arg0 + printf " bytesize:%ld ", $len + if !($flags & RUBY_FL_USER1) + printf "(embed) " + else + if ($flags & RUBY_FL_USER2) + printf "(shared) " + end + if ($flags & RUBY_FL_USER3) + printf "(assoc) " + end + end + printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT + if ($flags & RUBY_ENC_CODERANGE_MASK) == 0 + printf "coderange:unknown " + else + if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_7BIT + printf "coderange:7bit " + else + if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_VALID + printf "coderange:valid " + else + printf "coderange:broken " + end + end + end + print (struct RString *)($arg0) +end +document rp_string + Print the content of a String. +end + +define rp_bignum + set $flags = ((struct RBignum*)($arg0))->basic.flags + set $len = (($flags & RUBY_FL_USER2) ? \ + ($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \ + ((struct RBignum*)($arg0))->as.heap.len) + printf "%sT_BIGNUM%s: sign=%d len=%ld ", $color_type, $color_end, \ + (($flags & RUBY_FL_USER1) != 0), $len + if $flags & RUBY_FL_USER2 + printf "(embed) " + end + print (struct RBignum *)($arg0) + set $ptr = (($flags & RUBY_FL_USER2) ? \ + ((struct RBignum*)($arg0))->as.ary : \ + ((struct RBignum*)($arg0))->as.heap.digits) + set $len = $len-1 + printf "0x%x", $ptr[$len] + while $len > 0 + set $len = $len-1 + set $val = $ptr[$len] + set $w = sizeof($ptr[0]) + printf "_" + if $w > 8 + printf "%.32x", $val + else + if $w > 4 + printf "%.16x", $val + else + if $w > 2 + printf "%.8x", $val + else + if $w > 1 + printf "%.4x", $val + else + printf "%.2x", $val + end + end + end + end + end + printf "\n" +end +document rp_bignum + Print the content of a Bignum. +end + +define rp_class + set $class_and_classext = (struct RClass_and_rb_classext_t *)($arg0) + printf "(struct RClass *) %p", (void*)$arg0 + if $class_and_classext->classext->origin_ != (VALUE)$arg0 + printf " -> %p", $class_and_classext->classext->origin_ + end + printf "\n" + rb_classname $arg0 + print/x *$class_and_classext +end +document rp_class + Print the content of a Class/Module. +end + +define rp_imemo + set $flags = (enum imemo_type)((((struct RBasic *)($arg0))->flags >> RUBY_FL_USHIFT) & RUBY_IMEMO_MASK) + if $flags == imemo_cref + printf "(rb_cref_t *) %p\n", (void*)$arg0 + print *(rb_cref_t *)$arg0 + else + if $flags == imemo_svar + printf "(struct vm_svar *) %p\n", (void*)$arg0 + print *(struct vm_svar *)$arg0 + else + if $flags == imemo_throw_data + printf "(struct vm_throw_data *) %p\n", (void*)$arg0 + print *(struct vm_throw_data *)$arg0 + else + if $flags == imemo_ifunc + printf "(struct vm_ifunc *) %p\n", (void*)$arg0 + print *(struct vm_ifunc *)$arg0 + else + if $flags == imemo_memo + printf "(struct MEMO *) %p\n", (void*)$arg0 + print *(struct MEMO *)$arg0 + else + if $flags == imemo_ment + printf "(rb_method_entry_t *) %p\n", (void*)$arg0 + print *(rb_method_entry_t *)$arg0 + else + if $flags == imemo_iseq + printf "(rb_iseq_t *) %p\n", (void*)$arg0 + print *(rb_iseq_t *)$arg0 + else + printf "(struct RIMemo *) %p\n", (void*)$arg0 + print *(struct RIMemo *)$arg0 + end + end + end + end + end + end + end +end +document rp_imemo + Print the content of a memo +end + +define nd_type + print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT) +end +document nd_type + Print a Ruby' node type. +end + +define nd_file + print ((NODE*)($arg0))->nd_file +end +document nd_file + Print the source file name of a node. +end + +define nd_line + print ((unsigned int)((((NODE*)($arg0))->flags>>RUBY_NODE_LSHIFT)&RUBY_NODE_LMASK)) +end +document nd_line + Print the source line number of a node. +end + +# Print members of ruby node. + +define nd_head + printf "%su1.node%s: ", $color_highlite, $color_end + rp ($arg0).u1.node +end + +define nd_alen + printf "%su2.argc%s: ", $color_highlite, $color_end + p ($arg0).u2.argc +end + +define nd_next + printf "%su3.node%s: ", $color_highlite, $color_end + rp ($arg0).u3.node +end + + +define nd_cond + printf "%su1.node%s: ", $color_highlite, $color_end + rp ($arg0).u1.node +end + +define nd_body + printf "%su2.node%s: ", $color_highlite, $color_end + rp ($arg0).u2.node +end + +define nd_else + printf "%su3.node%s: ", $color_highlite, $color_end + rp ($arg0).u3.node +end + + +define nd_orig + printf "%su3.value%s: ", $color_highlite, $color_end + rp ($arg0).u3.value +end + + +define nd_resq + printf "%su2.node%s: ", $color_highlite, $color_end + rp ($arg0).u2.node +end + +define nd_ensr + printf "%su3.node%s: ", $color_highlite, $color_end + rp ($arg0).u3.node +end + + +define nd_1st + printf "%su1.node%s: ", $color_highlite, $color_end + rp ($arg0).u1.node +end + +define nd_2nd + printf "%su2.node%s: ", $color_highlite, $color_end + rp ($arg0).u2.node +end + + +define nd_stts + printf "%su1.node%s: ", $color_highlite, $color_end + rp ($arg0).u1.node +end + + +define nd_vid + printf "%su1.id%s: ", $color_highlite, $color_end + p ($arg0).u1.id +end + +define nd_cflag + printf "%su2.id%s: ", $color_highlite, $color_end + p ($arg0).u2.id +end + +define nd_cval + printf "%su3.value%s: ", $color_highlite, $color_end + rp ($arg0).u3.value +end + +define nd_tbl + printf "%su1.tbl%s: ", $color_highlite, $color_end + p ($arg0).u1.tbl +end + + +define nd_var + printf "%su1.node%s: ", $color_highlite, $color_end + rp ($arg0).u1.node +end + +define nd_ibdy + printf "%su2.node%s: ", $color_highlite, $color_end + rp ($arg0).u2.node +end + +define nd_iter + printf "%su3.node%s: ", $color_highlite, $color_end + rp ($arg0).u3.node +end + + +define nd_value + printf "%su2.node%s: ", $color_highlite, $color_end + rp ($arg0).u2.node +end + +define nd_aid + printf "%su3.id%s: ", $color_highlite, $color_end + p ($arg0).u3.id +end + + +define nd_lit + printf "%su1.value%s: ", $color_highlite, $color_end + rp ($arg0).u1.value +end + +define nd_rest + printf "%su2.argc%s: ", $color_highlite, $color_end + p ($arg0).u2.argc +end + +define nd_opt + printf "%su1.node%s: ", $color_highlite, $color_end + rp ($arg0).u1.node +end + + +define nd_recv + printf "%su1.node%s: ", $color_highlite, $color_end + rp ($arg0).u1.node +end + +define nd_mid + printf "%su2.id%s: ", $color_highlite, $color_end + p ($arg0).u2.id +end + +define nd_args + printf "%su3.node%s: ", $color_highlite, $color_end + rp ($arg0).u3.node +end + +define nd_defn + printf "%su3.node%s: ", $color_highlite, $color_end + rp ($arg0).u3.node +end + + +define nd_old + printf "%su1.id%s: ", $color_highlite, $color_end + p ($arg0).u1.id +end + +define nd_new + printf "%su2.id%s: ", $color_highlite, $color_end + p ($arg0).u2.id +end + + +define nd_cname + printf "%su1.id%s: ", $color_highlite, $color_end + p ($arg0).u1.id +end + +define nd_super + printf "%su3.node%s: ", $color_highlite, $color_end + rp ($arg0).u3.node +end + + +define nd_modl + printf "%su1.id%s: ", $color_highlite, $color_end + p ($arg0).u1.id +end + +define nd_clss + printf "%su1.value%s: ", $color_highlite, $color_end + rp ($arg0).u1.value +end + + +define nd_beg + printf "%su1.node%s: ", $color_highlite, $color_end + rp ($arg0).u1.node +end + +define nd_end + printf "%su2.node%s: ", $color_highlite, $color_end + rp ($arg0).u2.node +end + +define nd_state + printf "%su3.state%s: ", $color_highlite, $color_end + p ($arg0).u3.state +end + +define nd_rval + printf "%su2.value%s: ", $color_highlite, $color_end + rp ($arg0).u2.value +end + + +define nd_nth + printf "%su2.argc%s: ", $color_highlite, $color_end + p ($arg0).u2.argc +end + + +define nd_tag + printf "%su1.id%s: ", $color_highlite, $color_end + p ($arg0).u1.id +end + +define nd_tval + printf "%su2.value%s: ", $color_highlite, $color_end + rp ($arg0).u2.value +end + +define nd_tree + set $buf = (struct RString *)rb_str_buf_new(0) + call dump_node((VALUE)($buf), rb_str_tmp_new(0), 0, ($arg0)) + printf "%s\n", $buf->as.heap.ptr +end + +define rb_p + call rb_p($arg0) +end + +define rb_numtable_entry + set $rb_numtable_tbl = $arg0 + set $rb_numtable_id = (st_data_t)$arg1 + set $rb_numtable_key = 0 + set $rb_numtable_rec = 0 + if $rb_numtable_tbl->entries_packed + set $rb_numtable_p = $rb_numtable_tbl->as.packed.bins + while $rb_numtable_p && $rb_numtable_p < $rb_numtable_tbl->as.packed.bins+$rb_numtable_tbl->num_entries + if $rb_numtable_p.k == $rb_numtable_id + set $rb_numtable_key = $rb_numtable_p.k + set $rb_numtable_rec = $rb_numtable_p.v + set $rb_numtable_p = 0 + else + set $rb_numtable_p = $rb_numtable_p + 1 + end + end + else + set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[st_numhash($rb_numtable_id) % $rb_numtable_tbl->num_bins] + while $rb_numtable_p + if $rb_numtable_p->key == $rb_numtable_id + set $rb_numtable_key = $rb_numtable_p->key + set $rb_numtable_rec = $rb_numtable_p->record + set $rb_numtable_p = 0 + else + set $rb_numtable_p = $rb_numtable_p->next + end + end + end +end + +define rb_id2name + ruby_gdb_init + printf "%sID%s: ", $color_type, $color_end + rp_id $arg0 +end +document rb_id2name + Print the name of id +end + +define rb_method_entry + set $rb_method_entry_klass = (struct RClass *)$arg0 + set $rb_method_entry_id = (ID)$arg1 + set $rb_method_entry_me = (rb_method_entry_t *)0 + while !$rb_method_entry_me && $rb_method_entry_klass + rb_numtable_entry $rb_method_entry_klass->m_tbl_wrapper->tbl $rb_method_entry_id + set $rb_method_entry_me = (rb_method_entry_t *)$rb_numtable_rec + if !$rb_method_entry_me + set $rb_method_entry_klass = (struct RClass *)RCLASS_SUPER($rb_method_entry_klass) + end + end + if $rb_method_entry_me + print *$rb_method_entry_klass + print *$rb_method_entry_me + else + echo method not found\n + end +end +document rb_method_entry + Search method entry by class and id +end + +define rb_classname + set $rb_classname = ((struct RClass_and_rb_classext_t*)$arg0)->classext->classpath + if $rb_classname != RUBY_Qfalse + print_string $rb_classname + printf "\n" + else + echo anonymous class/module\n + end +end + +define rb_ancestors + set $rb_ancestors_module = $arg0 + while $rb_ancestors_module + rp_class $rb_ancestors_module + set $rb_ancestors_module = RCLASS_SUPER($rb_ancestors_module) + end +end +document rb_ancestors + Print ancestors. +end + +define rb_backtrace + call rb_backtrace() +end + +define iseq + if ruby_dummy_gdb_enums.special_consts + end + if ($arg0)->type == ISEQ_ELEMENT_NONE + echo [none]\n + end + if ($arg0)->type == ISEQ_ELEMENT_LABEL + print *(LABEL*)($arg0) + end + if ($arg0)->type == ISEQ_ELEMENT_INSN + print *(INSN*)($arg0) + if ((INSN*)($arg0))->insn_id != YARVINSN_jump + set $i = 0 + set $operand_size = ((INSN*)($arg0))->operand_size + set $operands = ((INSN*)($arg0))->operands + while $i < $operand_size + rp $operands[$i++] + end + end + end + if ($arg0)->type == ISEQ_ELEMENT_ADJUST + print *(ADJUST*)($arg0) + end +end + +define rb_ps + rb_ps_vm ruby_current_vm_ptr +end +document rb_ps +Dump all threads and their callstacks +end + +define rb_ps_vm + print $ps_vm = (rb_vm_t*)$arg0 + set $ps_thread_ln = $ps_vm->ractor.main_ractor.threads.set.n.next + set $ps_thread_ln_last = $ps_vm->ractor.main_ractor.threads.set.n.prev + while 1 + set $ps_thread_th = (rb_thread_t *)$ps_thread_ln + set $ps_thread = (VALUE)($ps_thread_th->self) + rb_ps_thread $ps_thread + if $ps_thread_ln == $ps_thread_ln_last + loop_break + end + set $ps_thread_ln = $ps_thread_ln->next + end +end +document rb_ps_vm +Dump all threads in a (rb_vm_t*) and their callstacks +end + +define print_lineno + set $cfp = $arg0 + set $iseq = $cfp->iseq + set $pos = $cfp->pc - $iseq->body->iseq_encoded + if $pos != 0 + set $pos = $pos - 1 + end + + set $index = 0 + set $size = $iseq->body->insns_info.size + set $table = $iseq->body->insns_info.body + set $positions = $iseq->body->insns_info.positions + #printf "size: %d\n", $size + if $size == 0 + else + if $size == 1 + printf "%d", $table[0].line_no + else + if $positions + # get_insn_info_linear_search + set $index = 1 + while $index < $size + #printf "table[%d]: position: %d, line: %d, pos: %d\n", $i, $positions[$i], $table[$i].line_no, $pos + if $positions[$index] > $pos + loop_break + end + set $index = $index + 1 + if $positions[$index] == $pos + loop_break + end + end + else + # get_insn_info_succinct_bitvector + set $sd = $iseq->body->insns_info.succ_index_table + set $immediate_table_size = sizeof($sd->imm_part) / sizeof(uint64_t) * 9 + if $pos < $immediate_table_size + set $i = $pos / 9 + set $j = $pos % 9 + set $index = ((int)($sd->imm_part[$i] >> ($j * 7))) & 0x7f + else + set $block_index = ($pos - $immediate_table_size) / 512 + set $block = &$sd->succ_part[$block_index] + set $block_bit_index = ($pos - $immediate_table_size) % 512 + set $small_block_index = $block_bit_index / 64 + set $small_block_popcount = $small_block_index == 0 ? 0 : (((int)($block->small_block_ranks >> (($small_block_index - 1) * 9))) & 0x1ff) + set $x = $block->bits[$small_block_index] << (63 - $block_bit_index % 64) + set $x = ($x & 0x5555555555555555) + ($x >> 1 & 0x5555555555555555) + set $x = ($x & 0x3333333333333333) + ($x >> 2 & 0x3333333333333333) + set $x = ($x & 0x0707070707070707) + ($x >> 4 & 0x0707070707070707) + set $x = ($x & 0x001f001f001f001f) + ($x >> 8 & 0x001f001f001f001f) + set $x = ($x & 0x0000003f0000003f) + ($x >>16 & 0x0000003f0000003f) + set $popcnt = ($x & 0x7f) + ($x >>32 & 0x7f) + set $index = $block->rank + $small_block_popcount + $popcnt + end + end + printf "%d", $table[$index-1].line_no + end + end +end + +define check_method_entry + set $imemo = (struct RBasic *)$arg0 + if $imemo != RUBY_Qfalse + set $type = ($imemo->flags >> 12) & 0x07 + if $type == imemo_ment + set $me = (rb_callable_method_entry_t *)$imemo + else + if $type == imemo_svar + set $imemo = ((struct vm_svar *)$imemo)->cref_or_me + check_method_entry $imemo + end + end + end +end + +define print_id + set $id = $arg0 + # rb_id_to_serial + if $id > tLAST_OP_ID + set $serial = (rb_id_serial_t)($id >> RUBY_ID_SCOPE_SHIFT) + else + set $serial = (rb_id_serial_t)$id + end + if $serial && $serial <= ruby_global_symbols.last_id + set $idx = $serial / ID_ENTRY_UNIT + set $ids = (struct RArray *)ruby_global_symbols.ids + set $flags = $ids->basic.flags + if ($flags & RUBY_FL_USER1) + set $idsptr = $ids->as.ary + set $idslen = (($flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3)) + else + set $idsptr = $ids->as.heap.ptr + set $idslen = $ids->as.heap.len + end + if $idx < $idslen + set $t = 0 + set $ary = (struct RArray *)$idsptr[$idx] + if $ary != RUBY_Qnil + set $flags = $ary->basic.flags + if ($flags & RUBY_FL_USER1) + set $aryptr = $ary->as.ary + set $arylen = (($flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3)) + else + set $aryptr = $ary->as.heap.ptr + set $arylen = $ary->as.heap.len + end + set $result = $aryptr[($serial % ID_ENTRY_UNIT) * ID_ENTRY_SIZE + $t] + if $result != RUBY_Qnil + print_string $result + else + echo undef + end + end + end + end +end + +define print_pathobj + set $flags = ((struct RBasic*)($arg0))->flags + if ($flags & RUBY_T_MASK) == RUBY_T_STRING + print_string $arg0 + end + if ($flags & RUBY_T_MASK) == RUBY_T_ARRAY + if $flags & RUBY_FL_USER1 + set $str = ((struct RArray*)($arg0))->as.ary[0] + else + set $str = ((struct RArray*)($arg0))->as.heap.ptr[0] + end + print_string $str + end +end + +define rb_ps_thread + set $ps_thread = (struct RTypedData*)$arg0 + set $ps_thread_th = (rb_thread_t*)$ps_thread->data + printf "* #<Thread:%p rb_thread_t:%p native_thread:%p>\n", \ + $ps_thread, $ps_thread_th, $ps_thread_th->nt + set $cfp = $ps_thread_th->ec->cfp + set $cfpend = (rb_control_frame_t *)($ps_thread_th->ec->vm_stack + $ps_thread_th->ec->vm_stack_size)-1 + while $cfp < $cfpend + if $cfp->iseq + if !((VALUE)$cfp->iseq & RUBY_IMMEDIATE_MASK) && (((imemo_ifunc << RUBY_FL_USHIFT) | RUBY_T_IMEMO)==$cfp->iseq->flags & ((RUBY_IMEMO_MASK << RUBY_FL_USHIFT) | RUBY_T_MASK)) + printf "%d:ifunc ", $cfpend-$cfp + set print symbol-filename on + output/a $cfp->iseq.body + set print symbol-filename off + printf "\n" + else + if $cfp->pc + set $location = $cfp->iseq->body->location + printf "%d:", $cfpend-$cfp + print_pathobj $location.pathobj + printf ":" + print_lineno $cfp + printf ":in `" + print_string $location.label + printf "'\n" + else + printf "%d: ???.rb:???:in `???'\n", $cfpend-$cfp + end + end + else + # if VM_FRAME_TYPE($cfp->flag) == VM_FRAME_MAGIC_CFUNC + set $ep = $cfp->ep + if ($ep[0] & 0xffff0001) == 0x55550001 + #define VM_ENV_FLAG_LOCAL 0x02 + #define VM_ENV_PREV_EP(ep) GC_GUARDED_PTR_REF(ep[VM_ENV_DATA_INDEX_SPECVAL]) + set $me = 0 + set $env_specval = $ep[-1] + set $env_me_cref = $ep[-2] + while ($env_specval & 0x02) != 0 + check_method_entry $env_me_cref + if $me != 0 + loop_break + end + set $ep = $ep[0] + set $env_specval = $ep[-1] + set $env_me_cref = $ep[-2] + end + if $me == 0 + check_method_entry $env_me_cref + end + printf "%d:", $cfpend-$cfp + set print symbol-filename on + output/a $me->def->body.cfunc.func + set print symbol-filename off + set $mid = $me->def->original_id + printf ":in `" + print_id $mid + printf "'\n" + else + printf "%d:unknown_frame:???:in `???'\n", $cfpend-$cfp + end + end + set $cfp = $cfp + 1 + end +end + +define rb_count_objects + set $objspace = ruby_current_vm_ptr->objspace + set $counts_00 = 0 + set $counts_01 = 0 + set $counts_02 = 0 + set $counts_03 = 0 + set $counts_04 = 0 + set $counts_05 = 0 + set $counts_06 = 0 + set $counts_07 = 0 + set $counts_08 = 0 + set $counts_09 = 0 + set $counts_0a = 0 + set $counts_0b = 0 + set $counts_0c = 0 + set $counts_0d = 0 + set $counts_0e = 0 + set $counts_0f = 0 + set $counts_10 = 0 + set $counts_11 = 0 + set $counts_12 = 0 + set $counts_13 = 0 + set $counts_14 = 0 + set $counts_15 = 0 + set $counts_16 = 0 + set $counts_17 = 0 + set $counts_18 = 0 + set $counts_19 = 0 + set $counts_1a = 0 + set $counts_1b = 0 + set $counts_1c = 0 + set $counts_1d = 0 + set $counts_1e = 0 + set $counts_1f = 0 + set $total = 0 + set $i = 0 + while $i < $objspace->heap_pages.allocated_pages + printf "\rcounting... %d/%d", $i, $objspace->heap_pages.allocated_pages + set $page = $objspace->heap_pages.sorted[$i] + set $p = $page->start + set $pend = $p + $page->total_slots + while $p < $pend + set $flags = $p->as.basic.flags & 0x1f + eval "set $counts_%02x = $counts_%02x + 1", $flags, $flags + set $p = $p + 1 + end + set $total = $total + $page->total_slots + set $i = $i + 1 + end + printf "\rTOTAL: %d, FREE: %d\n", $total, $counts_00 + printf "T_OBJECT: %d\n", $counts_01 + printf "T_CLASS: %d\n", $counts_02 + printf "T_MODULE: %d\n", $counts_03 + printf "T_FLOAT: %d\n", $counts_04 + printf "T_STRING: %d\n", $counts_05 + printf "T_REGEXP: %d\n", $counts_06 + printf "T_ARRAY: %d\n", $counts_07 + printf "T_HASH: %d\n", $counts_08 + printf "T_STRUCT: %d\n", $counts_09 + printf "T_BIGNUM: %d\n", $counts_0a + printf "T_FILE: %d\n", $counts_0b + printf "T_DATA: %d\n", $counts_0c + printf "T_MATCH: %d\n", $counts_0d + printf "T_COMPLEX: %d\n", $counts_0e + printf "T_RATIONAL: %d\n", $counts_0f + #printf "UNKNOWN_10: %d\n", $counts_10 + printf "T_NIL: %d\n", $counts_11 + printf "T_TRUE: %d\n", $counts_12 + printf "T_FALSE: %d\n", $counts_13 + printf "T_SYMBOL: %d\n", $counts_14 + printf "T_FIXNUM: %d\n", $counts_15 + printf "T_UNDEF: %d\n", $counts_16 + #printf "UNKNOWN_17: %d\n", $counts_17 + #printf "UNKNOWN_18: %d\n", $counts_18 + #printf "UNKNOWN_19: %d\n", $counts_19 + printf "T_IMEMO: %d\n", $counts_1a + printf "T_NODE: %d\n", $counts_1b + printf "T_ICLASS: %d\n", $counts_1c + printf "T_ZOMBIE: %d\n", $counts_1d + #printf "UNKNOWN_1E: %d\n", $counts_1e + printf "T_MASK: %d\n", $counts_1f +end +document rb_count_objects + Counts all objects grouped by type. +end + +# Details: https://github.com/ruby/ruby/wiki/Machine-Instructions-Trace-with-GDB +define trace_machine_instructions + set logging enabled + set height 0 + set width 0 + display/i $pc + while !$exit_code + info line *$pc + si + end +end + +define SDR + call rb_vmdebug_stack_dump_raw_current() +end + +define rbi + if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_LABEL + p *(LABEL*)$arg0 + else + if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_INSN + p *(INSN*)$arg0 + else + if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_ADJUST + p *(ADJUST*)$arg0 + else + print *$arg0 + end + end + end +end + +define dump_node + set $str = rb_parser_dump_tree($arg0, 0) + set $flags = ((struct RBasic*)($str))->flags + printf "%s", (char *)(($flags & RUBY_FL_USER1) ? \ + ((struct RString*)$str)->as.heap.ptr : \ + ((struct RString*)$str)->as.embed.ary) +end + +define print_flags + printf "RUBY_FL_WB_PROTECTED: %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_WB_PROTECTED ? "1" : "0" + printf "RUBY_FL_PROMOTED : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_PROMOTED ? "1" : "0" + printf "RUBY_FL_FINALIZE : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_FINALIZE ? "1" : "0" + printf "RUBY_FL_SHAREABLE : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_SHAREABLE ? "1" : "0" + printf "RUBY_FL_EXIVAR : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_EXIVAR ? "1" : "0" + printf "RUBY_FL_FREEZE : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_FREEZE ? "1" : "0" + + printf "RUBY_FL_USER0 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER0 ? "1" : "0" + printf "RUBY_FL_USER1 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER1 ? "1" : "0" + printf "RUBY_FL_USER2 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER2 ? "1" : "0" + printf "RUBY_FL_USER3 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER3 ? "1" : "0" + printf "RUBY_FL_USER4 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER4 ? "1" : "0" + printf "RUBY_FL_USER5 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER5 ? "1" : "0" + printf "RUBY_FL_USER6 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER6 ? "1" : "0" + printf "RUBY_FL_USER7 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER7 ? "1" : "0" + printf "RUBY_FL_USER8 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER8 ? "1" : "0" + printf "RUBY_FL_USER9 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER9 ? "1" : "0" + printf "RUBY_FL_USER10 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER10 ? "1" : "0" + printf "RUBY_FL_USER11 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER11 ? "1" : "0" + printf "RUBY_FL_USER12 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER12 ? "1" : "0" + printf "RUBY_FL_USER13 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER13 ? "1" : "0" + printf "RUBY_FL_USER14 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER14 ? "1" : "0" + printf "RUBY_FL_USER15 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER15 ? "1" : "0" + printf "RUBY_FL_USER16 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER16 ? "1" : "0" + printf "RUBY_FL_USER17 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER17 ? "1" : "0" + printf "RUBY_FL_USER18 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER18 ? "1" : "0" +end + +source -s misc/gdb.py + +# Moved from beginning, since it fails on older gdbs +set startup-with-shell off diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..d98646febf --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,41 @@ +# This is a file used by GitHub to ignore the following commits on `git blame`. +# +# You can also do the same thing in your local repository with: +# $ git config --local blame.ignoreRevsFile .git-blame-ignore-revs + +# Expand tabs +5b21e94bebed90180d8ff63dad03b8b948361089 +c5e9af9c9d890578182a21e7b71b50334cd5579e +e63a2115f64433b21cb5dd67c5bf8b30f87ef293 +712ac99e4d0384a941c80a9f48f62943ba7d97c0 +d1474affa8e105bece209cc9d594bb0a989859e1 +2da92388b948821269b18d6b178a680f17e41750 +5062c0c621d887367af8a054e5e5d83d7ec57dd3 + +# Enable Style/StringLiterals cop for RubyGems/Bundler +d7ffd3fea402239b16833cc434404a7af82d44f3 + +# [ruby/digest] Revert tab-expansion in external files +48b09aae7ec5632209229dcc294dd0d75a93a17f +8a65cf3b61c60e4cb886f59a73ff6db44364bfa9 +39dc9f9093901d40d2998653948d5da38b18ee2c + +# [ruby/io-nonblock] Revert tab expansion +f28287d34c03f472ffe90ea262bdde9affd4b965 +0d842fecb4f75ab3b1d4097ebdb8e88f51558041 +4ba2c66761d6a293abdfba409241d31063cefd62 + +# Make benchmark indentation consistent +fc4acf8cae82e5196186d3278d831f2438479d91 + +# Make prism_compile.c indentation consistent +40b2c8e5e7e6e5f83cee9276dc9c1922a69292d6 +d2c5867357ed88eccc28c2b3bd4a46e206e7ff85 + +# Miss-and-revived commits +a0f7de814ae5c299d6ce99bed5fb308a05d50ba0 +d4e24021d39e1f80f0055b55d91f8d5f22e15084 +7a56c316418980b8a41fcbdc94067b2bda2ad112 +e90282be7ba1bc8e3119f6e1a2c80356ceb3f80a +26a9e0b4e31f7b5a9cbd755e0a15823a8fa51bae +2f53985da9ee593fe524d408256835667938c7d7 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..6ac6e6fcc3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +*.gemspec diff=ruby +*.rb diff=ruby +*.inc.rs linguist-generated=true +bin svn-properties=svn:ignore=ruby +bin/* diff=ruby +tool/update-deps diff=ruby +tool/make-snapshot diff=ruby +tool/format-release diff=ruby +tool/leaked-globals diff=ruby diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000000..56baa29942 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,9 @@ +# Security Policy + +## Supported Versions + +See <https://www.ruby-lang.org/en/downloads/branches/>. + +## Reporting a Vulnerability + +See <https://www.ruby-lang.org/en/security/>. diff --git a/.github/actions/capiext/action.yml b/.github/actions/capiext/action.yml new file mode 100644 index 0000000000..49562725f4 --- /dev/null +++ b/.github/actions/capiext/action.yml @@ -0,0 +1,86 @@ +name: rubyspec C-API extensions + +inputs: + builddir: + required: false + default: '.' + make: + required: false + default: 'make -s' + +outputs: + key: + value: >- + ${{ + !steps.restore.outputs.cache-hit && + github.ref == 'refs/heads/master' && + steps.config.outputs.key + }} + +runs: + using: composite + + steps: + - id: config + shell: bash + run: | + eval $(grep -e '^arch *=' -e '^ruby_version *=' -e '^DLEXT *=' Makefile | + sed 's/ *= */=/') + case "${ruby_version}" in + *+*) key=capiexts-${arch}-${ruby_version}-${{ hashFiles('src/spec/ruby/optional/capi/ext/*.[ch]') }};; + *) key=;; + esac + echo version=$ruby_version >> $GITHUB_OUTPUT + echo key="$key" >> $GITHUB_OUTPUT + echo DLEXT=$DLEXT >> $GITHUB_OUTPUT + working-directory: ${{ inputs.builddir }} + + - name: Restore previous CAPI extensions + uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 + id: cache + with: + path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/ + key: ${{ steps.config.outputs.key }} + if: ${{ steps.config.outputs.key }} + + - name: Run test-spec with previous CAPI extension binaries + id: check + shell: bash + run: | + touch spec/ruby/optional/capi/ext/*.$DLEXT + [ ! -f spec/ruby/optional/capi/ext/\*.$DLEXT ] + ${{ inputs.make }} SPECOPTS=optional/capi test-spec + env: + DLEXT: ${{ steps.config.outputs.DLEXT }} + working-directory: ${{ inputs.builddir }} + if: ${{ steps.cache.outputs.cache-hit }} + + - name: Strip CAPI extensions + id: strip + shell: bash + run: | + rm -f spec/ruby/optional/capi/ext/*.c + [ "$DLEXT" = bundle ] || # separated to .dSYM directories + strip spec/ruby/optional/capi/ext/*.$DLEXT + env: + DLEXT: ${{ steps.config.outputs.DLEXT }} + working-directory: ${{ inputs.builddir }} + if: >- + ${{true + && ! steps.cache.outputs.cache-hit + && github.ref_name == 'master' + }} + + - name: Save CAPI extensions + uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 + with: + path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/ + key: ${{ steps.config.outputs.key }} + if: ${{ steps.strip.outcome == 'success' }} + + - shell: bash + run: | + echo "::error::Change from ${prev} detected; bump up ABI version" + env: + prev: ${{ steps.config.outputs.version }} + if: ${{ always() && steps.check.outcome == 'failure' }} diff --git a/.github/actions/compilers/action.yml b/.github/actions/compilers/action.yml new file mode 100644 index 0000000000..ab5b56a889 --- /dev/null +++ b/.github/actions/compilers/action.yml @@ -0,0 +1,133 @@ +name: Compiles ruby in a container +description: >- + Makes ruby using a dedicated container + +inputs: + tag: + required: false + default: clang-20 + description: >- + container image tag to use in this run. + + with_gcc: + required: false + description: >- + override compiler path & flags. + + CFLAGS: + required: false + description: >- + C compiler flags to override. + + CXXFLAGS: + required: false + description: >- + C++ compiler flags to override. + + optflags: + required: false + # -O1 is faster than -O3 in our tests... Majority of time are consumed trying + # to optimize binaries. Also GitHub Actions run on relatively modern CPUs + # compared to, say, GCC 4 or Clang 3. We don't specify `-march=native` + # because compilers tend not understand what the CPU is. + default: '-O1' + description: >- + Compiler flags for optimisations. + + cppflags: + required: false + description: >- + Additional preprocessor flags. + + append_configure: + required: false + default: >- + --without-valgrind + --without-jemalloc + --without-gmp + description: >- + flags to append to configure. + + enable_shared: + required: false + default: true + description: >- + Whether to build libruby.so. + + check: + required: false + default: '' + description: >- + Whether to run `make check` + + test_all: + required: false + default: '' + description: >- + Whether to run `make test-all` with options for test-all. + + test_spec: + required: false + default: '' + description: >- + Whether to run `make test-spec` with options for mspec. + + static_exts: + required: false + description: >- + whitespace separated list of extensions that need be linked statically. + +runs: + using: composite + steps: + - shell: bash + run: docker pull --quiet 'ghcr.io/ruby/ruby-ci-image:${{ inputs.tag }}' + + - name: Enable Launchable conditionally + id: enable-launchable + run: echo "enable-launchable=true" >> $GITHUB_OUTPUT + shell: bash + if: >- + ${{ + github.repository == 'ruby/ruby' || + (github.repository != 'ruby/ruby' && env.LAUNCHABLE_TOKEN) + }} + + - name: compile + shell: bash + run: >- + docker run + --rm + --user=root + --volume '${{ github.workspace }}:/github/workspace:ro' + --workdir=/github/workspace + --entrypoint=/github/workspace/.github/actions/compilers/entrypoint.sh + --env CI + --env GITHUB_ACTION + --env INPUT_WITH_GCC='${{ inputs.with_gcc || inputs.tag }}' + --env INPUT_CFLAGS='${{ inputs.CFLAGS }}' + --env INPUT_CXXFLAGS='${{ inputs.CXXFLAGS }}' + --env INPUT_OPTFLAGS='${{ inputs.OPTFLAGS }}' + --env INPUT_CPPFLAGS='${{ inputs.cppflags }}' + --env INPUT_APPEND_CONFIGURE='${{ inputs.append_configure }}' + --env INPUT_CHECK='${{ inputs.check }}' + --env INPUT_TEST_ALL='${{ inputs.test_all }}' + --env INPUT_TEST_SPEC='${{ inputs.test_spec }}' + --env INPUT_ENABLE_SHARED='${{ inputs.enable_shared }}' + --env INPUT_STATIC_EXTS='${{ inputs.static_exts }}' + --env LAUNCHABLE_ORGANIZATION='${{ github.repository_owner }}' + --env LAUNCHABLE_WORKSPACE='${{ github.event.repository.name }}' + --env LAUNCHABLE_ENABLED='${{ steps.enable-launchable.outputs.enable-launchable || false }}' + --env GITHUB_PR_HEAD_SHA='${{ github.event.pull_request.head.sha || github.sha }}' + --env GITHUB_PULL_REQUEST_URL='${{ github.event.pull_request.html_url }}' + --env GITHUB_REF='${{ github.ref }}' + --env GITHUB_ACTIONS + --env GITHUB_RUN_ID + --env GITHUB_REPOSITORY + --env GITHUB_WORKFLOW + --env GITHUB_RUN_NUMBER + --env GITHUB_EVENT_NAME + --env GITHUB_SHA + --env GITHUB_HEAD_REF + --env GITHUB_SERVER_URL + 'ghcr.io/ruby/ruby-ci-image:${{ inputs.tag }}' diff --git a/.github/actions/compilers/entrypoint.sh b/.github/actions/compilers/entrypoint.sh new file mode 100755 index 0000000000..b554151091 --- /dev/null +++ b/.github/actions/compilers/entrypoint.sh @@ -0,0 +1,90 @@ +#! /bin/bash + +# Copyright (c) 2024 Ruby developers. All rights reserved. +# +# This file is a part of the programming language Ruby. Permission is hereby +# granted, to either redistribute and/or modify this file, provided that the +# conditions mentioned in the file COPYING are met. Consult the file for +# details. + +grouped() +{ + echo "::group::${@}" + "${@}" + echo "::endgroup::" +} + +set -e +set -u +set -o pipefail + +srcdir="/github/workspace/src" +builddir="$(mktemp -dt)" + +export GITHUB_WORKFLOW='Compilations' +export CONFIGURE_TTY='never' +export RUBY_DEBUG='ci rgengc' +export RUBY_TESTOPTS='-q --color=always --tty=no' +export RUBY_DEBUG_COUNTER_DISABLE='1' +export GNUMAKEFLAGS="-j$((1 + $(nproc)))" + +case "x${INPUT_ENABLE_SHARED}" in +x | xno | xfalse ) + enable_shared='--disable-shared' + ;; +*) + enable_shared='--enable-shared' + ;; +esac + +pushd ${builddir} + +grouped git config --global --add safe.directory ${srcdir} + +grouped ${srcdir}/configure \ + -C \ + --with-gcc="${INPUT_WITH_GCC}" \ + --enable-debug-env \ + --disable-install-doc \ + --with-ext=-test-/cxxanyargs,+ \ + --without-git \ + ${enable_shared} \ + ${INPUT_APPEND_CONFIGURE} \ + CFLAGS="${INPUT_CFLAGS}" \ + CXXFLAGS="${INPUT_CXXFLAGS}" \ + optflags="${INPUT_OPTFLAGS}" \ + cppflags="${INPUT_CPPFLAGS}" \ + debugflags='-ggdb3' # -g0 disables backtraces when SEGV. Do not set that. + +popd + +if [[ -n "${INPUT_STATIC_EXTS}" ]]; then + echo "::group::ext/Setup" + set -x + mkdir ${builddir}/ext + ( + for ext in ${INPUT_STATIC_EXTS}; do + echo "${ext}" + done + ) >> ${builddir}/ext/Setup + set +x + echo "::endgroup::" +fi + +if [ -n "$INPUT_TEST_ALL" ]; then + tests=" -- $INPUT_TEST_ALL" +else + tests=" -- ruby -ext-" +fi + +pushd ${builddir} + +grouped make showflags +grouped make all +# grouped make install + +# Run only `make test` by default. Run other tests if specified. +grouped make test +if [[ -n "$INPUT_CHECK" ]]; then grouped make test-tool; fi +if [[ -n "$INPUT_CHECK" || -n "$INPUT_TEST_ALL" ]]; then grouped make test-all TESTS="$tests"; fi +if [[ -n "$INPUT_CHECK" || -n "$INPUT_TEST_SPEC" ]]; then grouped env CHECK_LEAKS=true make test-spec MSPECOPT="$INPUT_TEST_SPEC"; fi diff --git a/.github/actions/launchable/setup/action.yml b/.github/actions/launchable/setup/action.yml new file mode 100644 index 0000000000..16af8fc3fd --- /dev/null +++ b/.github/actions/launchable/setup/action.yml @@ -0,0 +1,313 @@ +name: Set up Launchable +description: >- + Install the required dependencies and execute the necessary Launchable commands for test recording + +inputs: + os: + required: true + description: The operating system that CI runs on. This value is used in Launchable flavor. + + test-opts: + default: none + required: false + description: >- + Test options that determine how tests are run. + This value is used in the Launchable flavor. + + launchable-token: + required: false + description: >- + Launchable token is needed if you want to run Launchable on your forked repository. + See https://github.com/ruby/ruby/wiki/CI-Servers#launchable-ci for details. + + builddir: + required: false + default: ${{ github.workspace }} + description: >- + Directory to create Launchable report file. + + srcdir: + required: false + default: ${{ github.workspace }} + description: >- + Directory to (re-)checkout source codes. Launchable retrieves the commit information + from the directory. + + test-task: + required: false + default: ${{ matrix.test_task }} + description: >- + Specifies a single test task to be executed. + This value is used in the Launchable flavor. + Either 'test-task' or 'multi-test-tasks' must be configured. + + test-tasks: + required: false + default: '[]' + description: >- + Specifies an array of multiple test tasks to be executed. + For example: '["test", "test-all"]'. + If you want to run a single test task, use the 'test-task' input instead. + + is-yjit: + required: false + default: 'false' + description: >- + Whether this workflow is executed on YJIT. + +outputs: + stdout_report_path: + value: ${{ steps.global.outputs.stdout_report_path }} + description: >- + Report file path for standard output. + + stderr_report_path: + value: ${{ steps.global.outputs.stderr_report_path }} + description: >- + Report file path for standard error. + +runs: + using: composite + + steps: + - name: Enable Launchable conditionally + id: enable-launchable + run: echo "enable-launchable=true" >> $GITHUB_OUTPUT + shell: bash + if: >- + ${{ + (github.repository == 'ruby/ruby' + || (github.repository != 'ruby/ruby' + && env.LAUNCHABLE_TOKEN)) + && (inputs.test-task == 'check' + || inputs.test-task == 'test-all' + || inputs.test-task == 'test' + || contains(fromJSON(inputs.test-tasks), 'test-all') + || contains(fromJSON(inputs.test-tasks), 'test')) + }} + + # Launchable CLI requires Python and Java. + # https://www.launchableinc.com/docs/resources/cli-reference/ + - name: Set up Python + uses: actions/setup-python@871daa956ca9ea99f3c3e30acb424b7960676734 # v5.0.0 + with: + python-version: "3.x" + if: >- + ${{ steps.enable-launchable.outputs.enable-launchable + && !endsWith(inputs.os, 'ppc64le') && !endsWith(inputs.os, 's390x') }} + + - name: Set up Java + uses: actions/setup-java@7a445ee88d4e23b52c33fdc7601e40278616c7f8 # v4.0.0 + with: + distribution: 'temurin' + java-version: '17' + if: >- + ${{ steps.enable-launchable.outputs.enable-launchable + && !endsWith(inputs.os, 'ppc64le') && !endsWith(inputs.os, 's390x') }} + + - name: Set up Java ppc64le + uses: actions/setup-java@7a445ee88d4e23b52c33fdc7601e40278616c7f8 # v4.0.0 + with: + distribution: 'semeru' + architecture: 'ppc64le' + java-version: '17' + if: >- + ${{ steps.enable-launchable.outputs.enable-launchable + && endsWith(inputs.os, 'ppc64le') }} + + - name: Set up Java s390x + uses: actions/setup-java@7a445ee88d4e23b52c33fdc7601e40278616c7f8 # v4.0.0 + with: + distribution: 'semeru' + architecture: 's390x' + java-version: '17' + if: >- + ${{ steps.enable-launchable.outputs.enable-launchable + && endsWith(inputs.os, 's390x') }} + + - name: Set global vars + id: global + shell: bash + run: | + test_all_enabled="${{ inputs.test-task == 'check' || inputs.test-task == 'test-all' || contains(fromJSON(inputs.test-tasks), 'test-all') }}" + btest_enabled="${{ inputs.test-task == 'check' || inputs.test-task == 'test' || contains(fromJSON(inputs.test-tasks), 'test') }}" + test_spec_enabled="${{ inputs.test-task == 'check' || inputs.test-task == 'test-spec' || contains(fromJSON(inputs.test-tasks), 'test-spec') }}" + echo test_all_enabled="${test_all_enabled}" >> $GITHUB_OUTPUT + echo btest_enabled="${btest_enabled}" >> $GITHUB_OUTPUT + echo test_spec_enabled="${test_spec_enabled}" >> $GITHUB_OUTPUT + echo test_all_report_file='launchable_test_all_report.json' >> $GITHUB_OUTPUT + echo btest_report_file='launchable_btest_report.json' >> $GITHUB_OUTPUT + echo test_spec_report_dir='launchable_test_spec_report' >> $GITHUB_OUTPUT + echo stdout_report_path="launchable_stdout.log" >> $GITHUB_OUTPUT + echo stderr_report_path="launchable_stderr.log" >> $GITHUB_OUTPUT + if: steps.enable-launchable.outputs.enable-launchable + + - name: Set environment variables for Launchable + shell: bash + run: | + : # GITHUB_PULL_REQUEST_URL are used for commenting test reports in Launchable Github App. + : # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/link.py#L42 + echo "GITHUB_PULL_REQUEST_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV + : # The following envs are necessary in Launchable tokenless authentication. + : # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/authentication.py#L20 + echo "LAUNCHABLE_ORGANIZATION=${{ github.repository_owner }}" >> $GITHUB_ENV + echo "LAUNCHABLE_WORKSPACE=${{ github.event.repository.name }}" >> $GITHUB_ENV + : # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/authentication.py#L71 + echo "GITHUB_PR_HEAD_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV + echo "LAUNCHABLE_TOKEN=${{ inputs.launchable-token }}" >> $GITHUB_ENV + : # To prevent a slowdown in CI, disable request retries when the Launchable server is unstable. + echo "LAUNCHABLE_SKIP_TIMEOUT_RETRY=1" >> $GITHUB_ENV + echo "LAUNCHABLE_COMMIT_TIMEOUT=1" >> $GITHUB_ENV + if: steps.enable-launchable.outputs.enable-launchable + + - name: Set up path + shell: bash + working-directory: ${{ inputs.srcdir }} + # Since updated PATH variable will be available in only subsequent actions, we need to add the path beforehand. + # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path + run: echo "$(python -msite --user-base)/bin" >> $GITHUB_PATH + if: >- + ${{ + steps.enable-launchable.outputs.enable-launchable + && (startsWith(inputs.os, 'macos') + || endsWith(inputs.os, 'ppc64le') + || endsWith(inputs.os, 's390x')) + }} + + - name: Set up Launchable + id: setup-launchable + shell: bash + working-directory: ${{ inputs.srcdir }} + run: | + set -x + pip install --user launchable + : # The build name cannot include a slash, so we replace the string here. + github_ref="${{ github.ref }}" + github_ref="${github_ref//\//_}" + : # With the --name option, we need to configure a unique identifier for this build. + : # To avoid setting the same build name as the CI which runs on other branches, we use the branch name here. + build_name="${github_ref}_${GITHUB_PR_HEAD_SHA}" + test_opts="${{ inputs.test-opts }}" + test_opts="${test_opts// /}" + test_opts="${test_opts//=/:}" + test_all_test_suite='test-all' + btest_test_suite='btest' + test_spec_test_suite='test-spec' + if [ "${{ inputs.is-yjit }}" = "true" ]; then + test_all_test_suite="yjit-${test_all_test_suite}" + btest_test_suite="yjit-${btest_test_suite}" + test_spec_test_suite="yjit-${test_spec_test_suite}" + fi + # launchable_setup target var -- refers ${target} prefixed variables + launchable_setup() { + local target=$1 session + eval [ "\${${target}_enabled}" = "true" ] || return + eval local suite=\${${target}_test_suite} + session=$(launchable record session \ + --build "${build_name}" \ + --observation \ + --flavor os="${{ inputs.os }}" \ + --flavor test_task="${{ inputs.test-task }}" \ + --flavor test_opts="${test_opts}" \ + --flavor workflow="${{ github.workflow }}" \ + --test-suite ${suite} \ + ) + echo "${target}_session=${session}" >> $GITHUB_OUTPUT + } + + launchable record build --name "${build_name}" + if launchable_setup test_all; then + echo "TESTS=${TESTS:+$TESTS }--launchable-test-reports=${test_all_report_file}" >> $GITHUB_ENV + fi + if launchable_setup btest; then + echo "BTESTS=${BTESTS:+$BTESTS }--launchable-test-reports=${btest_report_file}" >> $GITHUB_ENV + fi + if launchable_setup test_spec; then + echo "SPECOPTS=${SPECOPTS:$SPECOPTS }--launchable-test-reports=${test_spec_report_dir}" >> $GITHUB_ENV + echo test_spec_enabled=true >> $GITHUB_OUTPUT + fi + + echo launchable_setup_dir=$(pwd) >> $GITHUB_OUTPUT + if: steps.enable-launchable.outputs.enable-launchable + env: + test_all_enabled: ${{ steps.global.outputs.test_all_enabled }} + btest_enabled: ${{ steps.global.outputs.btest_enabled }} + test_spec_enabled: ${{ steps.global.outputs.test_spec_enabled }} + test_all_report_file: ${{ steps.global.outputs.test_all_report_file }} + btest_report_file: ${{ steps.global.outputs.btest_report_file }} + test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }} + + - name: make test-spec report directory in build directory + shell: bash + working-directory: ${{ inputs.builddir }} + run: mkdir "${test_spec_report_dir}" + if: ${{ steps.setup-launchable.outputs.test_spec_enabled == 'true' }} + env: + test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }} + + - name: Clean up test results in Launchable + uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0 + with: + shell: bash + working-directory: ${{ inputs.builddir }} + post: | + rm -f "${test_all_report_file}" + rm -f "${btest_report_file}" + rm -fr "${test_spec_report_dir}" + rm -f launchable_stdout.log + rm -f launchable_stderr.log + if: always() && steps.setup-launchable.outcome == 'success' + env: + test_all_report_file: ${{ steps.global.outputs.test_all_report_file }} + btest_report_file: ${{ steps.global.outputs.btest_report_file }} + test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }} + + - name: Record test results in Launchable + uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0 + with: + shell: bash + working-directory: ${{ inputs.builddir }} + post: | + if [[ "${test_all_enabled}" = "true" ]]; then \ + launchable record attachment \ + --session "${test_all_session}" \ + "${stdout_report_path}" \ + "${stderr_report_path}"; \ + launchable record tests \ + --session "${test_all_session}" \ + raw "${test_all_report_file}" || true; \ + fi + + if [[ "${btest_enabled}" = "true" ]]; then \ + launchable record attachment \ + --session "${btest_session}" \ + "${stdout_report_path}" \ + "${stderr_report_path}"; \ + launchable record tests \ + --session "${btest_session}" \ + raw "${btest_report_file}" || true; \ + fi + + if [[ "${test_spec_enabled}" = "true" ]]; then \ + launchable record attachment \ + --session "${test_spec_session}" \ + "${stdout_report_path}" \ + "${stderr_report_path}"; \ + launchable record tests \ + --session "${test_spec_session}" \ + raw ${test_spec_report_dir}/* || true; \ + fi + if: ${{ always() && steps.setup-launchable.outcome == 'success' }} + env: + test_all_report_file: ${{ steps.global.outputs.test_all_report_file }} + btest_report_file: ${{ steps.global.outputs.btest_report_file }} + test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }} + test_all_enabled: ${{ steps.global.outputs.test_all_enabled }} + btest_enabled: ${{ steps.global.outputs.btest_enabled }} + test_spec_enabled: ${{ steps.global.outputs.test_spec_enabled }} + test_all_session: ${{ steps.setup-launchable.outputs.test_all_session }} + btest_session: ${{ steps.setup-launchable.outputs.btest_session }} + test_spec_session: ${{ steps.setup-launchable.outputs.test_spec_session }} + stdout_report_path: ${{ steps.global.outputs.stdout_report_path }} + stderr_report_path: ${{ steps.global.outputs.stderr_report_path }} + LAUNCHABLE_SETUP_DIR: ${{ steps.setup-launchable.outputs.launchable_setup_dir }} diff --git a/.github/actions/setup/directories/action.yml b/.github/actions/setup/directories/action.yml new file mode 100644 index 0000000000..0e8ffd59ef --- /dev/null +++ b/.github/actions/setup/directories/action.yml @@ -0,0 +1,194 @@ +name: Setup directories etc. +description: >- + Set up the source code and build directories (plus some + environmental tweaks) + +inputs: + srcdir: + required: false + default: ${{ github.workspace }} + description: >- + Directory to (re-)checkout source codes. This will be created + if absent. If there is no `configure` file that is also + generated inside. + + builddir: + required: false + default: ${{ github.workspace }} + description: >- + Where binaries and other generated contents go. This will be + created if absent. + + make-command: + required: false + type: string + default: 'make' + description: >- + The command of `make`. + + makeup: + required: false + type: boolean + # Note that `default: false` evaluates to a string constant + # `'false'`, which is a truthy value :sigh: + # https://github.com/actions/runner/issues/2238 + default: '' + description: >- + If set to true, additionally runs `make up`. + + checkout: + required: false + type: boolean + default: true + description: >- + If set to '' (false), skip running actions/checkout. This is useful when + you don't want to overwrite a GitHub token that is already set up. + + dummy-files: + required: false + type: boolean + default: '' + description: >- + If set to true, creates dummy files in build dir. + + fetch-depth: + required: false + default: '1' + description: The depth of commit history fetched from the remote repository + + clean: + required: false + type: boolean + default: '' + description: >- + If set to true, clean build directory. + +outputs: {} # nothing? + +runs: + using: composite + + steps: + # Note that `shell: bash` works on both Windows and Linux, but not + # `shell: sh`. This is because GitHub hosted Windows runners have + # their bash manually installed. + - shell: bash + run: | + mkdir -p ${{ inputs.srcdir }} + mkdir -p ${{ inputs.builddir }} + + # Did you know that actions/checkout works without git(1)? We are + # checking that here. + - id: which + shell: bash + run: | + echo "git=`command -v git`" >> "$GITHUB_OUTPUT" + echo "sudo=`sudo true && command -v sudo`" >> "$GITHUB_OUTPUT" + echo "autoreconf=`command -v autoreconf`" >> "$GITHUB_OUTPUT" + + - if: steps.which.outputs.git + shell: bash + run: | + git config --global core.autocrlf false + git config --global core.eol lf + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + + - if: inputs.checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + path: ${{ inputs.srcdir }} + fetch-depth: ${{ inputs.fetch-depth }} + + - uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 + with: + path: ${{ inputs.srcdir }}/.downloaded-cache + key: ${{ runner.os }}-${{ runner.arch }}-downloaded-cache + + - if: steps.which.outputs.autoreconf + shell: bash + working-directory: ${{ inputs.srcdir }} + run: ./autogen.sh --install + + # This is for MinGW. + - if: runner.os == 'Windows' + shell: bash + run: echo "GNUMAKEFLAGS=-j$((2 * NUMBER_OF_PROCESSORS))" >> $GITHUB_ENV + + - if: runner.os == 'Linux' + shell: bash + run: echo "GNUMAKEFLAGS=-sj$((1 + $(nproc)))" >> "$GITHUB_ENV" + + # macOS' GNU make is so old that they doesn't understand `GNUMAKEFLAGS`. + - if: runner.os == 'macOS' + shell: bash + run: echo "MAKEFLAGS=-j$((1 + $(sysctl -n hw.activecpu)))" >> "$GITHUB_ENV" + + - if: inputs.makeup + shell: bash + working-directory: ${{ inputs.srcdir }} + run: | + touch config.status .rbconfig.time + for mk in Makefile GNUmakefile; do + sed -f tool/prereq.status template/$mk.in > $mk + done + make up + + # Cleanup, runs even on failure + - if: always() && inputs.makeup + shell: bash + working-directory: ${{ inputs.srcdir }} + run: | + rm -f config.status .rbconfig.time \ + Makefile GNUmakefile uncommon.mk enc.mk noarch-fake.rb + + - if: steps.which.outputs.sudo + shell: bash + run: | + sudo chmod -R go-w /usr/share + chmod -v go-w $HOME $HOME/.config || : + declare -a dirs # -A is not supported by old bash, e.g. macos + SAVE_IFS="$IFS" IFS=:; set $PATH + for d do + while [ -d "$d" ]; do + case "$IFS${dirs[*]}$IFS" in *"$IFS$d$IFS"*) ;; *) dirs+=("$d");; esac + d="${d%/*}" + done + done + IFS="$SAVE_IFS" + sudo chmod -v go-w "${dirs[@]}" || : + + - if: inputs.dummy-files == 'true' + shell: bash + id: dummy-files + working-directory: ${{ inputs.builddir }} + run: | + : Create dummy files in build dir + set {{a..z},{A..Z},{0..9},foo,bar,test,zzz}.rb + for file; do \ + echo > $file "raise 'do not load $file'"; \ + done + # drop {a..z}.rb if case-insensitive filesystem + grep -F A.rb a.rb > /dev/null && set "${@:27}" + echo clean="cd ${{ inputs.builddir }} && rm $*" >> $GITHUB_OUTPUT + + - if: inputs.clean == 'true' + shell: bash + id: clean + run: | + echo distclean='cd ${{ inputs.builddir }} && ${{ inputs.make-command }} distclean' >> $GITHUB_OUTPUT + echo remained-files='find ${{ inputs.builddir }} -ls' >> $GITHUB_OUTPUT + [ "${{ inputs.builddir }}" = "${{ inputs.srcdir }}" ] || + echo final='rmdir ${{ inputs.builddir }}' >> $GITHUB_OUTPUT + + - name: clean + uses: gacts/run-and-post-run@81b6ce503cde93862cec047c54652e45c5dca991 # v1.4.3 + with: + working-directory: + post: | + ${{ steps.dummy-files.outputs.clean }} + ${{ steps.clean.outputs.distclean }} + ${{ steps.clean.outputs.remained-files }} + ${{ steps.clean.outputs.final }} + # rmdir randomly fails due to launchable files + continue-on-error: true diff --git a/.github/actions/setup/macos/action.yml b/.github/actions/setup/macos/action.yml new file mode 100644 index 0000000000..d0072ff828 --- /dev/null +++ b/.github/actions/setup/macos/action.yml @@ -0,0 +1,29 @@ +name: Setup macOS environment +description: >- + Installs necessary packages via Homebrew. + +inputs: {} # nothing? + +outputs: {} # nothing? + +runs: + using: composite + + steps: + - name: brew + shell: bash + run: | + brew install --quiet jemalloc gmp libffi openssl@3 zlib autoconf automake libtool + + - name: Set ENV + shell: bash + run: | + dir_config() { + local args=() lib var="$1"; shift + for lib in "$@"; do + args+=("--with-${lib%@*}-dir=$(brew --prefix $lib)") + done + echo "$var=${args[*]}" >> $GITHUB_ENV + } + dir_config ruby_configure_args gmp + dir_config CONFIGURE_ARGS openssl@3 diff --git a/.github/actions/setup/ubuntu/action.yml b/.github/actions/setup/ubuntu/action.yml new file mode 100644 index 0000000000..a9e5b41951 --- /dev/null +++ b/.github/actions/setup/ubuntu/action.yml @@ -0,0 +1,53 @@ +name: Setup ubuntu environment +description: >- + At the beginning there was no way but to copy & paste `apt-get` + everywhere. But now that we have composite actions, it seems better + merge them into one. + +inputs: + arch: + required: false + default: '' + description: >- + Architecture. Because we run this on a GitHub-hosted runner + acceptable value for this input is very limited. + +outputs: + arch: + value: ${{ steps.uname.outputs.uname }} + description: >- + Actual architecture. This could be different from the one + passed to the `inputs.arch`. For instance giving `i386` to this + action yields `i686`. + +runs: + using: composite + + steps: + - name: set SETARCH + shell: bash + run: echo "SETARCH=${setarch}" >> "$GITHUB_ENV" + env: + setarch: ${{ inputs.arch && format('setarch {0} --', inputs.arch) }} + + - id: uname + name: uname + shell: bash + run: | + echo uname=`${SETARCH} uname -m` >> "$GITHUB_OUTPUT" + echo dpkg=`${SETARCH} uname -m | sed s/686/386/` >> "$GITHUB_OUTPUT" + + - name: apt-get + shell: bash + env: + arch: ${{ inputs.arch && format(':{0}', steps.uname.outputs.dpkg) || '' }} + run: | + set -x + ${arch:+sudo dpkg --add-architecture ${arch#:}} + sudo apt-get update -qq || : + sudo apt-get install --no-install-recommends -qq -y -o=Dpkg::Use-Pty=0 \ + ${arch:+cross}build-essential${arch/:/-} \ + libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \ + zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch} \ + autoconf ruby + sudo apt-get install -qq -y pkg-config${arch} || : diff --git a/.github/actions/slack/action.yml b/.github/actions/slack/action.yml new file mode 100644 index 0000000000..4a398da1d1 --- /dev/null +++ b/.github/actions/slack/action.yml @@ -0,0 +1,51 @@ +name: Post a message to slack +description: >- + We have our ruby/action-slack webhook. However its arguments are + bit verbose to be listed in every workflow files. Better merge them + into one. + +inputs: + SLACK_WEBHOOK_URL: + required: true + description: >- + The URL to post the payload. This is an input because it tends + to be stored in a secrets vault and a composite action cannot + look into one. + + label: + required: false + description: >- + Human-readable description of the run, something like "DEBUG=1". + This need not be unique among runs. + + event_name: + required: false + default: 'push' + description: >- + Target event to trigger notification. Notify only push by default. + + extra_channel_id: + required: false + description: >- + Slack channel ID to notify besides #alerts and #alerts-emoji. + +outputs: {} # Nothing? + +runs: + using: composite + + steps: + - uses: ruby/action-slack@54175162371f1f7c8eb94d7c8644ee2479fcd375 # v3.2.2 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ github.workflow }}${{ inputs.label && format(' / {0}', inputs.label) }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref_name }}" + ${{ inputs.extra_channel_id && format(', "extra_channel_id": "{0}"', inputs.extra_channel_id) }} + } + env: + SLACK_WEBHOOK_URL: ${{ inputs.SLACK_WEBHOOK_URL }} + if: ${{ github.event_name == inputs.event_name && startsWith(github.repository, 'ruby/') }} diff --git a/.github/auto_request_review.yml b/.github/auto_request_review.yml new file mode 100644 index 0000000000..38496d5ceb --- /dev/null +++ b/.github/auto_request_review.yml @@ -0,0 +1,20 @@ +files: + 'yjit*': [team:jit] + 'yjit/**/*': [team:jit] + 'yjit/src/cruby_bindings.inc.rs': [] + 'bootstraptest/test_yjit*': [team:jit] + 'test/ruby/test_yjit*': [team:jit] + 'zjit*': [team:jit] + 'zjit/**/*': [team:jit] + 'zjit/src/cruby_bindings.inc.rs': [] + 'test/ruby/test_zjit*': [team:jit] + 'defs/jit.mk': [team:jit] + 'tool/zjit_bisect.rb': [team:jit] + 'doc/jit/*': [team:jit] + # Skip github workflow files because the team don't necessarily need to review dependabot updates for GitHub Actions. It's noisy in notifications, and they're auto-merged anyway. +options: + ignore_draft: true + # This currently doesn't work as intended. We want to skip reviews when only + # cruby_bingings.inc.rs is modified, but this skips reviews even when other + # files are modified as well. To be enabled after fixing the behavior. + #last_files_match_only: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..2c2982d1d4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' + - package-ecosystem: 'github-actions' + directory: '/.github/actions/slack' + schedule: + interval: 'daily' + - package-ecosystem: 'github-actions' + directory: '/.github/actions/setup/directories' + schedule: + interval: 'daily' + - package-ecosystem: 'cargo' + directory: '/yjit' + schedule: + interval: 'daily' + - package-ecosystem: 'vcpkg' + directory: '/' + schedule: + interval: 'daily' diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..e81aed8e98 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,6 @@ +Documentation: +- changed-files: + - all-globs-to-all-files: doc/** + +Backport: +- base-branch: 'ruby_3_\d' diff --git a/.github/workflows/annocheck.yml b/.github/workflows/annocheck.yml new file mode 100644 index 0000000000..899d601aef --- /dev/null +++ b/.github/workflows/annocheck.yml @@ -0,0 +1,110 @@ +name: Annocheck + +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + compile: + name: test-annocheck + + runs-on: ubuntu-latest + + container: + image: ghcr.io/ruby/ruby-ci-image:gcc-11 + options: --user root + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + env: + CONFIGURE_TTY: never + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + RUBY_DEBUG: ci rgengc + RUBY_TESTOPTS: >- + -q + --color=always + --tty=no + # FIXME: Drop skipping options + # https://bugs.ruby-lang.org/issues/18061 + # https://sourceware.org/annobin/annobin.html/Test-pie.html + TEST_ANNOCHECK_OPTS: '--skip-pie --skip-gaps' + + steps: + - run: id + working-directory: + + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.1' + bundler: none + + # Minimal flags to pass the check. + # -g0 disables backtraces when SEGV. Do not set that. + - name: Run configure + run: > + ../src/configure -C + --enable-debug-env + --disable-install-doc + --with-ext=-test-/cxxanyargs,+ + --without-valgrind + --without-jemalloc + --without-gmp + --with-gcc="gcc-11 -fcf-protection -Wa,--generate-missing-build-notes=yes" + --enable-shared + debugflags=-ggdb3 + optflags=-O2 + LDFLAGS=-Wl,-z,now + + - run: make showflags + + - run: make + + - run: make test-annocheck + + - uses: ./.github/actions/slack + with: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/auto_request_review.yml b/.github/workflows/auto_request_review.yml new file mode 100644 index 0000000000..207315a084 --- /dev/null +++ b/.github/workflows/auto_request_review.yml @@ -0,0 +1,20 @@ +name: Auto Request Review +on: + pull_request_target: + types: [opened, ready_for_review, reopened] + branches: [master] + +permissions: + contents: read + +jobs: + auto-request-review: + name: Auto Request Review + runs-on: ubuntu-latest + if: ${{ github.repository == 'ruby/ruby' && github.base_ref == 'master' }} + steps: + - name: Request review based on files changes and/or groups the author belongs to + uses: necojackarc/auto-request-review@e89da1a8cd7c8c16d9de9c6e763290b6b0e3d424 # v0.13.0 + with: + # scope: public_repo + token: ${{ secrets.MATZBOT_AUTO_REQUEST_REVIEW_TOKEN }} diff --git a/.github/workflows/auto_review_pr.yml b/.github/workflows/auto_review_pr.yml new file mode 100644 index 0000000000..ad0e63ba12 --- /dev/null +++ b/.github/workflows/auto_review_pr.yml @@ -0,0 +1,33 @@ +name: Auto Review PR +on: + pull_request_target: + types: [opened, ready_for_review, reopened] + branches: [master] + +permissions: + contents: read + +jobs: + auto-review-pr: + name: Auto Review PR + runs-on: ubuntu-latest + if: ${{ github.repository == 'ruby/ruby' && github.base_ref == 'master' }} + + permissions: + pull-requests: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v6.0.1 + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.4' + bundler: none + + - name: Auto Review PR + run: ruby tool/auto_review_pr.rb "$GITHUB_PR_NUMBER" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml new file mode 100644 index 0000000000..d3e734f885 --- /dev/null +++ b/.github/workflows/baseruby.yml @@ -0,0 +1,74 @@ +name: BASERUBY Check + +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + baseruby: + name: BASERUBY + + runs-on: ubuntu-22.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + strategy: + matrix: + ruby: + - ruby-3.1 + - ruby-3.2 + - ruby-3.3 + + steps: + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: ${{ matrix.ruby }} + bundler: none + + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - uses: ./.github/actions/setup/ubuntu + + - uses: ./.github/actions/setup/directories + with: + makeup: true + + - run: ./configure --disable-install-doc + + - run: make all + + - run: make test + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.ruby }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml new file mode 100644 index 0000000000..59f64e8312 --- /dev/null +++ b/.github/workflows/bundled_gems.yml @@ -0,0 +1,190 @@ +name: bundled_gems + +env: + UPDATE_ENABLED: true + +on: + push: + branches: ['master'] + paths: + - '.github/workflows/bundled_gems.yml' + - 'gems/bundled_gems' + pull_request: + branches: ['master'] + paths: + - '.github/workflows/bundled_gems.yml' + - 'gems/bundled_gems' + merge_group: + schedule: + - cron: '45 6 * * *' + workflow_dispatch: + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + update: + permissions: + contents: write # for Git to git push + + if: ${{ github.event_name != 'schedule' || github.repository == 'ruby/ruby' }} + + name: update ${{ github.workflow }} + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} + + - uses: ./.github/actions/setup/directories + with: + # Skip overwriting MATZBOT_AUTO_UPDATE_TOKEN + checkout: '' # false (ref: https://github.com/actions/runner/issues/2238) + + - name: Set ENV + run: | + echo "TODAY=$(date +%F)" >> $GITHUB_ENV + + - name: Download previous gems list + run: | + mkdir -p .downloaded-cache + for data in bundled_gems.json default_gems.json; do + ln -s .downloaded-cache/$data . + curl -O -R -z ./$data https://stdgems.org/$data + done + + - name: Update bundled gems list + id: bundled_gems + run: | + ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems >> $GITHUB_OUTPUT + if: ${{ env.UPDATE_ENABLED == 'true' }} + + - name: Update spec/bundler/support/builders.rb + run: | + #!ruby + rake_version = File.read("gems/bundled_gems")[/^rake\s+(\S+)/, 1] + print ARGF.read.sub(/^ *def rake_version\s*\K".*?"/) {rake_version.dump} + shell: ruby -i~ {0} spec/bundler/support/builders.rb + if: ${{ env.UPDATE_ENABLED == 'true' }} + + - name: Maintain updated gems list in NEWS + run: | + ruby tool/update-NEWS-gemlist.rb bundled + if: ${{ env.UPDATE_ENABLED == 'true' }} + + - name: Check diffs + id: diff + run: | + news= gems= + git diff --color --no-ext-diff --ignore-submodules --exit-code -- NEWS.md || + news=true + git diff --color --no-ext-diff --ignore-submodules --exit-code -- gems/bundled_gems || + gems=true + git add -- NEWS.md gems/bundled_gems + git add -- spec/bundler/support/builders.rb + echo news=$news >> $GITHUB_OUTPUT + echo gems=$gems >> $GITHUB_OUTPUT + echo update=${news:-$gems} >> $GITHUB_OUTPUT + + - name: Commit + id: commit + run: | + git pull --ff-only origin ${GITHUB_REF#refs/heads/} + message="Update bundled gems list" + if [ -z "${gems}" ]; then + git commit --message="[DOC] ${message} at ${GITHUB_SHA:0:30}" + else + git commit --message="${message} as of ${TODAY}" + fi + env: + TODAY: ${{ steps.bundled_gems.outputs.latest_date || env.TODAY }} + EMAIL: svn-admin@ruby-lang.org + GIT_AUTHOR_NAME: git + GIT_COMMITTER_NAME: git + gems: ${{ steps.diff.outputs.gems }} + if: ${{ steps.diff.outputs.update }} + + - name: Development revision of bundled gems + run: | + #!ruby + file = "gems/bundled_gems" + + SECONDS_IN_DAY = 86400 + today = Time.new("#{ENV['TODAY']}Z") + if !(december = today.month == 12) + days = 30 + elsif (days = 26 - today.day).positive? + days += 4 + else + puts "::info:: just after released" + exit + end + + since = "#{today.year-1}-12-26" + ref = ENV['GITHUB_REF'] + puts "::group::\e[94mfetching \e[1m#{file}\e[22m since \e[1m#{since}\e[22m from \e[1m#{ref}\e[m" + system(*%W[git fetch --shallow-since=#{since} --no-tags origin #{ref}], exception: true) + puts "::endgroup::" + + puts "\e[94mchecking development version bundled gems older than \e[1m#{days}\e[22m days\e[m" + limit = today.to_i - days * SECONDS_IN_DAY + old = 0 + IO.popen(%W"git blame --line-porcelain -- #{file}") do |blame| + while head = blame.gets("\n\t") and s = blame.gets + next unless (gem = s.split(/\s+|#.*/)).size > 3 + time = head[/^committer-time \K\d+/].to_i + next if (d = limit - time) <= 0 + d /= SECONDS_IN_DAY + line = head[/\A\h+ \d+ \K\d+/].to_i + level = if d < days; 'warning'; else old += 1; 'error'; end + d += days + puts "::#{level} file=#{file},line=#{line},title=Older than #{d} days::#{gem[0]} #{gem[3]}" + end + end + abort "::error title=Too long-standing gems::The release comes soon." if december and old.nonzero? + shell: ruby {0} + env: + file: ${{ steps.logs.outputs.file }} + days: ${{ steps.logs.outputs.days }} + + - name: Install libraries + uses: ./.github/actions/setup/ubuntu + if: ${{ steps.diff.outputs.gems }} + + - name: Build + run: | + ./autogen.sh + ./configure -C --disable-install-doc + make + if: ${{ steps.diff.outputs.gems }} + + - name: Prepare bundled gems + run: | + make -s prepare-gems + if: ${{ steps.diff.outputs.gems }} + + - name: Test bundled gems + run: | + make -s test-bundled-gems + timeout-minutes: 30 + env: + RUBY_TESTOPTS: '-q --tty=no' + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + if: ${{ steps.diff.outputs.gems }} + + - name: Push + run: | + git push origin ${GITHUB_REF#refs/heads/} + if: >- + ${{ + github.repository == 'ruby/ruby' && + !startsWith(github.event_name, 'pull') && + steps.commit.outcome == 'success' + }} + + - uses: ./.github/actions/slack + with: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml new file mode 100644 index 0000000000..c5dec65e48 --- /dev/null +++ b/.github/workflows/check_dependencies.yml @@ -0,0 +1,59 @@ +name: Check Dependencies +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + update-deps: + name: Dependency checks + + strategy: + matrix: + os: [ubuntu-latest] + fail-fast: true + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - uses: ./.github/actions/setup/ubuntu + if: ${{ contains(matrix.os, 'ubuntu') }} + + - uses: ./.github/actions/setup/macos + if: ${{ contains(matrix.os, 'macos') }} + + - uses: ./.github/actions/setup/directories + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.1' + bundler: none + + - name: Run configure + run: ./configure -C --disable-install-doc --disable-rubygems --with-gcc 'optflags=-O0' 'debugflags=-save-temps=obj -g' + + - run: make fix-depends + + - run: git diff --no-ext-diff --ignore-submodules --exit-code + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.os }} / Dependencies need to update + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} diff --git a/.github/workflows/check_misc.yml b/.github/workflows/check_misc.yml new file mode 100644 index 0000000000..2a2bd1df53 --- /dev/null +++ b/.github/workflows/check_misc.yml @@ -0,0 +1,127 @@ +name: Misc +on: [push, pull_request, merge_group] + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + checks: + name: Miscellaneous checks + + permissions: + contents: write # for Git to git push + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} + + - uses: ./.github/actions/setup/directories + with: + makeup: true + # Skip overwriting MATZBOT_AUTO_UPDATE_TOKEN + checkout: '' # false (ref: https://github.com/actions/runner/issues/2238) + + - name: Check for code styles + run: | + set -x + ruby tool/auto-style.rb "$GITHUB_OLD_SHA" "$GITHUB_NEW_SHA" + env: + GITHUB_OLD_SHA: ${{ github.event.pull_request.base.sha }} + GITHUB_NEW_SHA: ${{ github.event.pull_request.merge_commit_sha }} + # Skip 'push' events because post_push.yml fixes them on push + if: ${{ github.repository == 'ruby/ruby' && startsWith(github.event_name, 'pull') }} + + - name: Check for bash specific substitution in configure.ac + run: | + git grep -n '\${[A-Za-z_0-9]*/' -- configure.ac && exit 1 || : + + - name: Check for header macros + run: | + fail= + for header in ruby/*.h; do + git grep -l -F -e $header -e HAVE_`echo $header | tr a-z./ A-Z__` -- . > /dev/null && continue + fail=1 + echo $header + done + exit $fail + working-directory: include + + - id: now + run: | + date +"mon=%-m"%n"day=%-d" >> $GITHUB_OUTPUT + env: + TZ: Tokyo/Asia + + - id: deprecation + run: | + eval $(sed -n 's/^#define RUBY_API_VERSION_\(MAJOR\|MINOR\) /\1=/p' include/ruby/version.h) + if git --no-pager grep --color -o 'rb_warn_deprecated_to_remove_at('$MAJOR'\.'$MINOR',.*' -- '*.c' >&2; then + false + else + true + fi + continue-on-error: ${{ steps.now.outputs.mon < 12 }} + + - name: Check if to generate documents + id: rdoc + run: | + set -- $(sed 's/#.*//;/^rdoc /!d' gems/bundled_gems) + { echo version=$2; echo ref=$4; } >> $GITHUB_OUTPUT + echo RDOC='ruby -W0 --disable-gems tool/rdoc-srcdir -q' >> $GITHUB_ENV + + - name: Checkout rdoc + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + repository: ruby/rdoc + ref: ${{ steps.rdoc.outputs.ref }} + path: .bundle/gems/rdoc-${{ steps.rdoc.outputs.version }} + if: ${{ steps.rdoc.outputs.ref != '' }} + + - name: Generate rdoc + run: | + set -x + gempath=$(ruby -e 'print Gem.user_dir, "/bin"') + PATH=$gempath:$PATH + gem install --user bundler + bundle config --local path vendor/bundle + bundle install --jobs 4 + bundle exec rake generate + working-directory: .bundle/gems/rdoc-${{ steps.rdoc.outputs.version }} + if: ${{ steps.rdoc.outputs.ref != '' }} + + - name: Core docs coverage + run: | + $RDOC -C -x ^ext -x ^lib . + + - name: Generate docs + id: docs + run: | + $RDOC --op html . + echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT + # Generate only when document commit/PR + if: >- + ${{false + || contains(github.event.head_commit.message, '[ruby/rdoc]') + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + }} + + - name: Upload docs + uses: actions/upload-artifact@v6.0.0 + with: + path: html + name: ${{ steps.docs.outputs.htmlout }} + if: ${{ steps.docs.outcome == 'success' }} + + - uses: ./.github/actions/slack + with: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..a92c93b476 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,121 @@ +name: 'CodeQL' + +on: + push: + branches: ['master'] + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + schedule: + - cron: '0 12 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read # for github/codeql-action/init to get workflow details + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/autobuild to send a status report + # CodeQL fails to run pull requests from dependabot due to missing write access to upload results. + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + env: + enable_install_doc: no + + strategy: + fail-fast: false + matrix: + include: + - language: cpp + - language: ruby + + steps: + - name: Checkout repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: Install libraries + if: ${{ contains(matrix.os, 'macos') }} + uses: ./.github/actions/setup/macos + + - name: Install libraries + if : ${{ matrix.os == 'ubuntu-latest' }} + uses: ./.github/actions/setup/ubuntu + + - uses: ./.github/actions/setup/directories + + - name: Remove an obsolete rubygems vendored file + if: ${{ matrix.os == 'ubuntu-latest' }} + run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb + + - name: Initialize CodeQL + uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + with: + languages: ${{ matrix.language }} + trap-caching: false + debug: true + + - name: Autobuild + uses: github/codeql-action/autobuild@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + with: + category: '/language:${{ matrix.language }}' + upload: False + output: sarif-results + + - name: filter-sarif + uses: advanced-security/filter-sarif@f3b8118a9349d88f7b1c0c488476411145b6270d # v1.0.1 + with: + patterns: | + +**/*.rb + -lib/uri/mailto.rb:rb/overly-large-range + -lib/uri/rfc3986_parser.rb:rb/overly-large-range + -lib/bundler/vendor/uri/lib/uri/mailto.rb:rb/overly-large-range + -lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb:rb/overly-large-range + -test/ruby/test_io.rb:rb/non-constant-kernel-open + -test/open-uri/test_open-uri.rb:rb/non-constant-kernel-open + -test/open-uri/test_ssl.rb:rb/non-constant-kernel-open + -spec/ruby/core/io/binread_spec.rb:rb/non-constant-kernel-open + -spec/ruby/core/io/readlines_spec.rb:rb/non-constant-kernel-open + -spec/ruby/core/io/foreach_spec.rb:rb/non-constant-kernel-open + -spec/ruby/core/io/write_spec.rb:rb/non-constant-kernel-open + -spec/ruby/core/io/read_spec.rb:rb/non-constant-kernel-open + -spec/ruby/core/kernel/open_spec.rb:rb/non-constant-kernel-open + input: sarif-results/${{ matrix.language }}.sarif + output: sarif-results/${{ matrix.language }}.sarif + if: ${{ matrix.language == 'ruby' }} + continue-on-error: true + + - name: Upload SARIF + uses: github/codeql-action/upload-sarif@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + with: + sarif_file: sarif-results/${{ matrix.language }}.sarif + continue-on-error: true diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml new file mode 100644 index 0000000000..8c0ca54e0b --- /dev/null +++ b/.github/workflows/compilers.yml @@ -0,0 +1,335 @@ +# Some tests depending on this name 'Compilations' via $GITHUB_WORKFLOW. Make sure to update such tests when renaming this workflow. +name: Compilations + +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +# Each job is split so that they roughly take 30min to run through. +jobs: + compile-if: + name: 'omnibus compilations, trigger' + runs-on: ubuntu-latest + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + steps: + - run: true + working-directory: + + compile1: + name: 'omnibus compilations, #1' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + # Set fetch-depth: 10 so that Launchable can receive commits information. + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - name: 'clang 18 LTO' + uses: './.github/actions/compilers' + with: + tag: clang-18 + with_gcc: 'clang-18 -flto=auto' + optflags: '-O2' + enable_shared: false + timeout-minutes: 30 + - { uses: './.github/actions/compilers', name: '-O0', with: { optflags: '-O0 -march=x86-64 -mtune=generic' }, timeout-minutes: 5 } + # - { uses: './.github/actions/compilers', name: '-O3', with: { optflags: '-O3 -march=x86-64 -mtune=generic', check: true } } + + compile2: + name: 'omnibus compilations, #2' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - name: 'GCC 15 LTO' + uses: './.github/actions/compilers' + with: + tag: gcc-15 + with_gcc: 'gcc-15 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' + optflags: '-O2' + enable_shared: false + timeout-minutes: 10 + - { uses: './.github/actions/compilers', name: 'ext/Setup', with: { static_exts: 'etc json/* */escape' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 15', with: { tag: 'gcc-15' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 14', with: { tag: 'gcc-14' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 13', with: { tag: 'gcc-13' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 12', with: { tag: 'gcc-12' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 11', with: { tag: 'gcc-11' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 10', with: { tag: 'gcc-10' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 9', with: { tag: 'gcc-9' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 8', with: { tag: 'gcc-8' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GCC 7', with: { tag: 'gcc-7' }, timeout-minutes: 5 } + + compile3: + name: 'omnibus compilations, #3' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'clang 22', with: { tag: 'clang-22' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 21', with: { tag: 'clang-21' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 20', with: { tag: 'clang-20' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 19', with: { tag: 'clang-19' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 18', with: { tag: 'clang-18' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 17', with: { tag: 'clang-17' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 16', with: { tag: 'clang-16' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 15', with: { tag: 'clang-15' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 14', with: { tag: 'clang-14' }, timeout-minutes: 5 } + + compile4: + name: 'omnibus compilations, #4' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'clang 13', with: { tag: 'clang-13' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 12', with: { tag: 'clang-12' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 11', with: { tag: 'clang-11' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 10', with: { tag: 'clang-10' }, timeout-minutes: 5 } + # llvm-objcopy<=9 doesn't have --wildcard. It compiles, but leaves Rust symbols in libyjit.o and fail `make test-leaked-globals`. + - { uses: './.github/actions/compilers', name: 'clang 9', with: { tag: 'clang-9', append_configure: '--disable-yjit --disable-zjit' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 8', with: { tag: 'clang-8', append_configure: '--disable-yjit --disable-zjit' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 7', with: { tag: 'clang-7', append_configure: '--disable-yjit --disable-zjit' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'clang 6', with: { tag: 'clang-6.0', append_configure: '--disable-yjit --disable-zjit' }, timeout-minutes: 5 } + + compile5: + name: 'omnibus compilations, #5' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + # -Wno-strict-prototypes is necessary with current clang-15 since + # older autoconf generate functions without prototype and -pedantic + # now implies strict-prototypes. Disabling the error but leaving the + # warning generates a lot of noise from use of ANYARGS in + # rb_define_method() and friends. + # See: https://github.com/llvm/llvm-project/commit/11da1b53d8cd3507959022cd790d5a7ad4573d94 + - { uses: './.github/actions/compilers', name: 'C99', with: { CFLAGS: '-std=c99 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C11', with: { CFLAGS: '-std=c11 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C17', with: { CFLAGS: '-std=c17 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C23', with: { CFLAGS: '-std=c2x -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C++98', with: { CXXFLAGS: '-std=c++98 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C++11', with: { CXXFLAGS: '-std=c++11 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C++14', with: { CXXFLAGS: '-std=c++14 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C++17', with: { CXXFLAGS: '-std=c++17 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }, timeout-minutes: 5 } + + compile6: + name: 'omnibus compilations, #6' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'C++20', with: { CXXFLAGS: '-std=c++20 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C++23', with: { CXXFLAGS: '-std=c++23 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'C++26', with: { CXXFLAGS: '-std=c++26 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'gmp', with: { append_configure: '--with-gmp', test_all: 'ruby/test_bignum.rb', test_spec: "/github/workspace/src/spec/ruby/core/integer" }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'jemalloc', with: { append_configure: '--with-jemalloc' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'valgrind', with: { append_configure: '--with-valgrind' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'coroutine=ucontext', with: { append_configure: '--with-coroutine=ucontext' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'coroutine=pthread', with: { append_configure: '--with-coroutine=pthread' }, timeout-minutes: 5 } + + compile7: + name: 'omnibus compilations, #7' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'disable-jit', with: { append_configure: '--disable-yjit --disable-zjit' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'disable-yjit', with: { append_configure: '--disable-yjit' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'disable-zjit', with: { append_configure: '--disable-zjit' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'disable-dln', with: { append_configure: '--disable-dln' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'enable-mkmf-verbose', with: { append_configure: '--enable-mkmf-verbose' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'disable-rubygems', with: { append_configure: '--disable-rubygems' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'RUBY_DEVEL', with: { append_configure: '--enable-devel' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'OPT_THREADED_CODE=0', with: { cppflags: '-DOPT_THREADED_CODE=0' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'OPT_THREADED_CODE=1', with: { cppflags: '-DOPT_THREADED_CODE=1' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'OPT_THREADED_CODE=2', with: { cppflags: '-DOPT_THREADED_CODE=2' }, timeout-minutes: 5 } + + compile8: + name: 'omnibus compilations, #8' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'NDEBUG', with: { cppflags: '-DNDEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'RUBY_DEBUG', with: { cppflags: '-DRUBY_DEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'ARRAY_DEBUG', with: { cppflags: '-DARRAY_DEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'BIGNUM_DEBUG', with: { cppflags: '-DBIGNUM_DEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'CCAN_LIST_DEBUG', with: { cppflags: '-DCCAN_LIST_DEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'CPDEBUG=-1', with: { cppflags: '-DCPDEBUG=-1' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'ENC_DEBUG', with: { cppflags: '-DENC_DEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GC_DEBUG', with: { cppflags: '-DGC_DEBUG' }, timeout-minutes: 5 } + + compile9: + name: 'omnibus compilations, #9' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'HASH_DEBUG', with: { cppflags: '-DHASH_DEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'ID_TABLE_DEBUG', with: { cppflags: '-DID_TABLE_DEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'RGENGC_DEBUG=-1', with: { cppflags: '-DRGENGC_DEBUG=-1' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'SYMBOL_DEBUG', with: { cppflags: '-DSYMBOL_DEBUG' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'RGENGC_CHECK_MODE', with: { cppflags: '-DRGENGC_CHECK_MODE' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'VM_CHECK_MODE', with: { cppflags: '-DVM_CHECK_MODE' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'USE_EMBED_CI=0', with: { cppflags: '-DUSE_EMBED_CI=0' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'USE_FLONUM=0', with: { cppflags: '-DUSE_FLONUM=0', append_configure: '--disable-yjit --disable-zjit' }, timeout-minutes: 5 } + + compileX: + name: 'omnibus compilations, #10' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'USE_LAZY_LOAD', with: { cppflags: '-DUSE_LAZY_LOAD' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'USE_SYMBOL_GC=0', with: { cppflags: '-DUSE_SYMBOL_GC=0' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'USE_THREAD_CACHE=0', with: { cppflags: '-DUSE_THREAD_CACHE=0' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'USE_RUBY_DEBUG_LOG=1', with: { cppflags: '-DUSE_RUBY_DEBUG_LOG=1' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'USE_DEBUG_COUNTER', with: { cppflags: '-DUSE_DEBUG_COUNTER=1' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'SHARABLE_MIDDLE_SUBSTRING', with: { cppflags: '-DSHARABLE_MIDDLE_SUBSTRING=1' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'DEBUG_FIND_TIME_NUMGUESS', with: { cppflags: '-DDEBUG_FIND_TIME_NUMGUESS' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'DEBUG_INTEGER_PACK', with: { cppflags: '-DDEBUG_INTEGER_PACK' }, timeout-minutes: 5 } + + compileB: + name: 'omnibus compilations, #11' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'GC_DEBUG_STRESS_TO_CLASS', with: { cppflags: '-DGC_DEBUG_STRESS_TO_CLASS' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GC_ENABLE_LAZY_SWEEP=0', with: { cppflags: '-DGC_ENABLE_LAZY_SWEEP=0' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GC_PROFILE_DETAIL_MEMORY', with: { cppflags: '-DGC_PROFILE_DETAIL_MEMORY' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'GC_PROFILE_MORE_DETAIL', with: { cppflags: '-DGC_PROFILE_MORE_DETAIL' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'MALLOC_ALLOCATED_SIZE_CHECK', with: { cppflags: '-DMALLOC_ALLOCATED_SIZE_CHECK' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'RGENGC_ESTIMATE_OLDMALLOC', with: { cppflags: '-DRGENGC_ESTIMATE_OLDMALLOC' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'RGENGC_PROFILE', with: { cppflags: '-DRGENGC_PROFILE' }, timeout-minutes: 5 } + + compileC: + name: 'omnibus compilations, #12' + runs-on: ubuntu-latest + needs: compile-if + if: ${{ needs.compile-if.result == 'success' }} + timeout-minutes: 60 + services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } + - { uses: './.github/actions/compilers', name: 'VM_DEBUG_BP_CHECK', with: { cppflags: '-DVM_DEBUG_BP_CHECK' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'VM_DEBUG_VERIFY_METHOD_CACHE', with: { cppflags: '-DVM_DEBUG_VERIFY_METHOD_CACHE' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'YJIT_FORCE_ENABLE', with: { cppflags: '-DYJIT_FORCE_ENABLE' }, timeout-minutes: 5 } + - { uses: './.github/actions/compilers', name: 'UNIVERSAL_PARSER', with: { cppflags: '-DUNIVERSAL_PARSER' }, timeout-minutes: 5 } + + compilemax: + name: 'omnibus compilations, result' + runs-on: ubuntu-latest + if: ${{ always() }} + needs: + - 'compile1' + - 'compile2' + - 'compile3' + - 'compile4' + - 'compile5' + - 'compile6' + - 'compile7' + - 'compile8' + - 'compile9' + - 'compileX' + - 'compileB' + - 'compileC' + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } + - uses: ./.github/actions/slack + with: + label: 'omnibus' + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + - run: false + working-directory: + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml new file mode 100644 index 0000000000..ac73991fe8 --- /dev/null +++ b/.github/workflows/cygwin.yml @@ -0,0 +1,71 @@ +name: Cygwin +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + make: + runs-on: windows-2022 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - run: git config --global core.autocrlf input + + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: Setup Cygwin + uses: cygwin/cygwin-install-action@master + with: + packages: ruby gcc-core make autoconf libtool libssl-devel libyaml-devel libffi-devel zlib-devel rubygems + + - name: configure + run: | + ./autogen.sh + ./configure --disable-install-doc + shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o igncr -o pipefail {0} + + - name: Extract bundled gems + run: | + make ruby -j5 + make extract-gems + shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o igncr -o pipefail {0} + + - name: make all + timeout-minutes: 30 + run: make -j4 V=1 + shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o igncr -o pipefail {0} + + - uses: ./.github/actions/slack + with: + label: Cygwin + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} diff --git a/.github/workflows/default_gems_list.yml b/.github/workflows/default_gems_list.yml new file mode 100644 index 0000000000..1c7e2195c8 --- /dev/null +++ b/.github/workflows/default_gems_list.yml @@ -0,0 +1,99 @@ +name: Update default gems list +on: [push, pull_request, merge_group] + +env: + UPDATE_NEWS_ENABLED: true + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + update_default_gems_list: + name: Update default gems list + + permissions: + contents: write # for Git to git push + + runs-on: ubuntu-latest + + if: ${{ github.repository == 'ruby/ruby' }} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} + + - id: gems + run: true + if: ${{ github.ref == 'refs/heads/master' }} + + - uses: ./.github/actions/setup/directories + with: + makeup: true + # Skip overwriting MATZBOT_AUTO_UPDATE_TOKEN + checkout: '' # false (ref: https://github.com/actions/runner/issues/2238) + if: ${{ steps.gems.outcome == 'success' }} + + - name: Download previous gems list + run: | + data=default_gems.json + mkdir -p .downloaded-cache + ln -s .downloaded-cache/$data . + curl -O -R -z ./$data https://stdgems.org/$data + if: ${{ steps.gems.outcome == 'success' }} + + - name: Make default gems list + run: | + #!ruby + require 'rubygems' + $:.unshift "lib" + rgver = File.foreach("lib/rubygems.rb") do |line| + break $1 if /^\s*VERSION\s*=\s*"([^"]+)"/ =~ line + end + gems = Dir.glob("{ext,lib}/**/*.gemspec").map do |f| + spec = Gem::Specification.load(f) + "#{spec.name} #{spec.version}" + end.sort + File.open("gems/default_gems", "w") do |f| + f.puts "RubyGems #{rgver}" + f.puts gems + end + shell: ruby --disable=gems {0} + if: ${{ steps.gems.outcome == 'success' }} + + - name: Maintain updated gems list in NEWS + run: | + ruby tool/update-NEWS-gemlist.rb default + if: ${{ steps.gems.outcome == 'success' && env.UPDATE_NEWS_ENABLED == 'true' }} + + - name: Check diffs + id: diff + run: | + git diff --color --no-ext-diff --ignore-submodules --exit-code NEWS.md || + echo update=true >> $GITHUB_OUTPUT + if: ${{ steps.gems.outcome == 'success' }} + + - name: Commit + run: | + git pull --ff-only origin ${GITHUB_REF#refs/heads/} + git commit --message="Update default gems list at ${GITHUB_SHA:0:30} [ci skip]" NEWS.md + git push origin ${GITHUB_REF#refs/heads/} + env: + EMAIL: svn-admin@ruby-lang.org + GIT_AUTHOR_NAME: git + GIT_COMMITTER_NAME: git + if: >- + ${{ + github.repository == 'ruby/ruby' && + !startsWith(github.event_name, 'pull') && + steps.diff.outputs.update + }} + + - uses: ./.github/actions/slack + with: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} diff --git a/.github/workflows/dependabot_automerge.yml b/.github/workflows/dependabot_automerge.yml new file mode 100644 index 0000000000..a95c7005c4 --- /dev/null +++ b/.github/workflows/dependabot_automerge.yml @@ -0,0 +1,32 @@ +# from https://github.com/gofiber/swagger/blob/main/.github/workflows/dependabot_automerge.yml +name: Dependabot auto-merge +on: + pull_request: + +permissions: + contents: write + pull-requests: write + +jobs: + automerge: + runs-on: ubuntu-latest + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'ruby/ruby' + steps: + - name: Dependabot metadata + uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0 + id: metadata + + - name: Wait for status checks + uses: lewagon/wait-on-check-action@3603e826ee561ea102b58accb5ea55a1a7482343 # v1.4.1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.sha || github.sha }} + check-regexp: 'make \(check, .*\)' + wait-interval: 30 + + - name: Auto-merge for Dependabot PRs + if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' }} + run: gh pr merge --auto --rebase "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.MATZBOT_DEPENDABOT_MERGE_TOKEN }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000..16dbac1afa --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,12 @@ +name: "Pull Request Labeler" +on: +- pull_request_target + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v6 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000000..29adcab39a --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,202 @@ +name: macOS +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + make: + strategy: + matrix: + include: + - test_task: check + os: macos-14 + - test_task: check + os: macos-14 + configure_args: '--with-gcc=gcc-14' + - test_task: check + os: macos-14 + configure_args: '--with-jemalloc --with-opt-dir=$(brew --prefix jemalloc)' + - test_task: check + os: macos-14 + configure_args: '--with-gmp' + - test_task: test-all + test_opts: --repeat-count=2 + os: macos-14 + - test_task: test-bundler-parallel + os: macos-14 + - test_task: test-bundled-gems + os: macos-14 + - test_task: check + os: macos-15 + fail-fast: false + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + + runs-on: ${{ matrix.os }} + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - name: Install libraries + uses: ./.github/actions/setup/macos + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + clean: true + dummy-files: ${{ matrix.test_task == 'check' }} + # Set fetch-depth: 0 so that Launchable can receive commits information. + fetch-depth: 10 + + - name: make sure that kern.coredump=1 + run: | + sysctl -n kern.coredump + sudo sysctl -w kern.coredump=1 + sudo chmod -R +rwx /cores/ + + - name: Delete unused SDKs + # To free up disk space to not run out during the run + run: | + sudo rm -rf ~/.dotnet + sudo rm -rf /Library/Android + sudo rm -rf /Library/Developer/CoreSimulator + continue-on-error: true + + - name: Run configure + run: ../src/configure -C --disable-install-doc ${ruby_configure_args} ${{ matrix.configure_args }} + + - run: make prepare-gems + if: ${{ matrix.test_task == 'test-bundled-gems' }} + + - run: make + + - run: make hello + + - name: runirb + run: | + echo IRB::VERSION | make runirb RUNOPT="-- -f" + + - name: Set test options for skipped tests + run: | + set -x + TESTS="$(echo "${{ matrix.skipped_tests }}" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|')" + echo "TESTS=${TESTS}" >> $GITHUB_ENV + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} + + - name: Set up Launchable + id: launchable + uses: ./.github/actions/launchable/setup + with: + os: ${{ matrix.os }} + test-opts: ${{ matrix.test_opts }} + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + builddir: build + srcdir: src + continue-on-error: true + timeout-minutes: 3 + + - name: Set extra test options + run: | + echo "TESTS=$TESTS ${{ matrix.test_opts }}" >> $GITHUB_ENV + echo "RUBY_TEST_TIMEOUT_SCALE=10" >> $GITHUB_ENV # With --repeat-count=2, flaky test by timeout occurs frequently for some reason + if: matrix.test_opts + + - name: make ${{ matrix.test_task }} + run: | + test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}") + test -n "${LAUNCHABLE_STDERR}" && exec 2> >(tee "${LAUNCHABLE_STDERR}") + + ulimit -c unlimited + make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} + timeout-minutes: 90 + env: + RUBY_TESTOPTS: '-q --tty=no' + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + PRECHECK_BUNDLED_GEMS: 'no' + LAUNCHABLE_STDOUT: ${{ steps.launchable.outputs.stdout_report_path }} + LAUNCHABLE_STDERR: ${{ steps.launchable.outputs.stderr_report_path }} + + - name: make skipped tests + run: | + make -s test-all TESTS="${TESTS//-n!\//-n/}" + env: + GNUMAKEFLAGS: '' + RUBY_TESTOPTS: '-v --tty=no' + PRECHECK_BUNDLED_GEMS: 'no' + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} + continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} + + - name: CAPI extensions + uses: ./.github/actions/capiext + with: + builddir: build + env: + RUBY_TESTOPTS: '-v --tty=no' + if: ${{ contains(matrix.extra_checks, 'capi') }} + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.os }} / ${{ matrix.test_task }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + - name: Resolve job ID + id: job_id + uses: actions/github-script@main + env: + matrix: ${{ toJson(matrix) }} + with: + script: | + const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.runId + }); + const matrix = JSON.parse(process.env.matrix); + const job_name = `${context.job}${matrix ? ` (${Object.values(matrix).join(", ")})` : ""}`; + return workflow_run.jobs.find((job) => job.name === job_name).id; + + result: + if: ${{ always() }} + name: ${{ github.workflow }} result + runs-on: macos-latest + needs: [make] + steps: + - run: exit 1 + working-directory: + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml new file mode 100644 index 0000000000..5c639ad48b --- /dev/null +++ b/.github/workflows/mingw.yml @@ -0,0 +1,243 @@ +name: MinGW +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +# Notes: +# Actions console encoding causes issues, see test-all & test-spec steps +# +jobs: + make: + runs-on: windows-${{ matrix.os }} + + name: ${{ github.workflow }} (${{ matrix.msystem }}) + + env: + MSYSTEM: ${{ matrix.msystem }} + MSYS2_ARCH: >- + ${{ + contains(matrix.msystem, 'arm64') && 'aarch64' || + contains(matrix.msystem, '64') && 'x86_64' || 'i686' + }} + MINGW_PACKAGE_PREFIX: >- + mingw-w${{ + endsWith(matrix.msystem, '64') && '64' || '32' + }}-${{ + startsWith(matrix.msystem, 'clang') && 'clang' || + startsWith(matrix.msystem, 'ucrt') && 'ucrt' || + 'mingw' + }}-${{ + contains(matrix.msystem, 'arm64') && 'aarch64' || + endsWith(matrix.msystem, '64') && 'x86_64' || 'i686' + }} + CFLAGS: '-mtune=generic -O3 -pipe' + CXXFLAGS: '-mtune=generic -O3 -pipe' + CPPFLAGS: '-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048' + LDFLAGS: '-pipe' + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + + strategy: + matrix: + include: + # To mitigate flakiness of MinGW CI, we test only one runtime that newer MSYS2 uses. + # Ruby 3.2 is the first Windows Ruby to use OpenSSL 3.x + - msystem: 'UCRT64' + os: 2022 + test_task: 'check' + test-all-opts: '--name=!/TestObjSpace#test_reachable_objects_during_iteration/' + - msystem: 'CLANGARM64' + os: 11-arm + test_task: 'check' + fail-fast: false + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: msys2/setup-msys2@4f806de0a5a7294ffabaff804b38a9b435a73bda # v2.30.0 + id: msys2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: >- + git + make + ruby + autoconf + ${{ env.MINGW_PACKAGE_PREFIX }}-gcc + ${{ env.MINGW_PACKAGE_PREFIX }}-ragel + ${{ env.MINGW_PACKAGE_PREFIX }}-openssl + ${{ env.MINGW_PACKAGE_PREFIX }}-libyaml + ${{ env.MINGW_PACKAGE_PREFIX }}-libffi + + - name: Set up env + id: setup-env + working-directory: + run: | + $msys2 = ${env:MSYS2_LOCATION} + $msystem = ${env:MSYSTEM}.ToLower() + echo $msys2\usr\bin $msys2\$msystem\bin | + Tee-Object ${env:GITHUB_PATH} -Append -Encoding utf-8 + + # Use the fast device for the temporary directory. + # %TEMP% is inconsistent with %TMP% and test-all expects they are consistent. + # https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302 + $tmp = ${env:RUNNER_TEMP} + echo HOME=$home TMP=$tmp TEMP=$tmp TMPDIR=$tmp | + Tee-Object ${env:GITHUB_ENV} -Append -Encoding utf-8 + shell: pwsh # cmd.exe does not strip spaces before `|`. + env: + MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }} + MSYSTEM: ${{ matrix.msystem }} + + - name: Remove Strawberry Perl pkg-config + working-directory: + # `pkg-config.bat` included in Strawberry Perl is written in + # Perl and doesn't work when another msys2 `perl` precede its + # own `perl`. + # + # ``` + # Can't find C:\Strawberry\perl\bin\pkg-config.bat on PATH, '.' not in PATH. + # ``` + run: | + Get-Command pkg-config.bat | % { ren $_.path ($_.path + "~") } + shell: pwsh + + - name: Misc system & package info + working-directory: + run: | + group() { echo ::group::$'\e[94;1m'"$*"$'\e[m'; } + endgroup() { echo ::endgroup::; } + + group Path + cygpath -wa / . $(type -p cygpath bash sh) + endgroup + + I() { + group $1 + run Where type -pa $1 && { [ $# -eq 1 ] || run Version "$@"; } || + failed+=($1) + endgroup + } + run() { local w m=$1; shift; w="$("$@")" && show "$m" && indent "$w"; } + indent() { [ -z "$1" ] || echo "$1" | /bin/sed '/^$/!s/^/ /'; } + show() { echo $'\e[96m'"$*"$'\e[m'; } + + failed=() + + I gcc.exe --version + I ragel.exe --version + I make.exe --version + I openssl.exe version + I libcrypto-3-x64.dll + I libssl-3-x64.dll + + group Packages + pacman -Qs $MINGW_PACKAGE_PREFIX-* | /bin/sed -n "s,local/$MINGW_PACKAGE_PREFIX-,,p" + endgroup + + [ ${#failed[@]} -eq 0 ] + shell: sh + + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + # Set fetch-depth: 10 so that Launchable can receive commits information. + fetch-depth: 10 + + - name: configure + run: > + ../src/configure --disable-install-doc --prefix=/. + --build=$CHOST --host=$CHOST --target=$CHOST + shell: sh + env: + CHOST: ${{ env.MSYS2_ARCH }}-w64-mingw32 + + - name: make all + timeout-minutes: 30 + run: make -j4 + + - name: make install + run: make DESTDIR=../install install-nodoc + + - name: Set up Launchable + uses: ./.github/actions/launchable/setup + with: + os: windows-2022 + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + builddir: build + srcdir: src + test-tasks: '["test", "test-all", "test-spec"]' + continue-on-error: true + timeout-minutes: 3 + + - name: test + timeout-minutes: 30 + run: make test test-tool + env: + GNUMAKEFLAGS: '' + RUBY_TESTOPTS: '-v --tty=no' + if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test' }} + + - name: test-all + timeout-minutes: 45 + run: | + make ${{ StartsWith(matrix.test_task, 'test/') && matrix.test_task || 'test-all' }} + env: + RUBY_TESTOPTS: >- + --retry --job-status=normal --show-skip --timeout-scale=1.5 -j4 + ${{ matrix.test-all-opts }} + ${{ env.TESTS }} + BUNDLER_VERSION: + if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test-all' || StartsWith(matrix.test_task, 'test/') }} + + - name: test-spec + timeout-minutes: 10 + run: | + make ${{ StartsWith(matrix.test_task, 'spec/') && matrix.test_task || 'test-spec' }} + if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test-spec' || StartsWith(matrix.test_task, 'spec/') }} + + - uses: ./src/.github/actions/slack + with: + label: ${{ matrix.msystem }} / ${{ matrix.test_task }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + +defaults: + run: + working-directory: build + shell: cmd diff --git a/.github/workflows/modgc.yml b/.github/workflows/modgc.yml new file mode 100644 index 0000000000..1d14934df8 --- /dev/null +++ b/.github/workflows/modgc.yml @@ -0,0 +1,176 @@ +name: ModGC +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + check: + strategy: + matrix: + gc: + - name: default + - name: mmtk + mmtk_build: release + os: [macos-latest, ubuntu-latest] + include: + - test_task: check + fail-fast: false + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + RUBY_DEBUG: ci + + runs-on: ${{ matrix.os }} + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - name: Install libraries (macOS) + uses: ./.github/actions/setup/macos + if: ${{ contains(matrix.os, 'macos') }} + + - name: Install libraries (Ubuntu) + uses: ./.github/actions/setup/ubuntu + if: ${{ contains(matrix.os, 'ubuntu') }} + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.1' + bundler: none + if: ${{ contains(matrix.os, 'ubuntu') }} + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + clean: true + dummy-files: false + # Set fetch-depth: 10 so that Launchable can receive commits information. + fetch-depth: 10 + + - name: make sure that kern.coredump=1 + run: | + sysctl -n kern.coredump + sudo sysctl -w kern.coredump=1 + sudo chmod -R +rwx /cores/ + if: ${{ contains(matrix.os, 'macos') }} + + - name: Delete unused SDKs + # To free up disk space to not run out during the run + run: | + sudo rm -rf ~/.dotnet + sudo rm -rf /Library/Android + sudo rm -rf /Library/Developer/CoreSimulator + continue-on-error: true + if: ${{ contains(matrix.os, 'macos') }} + + - name: Setup Ruby GC Directory + run: | + echo "MODULAR_GC_DIR=$HOME/ruby_gc" >> $GITHUB_ENV + + - name: Run configure + env: + arch: ${{ matrix.arch }} + run: >- + $SETARCH ../src/configure -C --disable-install-doc --with-modular-gc=${{ env.MODULAR_GC_DIR }} + ${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE} + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Set MMTk environment variables + run: | + echo 'EXCLUDES=../src/test/.excludes-mmtk' >> $GITHUB_ENV + echo 'MSPECOPT=-B../src/spec/mmtk.mspec' >> $GITHUB_ENV + if: ${{ matrix.gc.name == 'mmtk' }} + + - run: $SETARCH make + + - name: Build Modular GC + run: | + echo "RUBY_GC_LIBRARY=${{ matrix.gc.name }}" >> $GITHUB_ENV + make install-modular-gc MODULAR_GC=${{ matrix.gc.name }} MMTK_BUILD=${{ matrix.gc.mmtk_build }} + make distclean-modular-gc MODULAR_GC=${{ matrix.gc.name }} + + - run: $SETARCH make hello + + - name: Set test options for skipped tests + run: | + set -x + TESTS="$(echo "${{ matrix.skipped_tests }}" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|')" + echo "TESTS=${TESTS}" >> $GITHUB_ENV + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} + + - name: Set up Launchable + id: launchable + uses: ./.github/actions/launchable/setup + with: + os: ${{ matrix.os || 'ubuntu-22.04' }} + test-opts: ${{ matrix.configure }} + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + builddir: build + srcdir: src + continue-on-error: true + timeout-minutes: 3 + + - name: make ${{ matrix.test_task }} + run: | + test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}") + test -n "${LAUNCHABLE_STDERR}" && exec 2> >(tee "${LAUNCHABLE_STDERR}") + + $SETARCH make -s ${{ matrix.test_task }} \ + ${TESTS:+TESTS="$TESTS"} \ + ${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }} + timeout-minutes: ${{ matrix.gc.timeout || 40 }} + env: + RUBY_TESTOPTS: '-q --tty=no' + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + PRECHECK_BUNDLED_GEMS: 'no' + LAUNCHABLE_STDOUT: ${{ steps.launchable.outputs.stdout_report_path }} + LAUNCHABLE_STDERR: ${{ steps.launchable.outputs.stderr_report_path }} + + - name: make skipped tests + run: | + $SETARCH make -s test-all TESTS="${TESTS//-n!\//-n/}" + env: + GNUMAKEFLAGS: '' + RUBY_TESTOPTS: '-v --tty=no' + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} + continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/parse_y.yml b/.github/workflows/parse_y.yml new file mode 100644 index 0000000000..87facc8a55 --- /dev/null +++ b/.github/workflows/parse_y.yml @@ -0,0 +1,100 @@ +name: parse.y +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + make: + strategy: + matrix: + include: + - test_task: check + - test_task: test-bundler-parallel + - test_task: test-bundled-gems + fail-fast: false + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + RUBY_DEBUG: ci + SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }} + + runs-on: ubuntu-22.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - uses: ./.github/actions/setup/ubuntu + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.1' + bundler: none + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + clean: true + dummy-files: ${{ matrix.test_task == 'check' }} + + - name: Run configure + run: ../src/configure -C --disable-install-doc cppflags=-DRUBY_DEBUG --with-parser=parse.y + + - run: make + + - run: make TESTRUN_SCRIPT='-renvutil -v -e "exit EnvUtil.current_parser == %[parse.y]"' run + env: + RUNOPT0: -I$(tooldir)/lib + + - name: make ${{ matrix.test_task }} + run: make -s ${{ matrix.test_task }} RUN_OPTS="$RUN_OPTS" SPECOPTS="$SPECOPTS" + env: + RUBY_TESTOPTS: ${{ matrix.testopts }} + EXCLUDES: '../src/test/.excludes-parsey' + RUN_OPTS: ${{ matrix.run_opts || '--parser=parse.y' }} + SPECOPTS: ${{ matrix.specopts || '-T --parser=parse.y' }} + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.run_opts }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/post_push.yml b/.github/workflows/post_push.yml new file mode 100644 index 0000000000..318444c0a2 --- /dev/null +++ b/.github/workflows/post_push.yml @@ -0,0 +1,85 @@ +name: Post-push +on: + push: + branches: + - master + - 'ruby_*_*' +jobs: + hooks: + name: Post-push hooks + runs-on: ubuntu-latest + if: ${{ github.repository == 'ruby/ruby' }} + steps: + - name: Sync git.ruby-lang.org + run: | + mkdir -p ~/.ssh + (umask 066; printenv RUBY_GIT_SYNC_PRIVATE_KEY > ~/.ssh/id_ed25519) + ssh-keyscan -t ed25519 git.ruby-lang.org >> ~/.ssh/known_hosts + ssh -i ~/.ssh/id_ed25519 git-sync@git.ruby-lang.org "sudo -u git /home/git/git.ruby-lang.org/bin/update-ruby.sh $GITHUB_REF" + env: + GITHUB_REF: ${{ github.ref }} + RUBY_GIT_SYNC_PRIVATE_KEY: ${{ secrets.RUBY_GIT_SYNC_PRIVATE_KEY }} + if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ruby_') }} + + - name: Fetch changesets on bugs.ruby-lang.org + run: | + curl "https://bugs.ruby-lang.org/sys/fetch_changesets?key=${REDMINE_SYS_API_KEY}" -s --fail-with-body -w '* status: %{http_code}\n' + env: + REDMINE_SYS_API_KEY: ${{ secrets.REDMINE_SYS_API_KEY }} + if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ruby_') }} + + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + fetch-depth: 500 # for notify-slack-commits + token: ${{ secrets.MATZBOT_AUTO_UPDATE_TOKEN }} + + - name: Notify commit to Slack + run: ruby tool/notify-slack-commits.rb "$GITHUB_OLD_SHA" "$GITHUB_NEW_SHA" refs/heads/master + env: + GITHUB_OLD_SHA: ${{ github.event.before }} + GITHUB_NEW_SHA: ${{ github.event.after }} + SLACK_WEBHOOK_URL_ALERTS: ${{ secrets.SLACK_WEBHOOK_URL_ALERTS }} + SLACK_WEBHOOK_URL_COMMITS: ${{ secrets.SLACK_WEBHOOK_URL_COMMITS }} + SLACK_WEBHOOK_URL_RUBY_JP: ${{ secrets.SLACK_WEBHOOK_URL_RUBY_JP }} + if: ${{ github.ref == 'refs/heads/master' }} + + - name: Notify commit to ruby-cvs + run: | + SENDMAIL="ssh -i ${HOME}/.ssh/id_ed25519 git-sync@git.ruby-lang.org /usr/sbin/sendmail" \ + ruby tool/commit-email.rb . ruby-cvs@g.ruby-lang.org \ + "$GITHUB_OLD_SHA" "$GITHUB_NEW_SHA" "$GITHUB_REF" \ + --viewer-uri "https://github.com/ruby/ruby/commit/" \ + --error-to cvs-admin@ruby-lang.org + env: + GITHUB_OLD_SHA: ${{ github.event.before }} + GITHUB_NEW_SHA: ${{ github.event.after }} + GITHUB_REF: ${{ github.ref }} + if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ruby_') }} + + - name: Auto-correct code styles + run: | + set -x + ruby tool/auto-style.rb "$GITHUB_OLD_SHA" "$GITHUB_NEW_SHA" refs/heads/master + env: + GITHUB_OLD_SHA: ${{ github.event.before }} + GITHUB_NEW_SHA: ${{ github.event.after }} + GIT_AUTHOR_NAME: git + GIT_COMMITTER_NAME: git + EMAIL: svn-admin@ruby-lang.org + if: ${{ github.ref == 'refs/heads/master' }} + + - name: Push PR notes to GitHub + run: ruby tool/notes-github-pr.rb "$(pwd)/.git" "$GITHUB_OLD_SHA" "$GITHUB_NEW_SHA" refs/heads/master + env: + GITHUB_OLD_SHA: ${{ github.event.before }} + GITHUB_NEW_SHA: ${{ github.event.after }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_AUTHOR_NAME: git + GIT_COMMITTER_NAME: git + EMAIL: svn-admin@ruby-lang.org + if: ${{ github.ref == 'refs/heads/master' }} + + - uses: ./.github/actions/slack + with: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} diff --git a/.github/workflows/pr-playground.yml b/.github/workflows/pr-playground.yml new file mode 100644 index 0000000000..f3c0556429 --- /dev/null +++ b/.github/workflows/pr-playground.yml @@ -0,0 +1,127 @@ +name: Post Playground link to PR +on: + pull_request_target: + types: [labeled] + workflow_run: + workflows: ["WebAssembly"] + types: [completed] + +jobs: + post-summary: + name: Post Playground link + runs-on: ubuntu-latest + permissions: + pull-requests: write + # Post a comment only if the PR status check is passed and the PR is labeled with `Playground`. + # Triggered twice: when the PR is labeled and when PR build is passed. + if: >- + ${{ false + || (true + && github.event_name == 'pull_request_target' + && contains(github.event.pull_request.labels.*.name, 'Playground')) + || (true + && github.event_name == 'workflow_run' + && github.event.workflow_run.conclusion == 'success' + && github.event.workflow_run.event == 'pull_request') + }} + steps: + - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const fs = require('fs/promises'); + + const buildWorkflowPath = '.github/workflows/wasm.yml'; + const findSuccessfuBuildRun = async (pr) => { + const opts = github.rest.actions.listWorkflowRunsForRepo.endpoint.merge({ + owner: context.repo.owner, + repo: context.repo.repo, + status: 'success', + branch: pr.head.ref, + }); + const runs = await github.paginate(opts); + const buildRun = runs.find(run => run.path == buildWorkflowPath); + return buildRun; + } + + const postComment = async (body, pr) => { + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + }); + + const commentOpts = { owner: context.repo.owner, repo: context.repo.repo, body: comment }; + + const existingComment = comments.find(comment => comment.body.startsWith(magicComment)); + if (existingComment) { + core.info(`Updating existing comment: ${existingComment.html_url}`); + await github.rest.issues.updateComment({ + ...commentOpts, comment_id: existingComment.id + }); + } else { + await github.rest.issues.createComment({ + ...commentOpts, issue_number: pr.number + }); + } + } + + const derivePRNumber = async () => { + if (context.payload.pull_request) { + return context.payload.pull_request.number; + } + // Workaround for https://github.com/orgs/community/discussions/25220 + + const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + const artifact = artifacts.find(artifact => artifact.name == 'github-pr-info'); + if (!artifact) { + throw new Error('Cannot find github-pr-info.txt artifact'); + } + + const { data } = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: 'zip', + }); + + await fs.writeFile('pr-info.zip', Buffer.from(data)); + await exec.exec('unzip', ['pr-info.zip']); + return await fs.readFile('github-pr-info.txt', 'utf8'); + } + + const prNumber = await derivePRNumber(); + + const { data: pr } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: prNumber, + }); + + core.info(`Checking if the PR ${prNumber} is labeled with Playground...`); + if (!pr.labels.some(label => label.name == 'Playground')) { + core.info(`The PR is not labeled with Playground.`); + return; + } + + core.info(`Checking if the build is successful for ${pr.head.ref} in ${pr.head.repo.owner.login}/${pr.head.repo.name}...`); + const buildRun = await findSuccessfuBuildRun(pr); + if (!buildRun) { + core.info(`No successful build run found for ${buildWorkflowPath} on ${pr.head.ref} yet.`); + return; + } + core.info(`Found a successful build run: ${buildRun.html_url}`); + + const runLink = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; + const magicComment = `<!-- AUTO-GENERATED-COMMENT-PR-PLAYGROUND -->`; + const comment = `${magicComment} + **Try on Playground**: https://ruby.github.io/play-ruby?run=${buildRun.id} + This is an automated comment by [\`pr-playground.yml\`](${runLink}) workflow. + `; + core.info(`Comment: ${comment}`); + await postComment(comment, pr); + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..3caeee9a3b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,107 @@ +name: Publish Ruby packages + +on: + repository_dispatch: + types: + - release + workflow_dispatch: + inputs: + version: + description: 'Version of the Ruby package to release' + required: true + default: '3.3.4' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.1 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3.4 + + - name: Store Ruby version + run: | + echo "RUBY_VERSION=${{ github.event.client_payload.version || github.event.inputs.version }}" >> $GITHUB_ENV + + - name: Store ABI version + run: echo "ABI_VERSION=$(echo ${{ env.RUBY_VERSION }} | cut -d '.' -f 1-2)" >> $GITHUB_ENV + + - name: Copy draft package `/tmp` to `/pub` directory + run: tool/release.sh ${{ env.RUBY_VERSION }} + env: + AWS_ACCESS_KEY_ID: ${{ secrets.FTP_R_L_O_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.FTP_R_L_O_AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-west-2 + + - name: Purge URLs of release package + run: | + curl -X POST \ + -H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \ + https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.gz + curl -X POST \ + -H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \ + https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.xz + curl -X POST \ + -H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \ + https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.zip + + - name: Create a release on GitHub + run: | + RELEASE_TAG=$(ruby tool/ruby-version.rb tag "${{ env.RUBY_VERSION }}") + echo $RELEASE_TAG + PREVIOUS_RELEASE_TAG=$(ruby tool/ruby-version.rb previous-tag "${{ env.RUBY_VERSION }}") + echo $PREVIOUS_RELEASE_TAG + tool/gen-github-release.rb $PREVIOUS_RELEASE_TAG $RELEASE_TAG --no-dry-run + env: + GITHUB_TOKEN: ${{ secrets.MATZBOT_AUTO_UPDATE_TOKEN }} + + - name: Update versions index + run: | + curl -L -X POST \ + -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/ruby/actions/dispatches \ + -d '{"event_type": "update_index"}' + + - name: Build and push Docker images + run: | + curl -L -X POST \ + -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/ruby/docker-images/actions/workflows/build.yml/dispatches \ + -d '{"ref": "master", "inputs": {"ruby_version": "${{ env.RUBY_VERSION }}"}}' + + - name: Build snapcraft packages + run: | + curl -L -X POST \ + -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/ruby/snap.ruby/dispatches \ + -d '{"event_type": "build", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}"}}' + + - name: Store the latest LTS version of OpenSSL + run: | + echo "OPENSSL_VERSION=`curl -s https://api.github.com/repos/openssl/openssl/releases | jq -r '.[].tag_name | select(startswith("openssl-3.0"))' | sort -Vr | head -n1 | cut -d'-' -f2`" >> $GITHUB_ENV + + - name: Update ruby-build definition + run: | + curl -L -X POST \ + -H "Authorization: Bearer ${{ secrets.RUBY_BUILD_WORKFLOW_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/rbenv/ruby-build/dispatches \ + -d '{"event_type": "update-ruby", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}", "openssl_version": "${{ env.OPENSSL_VERSION }}"}}' + + - name: Update all-ruby definition + run: | + curl -L -X POST \ + -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/ruby/all-ruby/dispatches \ + -d '{"event_type": "update"}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..5d4474d978 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,18 @@ +name: Start release workflow +on: + push: + tags: + - '*' + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Build release package + run: | + curl -L -X POST \ + -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/ruby/actions/dispatches \ + -d '{"event_type": "${{ github.ref }}"}' diff --git a/.github/workflows/rust-warnings.yml b/.github/workflows/rust-warnings.yml new file mode 100644 index 0000000000..a2e3208e52 --- /dev/null +++ b/.github/workflows/rust-warnings.yml @@ -0,0 +1,60 @@ +# Surface Rust warnings on PRs that touch any Rust code. +# Not a required check so we never block people over new warnings +# that might come from a new Rust version being released. +name: Rust warnings +on: + pull_request: + types: + - opened + - synchronize + - reopened + paths: + - '**.rs' + - '!**.inc.rs' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + rust-warnings: + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + + runs-on: ubuntu-24.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: Install Rust + run: rustup default beta + + - name: Rust warnings + shell: bash + run: | + set -eu + cargo check --quiet --all-features --message-format=json \ + | jq -r 'select(.message.level | IN("warning", "error")) | .message.rendered' \ + | tee messages.txt + (exit "${PIPESTATUS[0]}") && ! grep --quiet '[^[:space:]]' messages.txt + + - name: "📜 `rustdoc` warnings" + shell: bash + run: | + set -eu + cargo doc --document-private-items --all --no-deps --message-format=json \ + | jq -r 'select(.message.level | IN("warning", "error")) | .message.rendered' \ + | tee messages.txt + (exit "${PIPESTATUS[0]}") && ! grep --quiet '[^[:space:]]' messages.txt diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml new file mode 100644 index 0000000000..c607098997 --- /dev/null +++ b/.github/workflows/scorecards.yml @@ -0,0 +1,78 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '39 3 * * 5' + # push: + # branches: [ "master" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + # `publish_results: true` only works when run from the default branch. conditional can be removed if disabled. + if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request' + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecard on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore + # file_mode: git + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard (optional). + # Commenting out will disable upload of results to your repo's Code Scanning dashboard + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@v4 + with: + sarif_file: results.sarif diff --git a/.github/workflows/spec_guards.yml b/.github/workflows/spec_guards.yml new file mode 100644 index 0000000000..cf4661555c --- /dev/null +++ b/.github/workflows/spec_guards.yml @@ -0,0 +1,67 @@ +name: Rubyspec Version Guards Check + +on: + push: + paths: + - '.github/workflows/spec_guards.yml' + - 'spec/**' + - '!spec/*.md' + pull_request: + paths: + - '.github/workflows/spec_guards.yml' + - 'spec/**' + - '!spec/*.md' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + rubyspec: + name: Rubyspec + + runs-on: ubuntu-22.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + strategy: + matrix: + # Specs from ruby/spec should still run on all supported Ruby versions. + # This also ensures the needed ruby_version_is guards are there, see spec/README.md. + ruby: + - ruby-3.2 + - ruby-3.3 + - ruby-3.4 + - ruby-4.0 + fail-fast: false + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: ${{ matrix.ruby }} + bundler: none + + - run: gem install webrick + + - run: ruby ../mspec/bin/mspec + working-directory: spec/ruby + env: + CHECK_LEAKS: true + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.ruby }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} diff --git a/.github/workflows/sync_default_gems.yml b/.github/workflows/sync_default_gems.yml new file mode 100644 index 0000000000..9ff97d5a4e --- /dev/null +++ b/.github/workflows/sync_default_gems.yml @@ -0,0 +1,77 @@ +name: Sync default gems + +env: + DEFAULT_GEM_SYNC_ENABLED: true + +on: + workflow_dispatch: + inputs: + gem: + required: true + description: 'Name of the gem to be synchronized' + type: string + before: + required: true + description: 'Gem commit SHA before sync' + type: string + after: + required: true + description: 'Gem commit SHA after sync' + type: string + +jobs: + sync_default_gems: + name: Sync default gem ${{ github.event.inputs.gem }} + + permissions: + contents: write # for Git to git push + + runs-on: ubuntu-latest + + if: ${{ github.repository == 'ruby/ruby' }} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + name: Check out ruby/ruby + with: + token: ${{ github.repository == 'ruby/ruby' && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.4' + bundler: none + + - name: Run tool/sync_default_gems.rb + id: sync + run: | + ruby_before=$(git rev-parse HEAD) + set -x + ruby tool/sync_default_gems.rb "${gem_name}" "${gem_before}..${gem_after}" + if [[ "$(git rev-parse HEAD)" != "$ruby_before" ]]; then + echo update=true >> $GITHUB_OUTPUT + fi + env: + gem_name: ${{ github.event.inputs.gem }} + gem_before: ${{ github.event.inputs.before }} + gem_after: ${{ github.event.inputs.after }} + EMAIL: svn-admin@ruby-lang.org + GIT_AUTHOR_NAME: git + GIT_COMMITTER_NAME: git + + - name: Push + run: | + git pull --rebase origin ${GITHUB_REF#refs/heads/} + git push origin ${GITHUB_REF#refs/heads/} + if: ${{ steps.sync.outputs.update && env.DEFAULT_GEM_SYNC_ENABLED == 'true' }} + env: + EMAIL: svn-admin@ruby-lang.org + GIT_AUTHOR_NAME: git + GIT_COMMITTER_NAME: git + + - uses: ./.github/actions/slack + with: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + label: "${{ github.event.inputs.gem }} (<https://github.com/${{ github.event.inputs.gem == 'rubygems' && 'rubygems' || 'ruby' }}/${{ github.event.inputs.gem }}/compare/${{ github.event.inputs.before }}...${{ github.event.inputs.after }}|diff>)" + event_name: workflow_dispatch + extra_channel_id: C05FPKAU743 # alerts-sync + if: ${{ failure() }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 0000000000..88c19b6fe6 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,269 @@ +name: Ubuntu +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + make: + strategy: + matrix: + # We enumerate every job in matrix.include to save build time + include: + - test_task: check + configure: 'cppflags=-DVM_CHECK_MODE' + - test_task: check + arch: i686 + - test_task: check + configure: '--disable-yjit' + - test_task: check + configure: '--enable-shared --enable-load-relative' + - test_task: test-bundler-parallel + timeout: 50 + - test_task: test-bundled-gems + - test_task: check + os: ubuntu-24.04 + extra_checks: [capi] + # ubuntu-24.04-arm jobs don't start on ruby/ruby as of 2025-10-29 + #- test_task: check + # os: ubuntu-24.04-arm + fail-fast: false + + env: &make-env + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + RUBY_DEBUG: ci + + runs-on: ${{ matrix.os || 'ubuntu-22.04' }} + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: &make-steps + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - uses: ./.github/actions/setup/ubuntu + with: + arch: ${{ matrix.arch }} + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.1' + bundler: none + if: >- + ${{ !endsWith(matrix.os, 'arm') + && !endsWith(matrix.os, 'ppc64le') && !endsWith(matrix.os, 's390x') }} + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + clean: true + dummy-files: ${{ matrix.test_task == 'check' }} + # Set fetch-depth: 10 so that Launchable can receive commits information. + fetch-depth: 10 + + - name: Run configure + env: + arch: ${{ matrix.arch }} + configure: ${{ matrix.configure }} + run: >- + $SETARCH ../src/configure -C --disable-install-doc ${configure:-cppflags=-DRUBY_DEBUG} + ${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE} + + - run: $SETARCH make prepare-gems + if: ${{ matrix.test_task == 'test-bundled-gems' }} + + - run: $SETARCH make + + - run: $SETARCH make hello + + - name: runirb + run: | + echo IRB::VERSION | $SETARCH make runirb RUNOPT="-- -f" + + - name: Set test options for skipped tests + run: | + set -x + TESTS="$(echo "${{ matrix.skipped_tests }}" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|')" + echo "TESTS=${TESTS}" >> $GITHUB_ENV + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} + + - name: Set up Launchable + id: launchable + uses: ./.github/actions/launchable/setup + with: + os: ${{ matrix.os || 'ubuntu-22.04' }} + test-opts: ${{ matrix.configure }} + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + builddir: build + srcdir: src + continue-on-error: true + timeout-minutes: 3 + + # Avoid possible test failures with the zlib applying the following patch + # on s390x CPU architecture. + # https://github.com/madler/zlib/pull/410 + - name: Disable DFLTCC + run: echo "DFLTCC=0" >> $GITHUB_ENV + if: ${{ endsWith(matrix.os, 's390x') }} + + - name: make ${{ matrix.test_task }} + run: | + test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}") + test -n "${LAUNCHABLE_STDERR}" && exec 2> >(tee "${LAUNCHABLE_STDERR}") + + $SETARCH make -s ${{ matrix.test_task }} \ + ${TESTS:+TESTS="$TESTS"} \ + ${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }} + timeout-minutes: ${{ matrix.timeout || 40 }} + env: + RUBY_TESTOPTS: '-q --tty=no' + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + PRECHECK_BUNDLED_GEMS: 'no' + LAUNCHABLE_STDOUT: ${{ steps.launchable.outputs.stdout_report_path }} + LAUNCHABLE_STDERR: ${{ steps.launchable.outputs.stderr_report_path }} + + - name: make skipped tests + run: | + $SETARCH make -s test-all TESTS="${TESTS//-n!\//-n/}" + env: + GNUMAKEFLAGS: '' + RUBY_TESTOPTS: '-v --tty=no' + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} + continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} + + - name: test-pc + run: | + DESTDIR=${RUNNER_TEMP-${TMPDIR-/tmp}}/installed + $SETARCH make test-pc "DESTDIR=$DESTDIR" + + - name: CAPI extensions + uses: ./.github/actions/capiext + with: + builddir: build + make: '$SETARCH make' + env: + RUBY_TESTOPTS: '-v --tty=no' + if: ${{ contains(matrix.extra_checks, 'capi') }} + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}${{ matrix.os }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + make-ibm: + strategy: + matrix: + include: + - test_task: check + os: ubuntu-24.04-ppc64le + - test_task: check + os: ubuntu-24.04-s390x + fail-fast: false + + env: *make-env + + runs-on: ${{ matrix.os }} + + if: >- + ${{github.repository == 'ruby/ruby' + && !(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: *make-steps + + # Separated from `make` job to avoid making it a required status check + ruby-bench: + strategy: + matrix: + include: + # Using the same setup as ZJIT jobs + - bench_opts: '--warmup=1 --bench=1 --excludes=lobsters' + + runs-on: ubuntu-24.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - uses: ./.github/actions/setup/ubuntu + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + + - name: Run configure + run: ../src/configure -C --disable-install-doc --prefix="$(pwd)/install" + + - run: make install + + - name: Checkout ruby-bench + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + repository: ruby/ruby-bench + path: ruby-bench + + # If you want to skip failing benchmark, consider using `--excludes`. + # e.g. `bench_opts: '--warmup=1 --bench=1 --excludes=railsbench,lobsters'` + - name: Run ruby-bench + run: ruby run_benchmarks.rb -e "ruby::../build/install/bin/ruby" ${{ matrix.bench_opts }} + working-directory: ruby-bench + + - uses: ./.github/actions/slack + with: + label: ruby-bench ${{ matrix.bench_opts }} ${{ matrix.ruby_opts }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + result: + if: ${{ always() }} + name: ${{ github.workflow }} result + runs-on: ubuntu-latest + needs: [make] + steps: + - run: exit 1 + working-directory: + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml new file mode 100644 index 0000000000..0d2a6f0545 --- /dev/null +++ b/.github/workflows/wasm.yml @@ -0,0 +1,179 @@ +name: WebAssembly +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + make: + strategy: + matrix: + entry: +# # wasmtime can't compile non-optimized Asyncified binary due to locals explosion +# - { name: O0-debuginfo, optflags: '-O0', debugflags: '-g', wasmoptflags: '-O1' } +# - { name: O1, optflags: '-O1', debugflags: '' , wasmoptflags: '-O1' } + - { name: O2, optflags: '-O2', debugflags: '', wasmoptflags: '-O2' } +# - { name: O3, optflags: '-O3', debugflags: '' , wasmoptflags: '-O3' } +# # -O4 is equivalent to -O3 in clang, but it's different in wasm-opt +# - { name: O4, optflags: '-O3', debugflags: '' , wasmoptflags: '-O4' } +# - { name: Oz, optflags: '-Oz', debugflags: '' , wasmoptflags: '-Oz' } + fail-fast: false + + env: + RUBY_TESTOPTS: '-q --tty=no' + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + WASI_SDK_VERSION_MAJOR: 25 + WASI_SDK_VERSION_MINOR: 0 + BINARYEN_VERSION: 113 + WASMTIME_VERSION: v15.0.0 + + runs-on: ubuntu-22.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + + - name: Install libraries + run: | + set -ex + sudo apt-get update -q || : + sudo apt-get install --no-install-recommends -q -y ruby make autoconf git wget + + wasi_sdk_deb="wasi-sdk-${WASI_SDK_VERSION_MAJOR}.${WASI_SDK_VERSION_MINOR}-x86_64-linux.deb" + wget "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION_MAJOR}/${wasi_sdk_deb}" + sudo dpkg -i "$wasi_sdk_deb" + rm -f "$wasi_sdk_deb" + + mkdir build-sdk + pushd build-sdk + + wasmtime_url="https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-x86_64-linux.tar.xz" + wget -O - "$wasmtime_url" | tar xJf - + sudo ln -fs "$PWD/wasmtime-${WASMTIME_VERSION}-x86_64-linux/wasmtime" /usr/local/bin/wasmtime + + binaryen_tarball="binaryen-version_${BINARYEN_VERSION}-x86_64-linux.tar.gz" + binaryen_url="https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/${binaryen_tarball}" + wget -O - "$binaryen_url" | tar xfz - + sudo ln -fs "$PWD/binaryen-version_${BINARYEN_VERSION}/bin/wasm-opt" /usr/local/bin/wasm-opt + working-directory: src + + - name: Set ENV + run: | + echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.1' + bundler: none + + - name: Build baseruby + run: | + set -ex + mkdir ../baseruby + pushd ../baseruby + ../src/configure --prefix=$PWD/install + make + make install + + - name: Download config.guess with wasi version + run: | + rm tool/config.guess tool/config.sub + ruby tool/downloader.rb -d tool -e gnu config.guess config.sub + working-directory: src + + - name: Run configure + run: | + ../src/configure \ + --host wasm32-unknown-wasi \ + --with-baseruby=$PWD/../baseruby/install/bin/ruby \ + --with-static-linked-ext \ + --with-ext=cgi/escape,continuation,coverage,date,digest/bubblebabble,digest,digest/md5,digest/rmd160,digest/sha1,digest/sha2,etc,fcntl,json,json/generator,json/parser,objspace,pathname,rbconfig/sizeof,ripper,stringio,strscan,monitor \ + LDFLAGS=" \ + -Xlinker --stack-first \ + -Xlinker -z -Xlinker stack-size=16777216 \ + " \ + optflags="${{ matrix.entry.optflags }}" \ + debugflags="${{ matrix.entry.debugflags }}" \ + wasmoptflags="${{ matrix.entry.wasmoptflags }} ${{ matrix.entry.debugflags }}" + + # miniruby may not be built when cross-compling + - run: make mini ruby + + - run: make install DESTDIR=$PWD/../install + - run: tar cfz ../install.tar.gz -C ../install . + + - name: Upload artifacts + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: ruby-wasm-install + path: ${{ github.workspace }}/install.tar.gz + - name: Show Playground URL to try the build + run: | + echo "Try on Playground: https://ruby.github.io/play-ruby?run=$GITHUB_RUN_ID" >> $GITHUB_STEP_SUMMARY + + - name: Run basictest + run: wasmtime run ./../build/miniruby --mapdir /::./ -- basictest/test.rb + working-directory: src + + - name: Run bootstraptest (no thread) + run: | + NO_THREAD_TESTS="$(grep -L Thread -R ./bootstraptest | awk -F/ '{ print $NF }' | uniq | sed -n 's/test_\(.*\).rb/\1/p' | paste -s -d, -)" + ruby ./bootstraptest/runner.rb --ruby="$(which wasmtime) run $PWD/../build/ruby --mapdir /::./ -- " --verbose "--sets=$NO_THREAD_TESTS" + working-directory: src + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.entry.name }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + # Workaround for https://github.com/orgs/community/discussions/25220 + - name: Save Pull Request number + if: ${{ github.event_name == 'pull_request' }} + run: echo "${{ github.event.pull_request.number }}" >> ${{ github.workspace }}/github-pr-info.txt + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + if: ${{ github.event_name == 'pull_request' }} + with: + name: github-pr-info + path: ${{ github.workspace }}/github-pr-info.txt + +defaults: + run: + working-directory: build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..1d44a5482c --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,201 @@ +name: Windows +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + make: + strategy: + matrix: + include: + - os: 2022 + vc: 2022 + test_task: check + - os: 2025 + vc: 2022 + test_task: check + - os: 11-arm + test_task: 'btest test-basic test-tool' # check and test-spec are broken yet. + target: arm64 + - os: 2025 + vc: 2022 + test_task: test-bundled-gems + fail-fast: false + + runs-on: windows-${{ matrix.os }} + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + name: Windows ${{ matrix.os }}/Visual C++ ${{ matrix.vc }} (${{ matrix.test_task }}) + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + VCPKG_DEFAULT_TRIPLET: ${{ matrix.target || 'x64' }}-windows + + steps: + - run: md build + working-directory: + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + # windows-11-arm has only 3.4.1, 3.4.2, 3.4.3, head + ruby-version: ${{ !endsWith(matrix.os, 'arm') && '3.1' || '3.4' }} + bundler: none + windows-toolchain: none + + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + make-command: nmake + clean: true + + - name: Install tools with scoop + run: | + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + iwr -useb get.scoop.sh | iex + Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH + scoop install vcpkg uutils-coreutils + shell: pwsh + + - name: Restore vcpkg artifact + id: restore-vcpkg + uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 + with: + path: src\vcpkg_installed + key: windows-${{ matrix.os }}-vcpkg-${{ hashFiles('src/vcpkg.json') }} + + - name: Install libraries with vcpkg + run: | + vcpkg install --vcpkg-root=%USERPROFILE%\scoop\apps\vcpkg\current + working-directory: src + if: ${{ ! steps.restore-vcpkg.outputs.cache-hit }} + + - name: Save vcpkg artifact + uses: actions/cache/save@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 + with: + path: src\vcpkg_installed + key: windows-${{ matrix.os }}-vcpkg-${{ hashFiles('src/vcpkg.json') }} + if: ${{ ! steps.restore-vcpkg.outputs.cache-hit && (github.ref_name == 'master' || startsWith(github.ref_name, 'ruby_')) }} + + - name: setup env + # Available Ruby versions: https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md#ruby + # %TEMP% is inconsistent with %TMP% and test-all expects they are consistent. + # https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302 + run: | + ::- Set up VC ${{ matrix.vc }} + set | sort > old.env + call ..\src\win32\vssetup.cmd ^ + -arch=${{ matrix.target || 'amd64' }} ^ + ${{ matrix.vcvars && '-vcvars_ver=' || '' }}${{ matrix.vcvars }} + nmake -f nul + set TMP=%RUNNER_TEMP% + set TEMP=%RUNNER_TEMP% + set MAKEFLAGS=l + set /a TEST_JOBS=(15 * %NUMBER_OF_PROCESSORS% / 10) > nul + set RUBY_OPT_DIR=%GITHUB_WORKSPACE:\=/%/src/vcpkg_installed/%VCPKG_DEFAULT_TRIPLET% + set | sort > new.env + comm -13 old.env new.env >> %GITHUB_ENV% + del *.env + + - name: baseruby version + run: ruby -v + + - name: compiler version + run: cl + + - name: volume info + run: Get-Volume + shell: pwsh + + # TODO: We should use `../src` instead of `D:/a/ruby/ruby/src` + - name: Configure + run: >- + ../src/win32/configure.bat --disable-install-doc + --with-opt-dir=%RUBY_OPT_DIR% + --with-gmp + + - run: nmake prepare-vcpkg + + - run: nmake incs + + - run: nmake extract-extlibs + + # On all other platforms, test-spec depending on extract-gems (in common.mk) is enough. + # But not for this Visual Studio workflow. So here we extract gems before building. + - run: nmake extract-gems + + # windows-11-arm runner cannot run `ruby tool/file2lastrev.rb --revision.h --output=revision.h` + - name: make revision.h + run: | + win32\lastrev.bat | win32\ifchange.bat --timestamp=.revision.time revision.h - + type revision.h + working-directory: src + + - run: nmake + + - name: Set up Launchable + uses: ./.github/actions/launchable/setup + with: + os: windows-${{ matrix.os }} + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + builddir: build + srcdir: src + test-task: ${{ matrix.test_task || 'check' }} + continue-on-error: true + if: ${{ matrix.test_task != 'test-bundled-gems' }} + timeout-minutes: 3 + + - run: nmake ${{ matrix.test_task || 'check' }} + env: + RUBY_TESTOPTS: -j${{ env.TEST_JOBS || 4 }} + timeout-minutes: 70 + + - uses: ./.github/actions/slack + with: + label: Windows ${{ matrix.os }} / VC ${{ matrix.vc }} / ${{ matrix.test_task || 'check' }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + result: + if: ${{ always() }} + name: ${{ github.workflow }} result + runs-on: windows-latest + needs: [make] + steps: + - run: exit 1 + working-directory: + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + +defaults: + run: + working-directory: build + shell: cmd diff --git a/.github/workflows/wsl.yml b/.github/workflows/wsl.yml new file mode 100644 index 0000000000..640f18ce42 --- /dev/null +++ b/.github/workflows/wsl.yml @@ -0,0 +1,70 @@ +name: Ubuntu on WSL + +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +jobs: + wsl: + runs-on: windows-2025 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - name: Install or update WSL + uses: Ubuntu/WSL/.github/actions/wsl-install@main + with: + distro: Ubuntu-24.04 + + - name: Install dependencies + uses: Ubuntu/WSL/.github/actions/wsl-bash@main + with: + distro: Ubuntu-24.04 + working-dir: /tmp/github/ + exec: | + DEBIAN_FRONTEND=noninteractive sudo apt update + DEBIAN_FRONTEND=noninteractive sudo apt install -y ruby build-essential autoconf libssl-dev libyaml-dev zlib1g-dev libgmp-dev libffi-dev + + - name: Check out the repository + uses: Ubuntu/WSL/.github/actions/wsl-checkout@main + with: + distro: Ubuntu-24.04 + working-dir: /tmp/github/ + submodules: true + + - name: Build + uses: Ubuntu/WSL/.github/actions/wsl-bash@main + with: + distro: Ubuntu-24.04 + working-dir: /tmp/github/ + exec: | + ./autogen.sh + ./configure --disable-install-doc + make ruby -j4 + make extract-gems + make -j4 + + - name: Test + uses: Ubuntu/WSL/.github/actions/wsl-bash@main + with: + distro: Ubuntu-24.04 + working-dir: /tmp/github/ + exec: | + ./ruby -v + # make check TESTS="-j4" MSPECOPT="-j" diff --git a/.github/workflows/yjit-macos.yml b/.github/workflows/yjit-macos.yml new file mode 100644 index 0000000000..a59b4d6508 --- /dev/null +++ b/.github/workflows/yjit-macos.yml @@ -0,0 +1,198 @@ +name: YJIT macOS +on: + push: + branches: + - master + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + types: + - opened + - synchronize + - reopened + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + cargo: + name: cargo test + + runs-on: macos-14 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - run: RUST_BACKTRACE=1 cargo test + working-directory: yjit + + # Also compile and test with all features enabled + - run: RUST_BACKTRACE=1 cargo test --all-features + working-directory: yjit + + # Check that we can build in release mode too + - run: cargo build --release + working-directory: yjit + + make: + strategy: + matrix: + include: + - test_task: 'check' + configure: '--enable-yjit' + yjit_opts: '--yjit' + - test_task: 'check' + configure: '--enable-yjit=dev' + yjit_opts: '--yjit-call-threshold=1 --yjit-verify-ctx --yjit-code-gc' + specopts: '-T --yjit-call-threshold=1 -T --yjit-verify-ctx -T --yjit-code-gc' + fail-fast: false + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + RUN_OPTS: ${{ matrix.yjit_opts }} + SPECOPTS: ${{ matrix.specopts }} + + runs-on: macos-14 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - name: Install libraries + uses: ./.github/actions/setup/macos + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + dummy-files: ${{ matrix.test_task == 'check' }} + # Set fetch-depth: 10 so that Launchable can receive commits information. + fetch-depth: 10 + + - name: Run configure + run: ../src/configure -C --disable-install-doc ${{ matrix.configure }} + + - run: make prepare-gems + if: ${{ matrix.test_task == 'test-bundled-gems' }} + + - run: make + + - name: Verify that --yjit-dump-disasm works + run: | + ./miniruby --yjit-call-threshold=1 --yjit-dump-disasm -e0 | \ + wc -l | \ + ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10' + if: ${{ contains(matrix.configure, 'jit=dev') }} + + - name: Set ENV for YJIT + run: | + echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV + echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV + + - name: Set test options for skipped tests + run: | + set -x + TESTS="$(echo "${{ matrix.skipped_tests }}" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|')" + echo "TESTS=${TESTS}" >> $GITHUB_ENV + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} + + - name: Set up Launchable + id: launchable + uses: ./.github/actions/launchable/setup + with: + os: macos-14 + test-opts: ${{ matrix.configure }} + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + builddir: build + srcdir: src + is-yjit: true + continue-on-error: true + timeout-minutes: 3 + + - name: make ${{ matrix.test_task }} + run: | + test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}") + test -n "${LAUNCHABLE_STDERR}" && exec 2> >(tee "${LAUNCHABLE_STDERR}") + + set -x + make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} \ + RUN_OPTS="$RUN_OPTS" \ + SPECOPTS="$SPECOPTS" + timeout-minutes: 60 + env: + RUBY_TESTOPTS: '-q --tty=no' + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + SYNTAX_SUGGEST_TIMEOUT: '5' + PRECHECK_BUNDLED_GEMS: 'no' + LAUNCHABLE_STDOUT: ${{ steps.launchable.outputs.stdout_report_path }} + LAUNCHABLE_STDERR: ${{ steps.launchable.outputs.stderr_report_path }} + continue-on-error: ${{ matrix.continue-on-test_task || false }} + + - name: make skipped tests + run: | + make -s test-all TESTS="${TESTS//-n!\//-n/}" + env: + GNUMAKEFLAGS: '' + RUBY_TESTOPTS: '-v --tty=no' + PRECHECK_BUNDLED_GEMS: 'no' + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} + continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} + + - name: Dump crash logs + if: ${{ failure() }} + continue-on-error: true + run: | + tail --verbose --lines=+1 rb_crash_*.txt + exit 1 + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.test_task }} ${{ matrix.configure }} ${{ matrix.yjit_opts }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + result: + if: ${{ always() }} + name: ${{ github.workflow }} result + runs-on: macos-14 + needs: [make] + steps: + - name: ${{ github.workflow }} jobs have failed + run: exit 1 + working-directory: + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml new file mode 100644 index 0000000000..150f0b3275 --- /dev/null +++ b/.github/workflows/yjit-ubuntu.yml @@ -0,0 +1,240 @@ +name: YJIT Ubuntu +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + cargo: + name: cargo test + + # GitHub Action's image seems to already contain a Rust 1.58.0. + runs-on: ubuntu-22.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + # For now we can't run cargo test --offline because it complains about the + # capstone dependency, even though the dependency is optional + #- run: cargo test --offline + + - run: RUST_BACKTRACE=1 cargo test + working-directory: yjit + + # Also compile and test with all features enabled + - run: RUST_BACKTRACE=1 cargo test --all-features + working-directory: yjit + + # Check that we can build in release mode too + - run: cargo build --release + working-directory: yjit + + lint: + name: cargo clippy + + # GitHub Action's image seems to already contain a Rust 1.58.0. + runs-on: ubuntu-22.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + # Check that we don't have linting errors in release mode, too + - run: cargo clippy --all-targets --all-features + working-directory: yjit + + make: + strategy: + fail-fast: false + matrix: + include: + - test_task: 'yjit-bindgen' + hint: 'To fix: use patch in logs' + # Build with YJIT+ZJIT for output that works in the most number of configurations + configure: '--with-gcc=clang-14 --enable-yjit=dev --enable-zjit' + libclang_path: '/usr/lib/llvm-14/lib/libclang.so.1' + + - test_task: 'check' + # YJIT should be automatically built in release mode on x86-64 Linux with rustc present + #configure: "--enable-yjit RUSTC='rustc +1.58.0'" + configure: "RUSTC='rustc +1.58.0'" + rust_version: '1.58.0' + + - test_task: 'check' + configure: '--enable-yjit=dev' + + - test_task: 'check' + configure: '--enable-yjit=dev' + yjit_opts: '--yjit-call-threshold=1 --yjit-verify-ctx --yjit-code-gc' + specopts: '-T --yjit-call-threshold=1 -T --yjit-verify-ctx -T --yjit-code-gc' + + - test_task: 'test-bundled-gems' + configure: '--enable-yjit=dev' + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + RUN_OPTS: ${{ matrix.yjit_opts }} + YJIT_BENCH_OPTS: ${{ matrix.yjit_bench_opts }} + SPECOPTS: ${{ matrix.specopts }} + RUBY_DEBUG: ci + RUST_BACKTRACE: 1 + + runs-on: ubuntu-22.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - uses: ./.github/actions/setup/ubuntu + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.1' + bundler: none + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + dummy-files: ${{ matrix.test_task == 'check' }} + # Set fetch-depth: 10 so that Launchable can receive commits information. + fetch-depth: 10 + + - name: Install Rust + if: ${{ matrix.rust_version }} + run: rustup install ${{ matrix.rust_version }} --profile minimal + + - name: Remove cargo + # Since this tests a `rustc` build for release, remove `cargo` to ensure + # that only `rustc` is used. + if: ${{ contains(matrix.configure, 'rustc') }} + run: sudo rm $(which -a cargo | uniq) + + - name: Run configure + run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install ${{ matrix.configure }} + + - run: make incs + + - run: make prepare-gems + if: ${{ matrix.test_task == 'test-bundled-gems' }} + + - run: make + + - name: Verify that --yjit-dump-disasm works + run: | + ./miniruby --yjit-call-threshold=1 --yjit-dump-disasm -e0 | \ + wc -l | \ + ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10' + if: ${{ contains(matrix.configure, 'jit=dev') }} + + - name: Set ENV for YJIT + run: | + echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV + echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV + + # Check that the binary was built with YJIT + - name: Check YJIT enabled + run: ./miniruby --yjit -v | grep "+YJIT" + + - name: Set up Launchable + id: launchable + uses: ./.github/actions/launchable/setup + with: + os: ubuntu-22.04 + test-opts: ${{ matrix.configure }} + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + builddir: build + srcdir: src + is-yjit: true + continue-on-error: true + timeout-minutes: 3 + + - name: make ${{ matrix.test_task }} + run: | + test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}") + test -n "${LAUNCHABLE_STDERR}" && exec 2> >(tee "${LAUNCHABLE_STDERR}") + + set -x + make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} \ + RUN_OPTS="$RUN_OPTS" MSPECOPT=--debug SPECOPTS="$SPECOPTS" \ + YJIT_BENCH_OPTS="$YJIT_BENCH_OPTS" YJIT_BINDGEN_DIFF_OPTS="$YJIT_BINDGEN_DIFF_OPTS" + timeout-minutes: 90 + env: + RUBY_TESTOPTS: '-q --tty=no' + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + PRECHECK_BUNDLED_GEMS: 'no' + SYNTAX_SUGGEST_TIMEOUT: '5' + YJIT_BINDGEN_DIFF_OPTS: '--exit-code' + LIBCLANG_PATH: ${{ matrix.libclang_path }} + LAUNCHABLE_STDOUT: ${{ steps.launchable.outputs.stdout_report_path }} + LAUNCHABLE_STDERR: ${{ steps.launchable.outputs.stderr_report_path }} + continue-on-error: ${{ matrix.continue-on-test_task || false }} + + - name: Dump crash logs + if: ${{ failure() }} + continue-on-error: true + run: | + tail --verbose --lines=+1 rb_crash_*.txt + exit 1 + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.test_task }} ${{ matrix.configure }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + result: + if: ${{ always() }} + name: ${{ github.workflow }} result + runs-on: ubuntu-latest + needs: [make] + steps: + - run: exit 1 + working-directory: + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/zjit-macos.yml b/.github/workflows/zjit-macos.yml new file mode 100644 index 0000000000..a638907811 --- /dev/null +++ b/.github/workflows/zjit-macos.yml @@ -0,0 +1,214 @@ +name: ZJIT macOS +on: + push: + branches: + - master + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + types: + - opened + - synchronize + - reopened + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + make: + strategy: + fail-fast: false + matrix: + include: + - test_task: 'check' + run_opts: '--zjit-call-threshold=1' + specopts: '-T --zjit-call-threshold=1' + configure: '--enable-zjit=dev' + + - test_task: 'check' + run_opts: '--zjit-disable-hir-opt --zjit-call-threshold=1' + specopts: '-T --zjit-disable-hir-opt -T --zjit-call-threshold=1' + configure: '--enable-zjit=dev' + + - test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit.rb + configure: '--enable-yjit=dev --enable-zjit' + rust_version: "1.85.0" + + - test_task: 'ruby' + hint: 'combo build test' + configure: '--enable-yjit --enable-zjit' + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + RUN_OPTS: ${{ matrix.run_opts }} + SPECOPTS: ${{ matrix.specopts }} + TESTOPTS: ${{ matrix.testopts }} + ZJIT_RB_BUG: 1 + + runs-on: macos-14 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - name: Install libraries + uses: ./.github/actions/setup/macos + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + dummy-files: ${{ matrix.test_task == 'check' }} + # Set fetch-depth: 10 so that Launchable can receive commits information. + fetch-depth: 10 + + - name: Install Rust + if: ${{ matrix.rust_version }} + run: | + rustup install ${{ matrix.rust_version }} --profile minimal + rustup default ${{ matrix.rust_version }} + + - uses: taiki-e/install-action@v2 + with: + tool: nextest@0.9 + if: ${{ matrix.test_task == 'zjit-check' }} + + - name: Run configure + run: ../src/configure -C --disable-install-doc ${{ matrix.configure }} + + - run: make + + - name: Verify that --zjit-dump-disasm works + run: | + ./miniruby --zjit-call-threshold=1 --zjit-dump-disasm -e0 | \ + wc -l | \ + ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10' + if: ${{ contains(matrix.configure, 'jit=dev') }} + + - name: Set ENV for ZJIT + run: | + echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV + + - name: make ${{ matrix.test_task }} + run: | + set -x + make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} \ + RUN_OPTS="$RUN_OPTS" \ + SPECOPTS="$SPECOPTS" \ + TESTOPTS="$TESTOPTS" + timeout-minutes: 60 + env: + RUBY_TESTOPTS: '-q --tty=no' + EXCLUDES: '../src/test/.excludes-zjit' + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + SYNTAX_SUGGEST_TIMEOUT: '5' + PRECHECK_BUNDLED_GEMS: 'no' + continue-on-error: ${{ matrix.continue-on-test_task || false }} + + - name: Dump crash logs + if: ${{ failure() }} + continue-on-error: true + run: | + tail --verbose --lines=+1 rb_crash_*.txt + exit 1 + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.test_task }} ${{ matrix.configure }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + result: + if: ${{ always() }} + name: ${{ github.workflow }} result + runs-on: macos-14 + needs: [make] + steps: + - run: exit 1 + working-directory: + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + + # Separated from `make` job to avoid making it a required status check for now + ruby-bench: + strategy: + matrix: + include: + # Test --call-threshold=2 with 2 iterations in total + - ruby_opts: '--zjit-call-threshold=2' + bench_opts: '--warmup=1 --bench=1 --excludes=lobsters' + configure: '--enable-zjit=dev_nodebug' # --enable-zjit=dev is too slow + + runs-on: macos-14 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - uses: ./.github/actions/setup/macos + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + + - name: Run configure + run: ../src/configure -C --disable-install-doc --prefix="$(pwd)/install" ${{ matrix.configure }} + + - run: make install + + # setup/directories set MAKEFLAGS=-j4 for macOS, which randomly fails sqlite3.gem builds + - name: Unset MAKEFLAGS + run: echo "MAKEFLAGS=" >> "$GITHUB_ENV" + + - name: Checkout ruby-bench + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + repository: ruby/ruby-bench + path: ruby-bench + + # If you want to skip failing benchmark, consider using `--excludes`. + # e.g. `bench_opts: '--warmup=1 --bench=1 --excludes=railsbench,lobsters'` + - name: Run ruby-bench + run: ruby run_benchmarks.rb -e "zjit::../build/install/bin/ruby ${{ matrix.ruby_opts }}" ${{ matrix.bench_opts }} + working-directory: ruby-bench + + - uses: ./.github/actions/slack + with: + label: ruby-bench ${{ matrix.bench_opts }} ${{ matrix.ruby_opts }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml new file mode 100644 index 0000000000..28bfec963e --- /dev/null +++ b/.github/workflows/zjit-ubuntu.yml @@ -0,0 +1,267 @@ +name: ZJIT Ubuntu +on: + push: + branches: + - master + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + types: + - opened + - synchronize + - reopened + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + lint: + name: cargo clippy + + runs-on: ubuntu-22.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - run: cargo clippy --all-targets --all-features + working-directory: zjit + + make: + strategy: + fail-fast: false + matrix: + include: + - test_task: 'check' + run_opts: '--zjit-call-threshold=1' + specopts: '-T --zjit-call-threshold=1' + configure: '--enable-zjit=dev' + + - test_task: 'check' + run_opts: '--zjit-disable-hir-opt --zjit-call-threshold=1' + specopts: '-T --zjit-disable-hir-opt -T --zjit-call-threshold=1' + configure: '--enable-zjit=dev' + + # The optimizer benefits from at least 1 iteration of profiling. Also, many + # regression tests in bootstraptest/test_yjit.rb assume call-threshold=2. + - test_task: 'btest' + run_opts: '--zjit-call-threshold=2' + configure: '--enable-zjit=dev' + + - test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit.rb + configure: '--enable-yjit --enable-zjit=dev' + rust_version: '1.85.0' + + - test_task: 'zjit-bindgen' + hint: 'To fix: use patch in logs' + # Build with YJIT+ZJIT for output that works in the most number of configurations + configure: '--enable-zjit=dev --enable-yjit --with-gcc=clang-16' + clang_path: '/usr/bin/clang-16' + runs-on: 'ubuntu-24.04' # for clang-16 + + - test_task: 'test-bundled-gems' + configure: '--enable-zjit=dev' + run_opts: '--zjit-call-threshold=1' + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + RUN_OPTS: ${{ matrix.run_opts }} + YJIT_BENCH_OPTS: ${{ matrix.yjit_bench_opts }} + SPECOPTS: ${{ matrix.specopts }} + TESTOPTS: ${{ matrix.testopts }} + RUBY_DEBUG: ci + BUNDLE_JOBS: 8 # for yjit-bench + RUST_BACKTRACE: 1 + ZJIT_RB_BUG: 1 + + runs-on: ${{ matrix.runs-on || 'ubuntu-22.04' }} + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + + - uses: ./.github/actions/setup/ubuntu + + - uses: ruby/setup-ruby@b90be12699fdfcbee4440c2bba85f6f460446bb0 # v1.279.0 + with: + ruby-version: '3.1' + bundler: none + + - uses: taiki-e/install-action@v2 + with: + tool: nextest@0.9 + if: ${{ matrix.test_task == 'zjit-check' }} + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + dummy-files: ${{ matrix.test_task == 'check' }} + # Set fetch-depth: 10 so that Launchable can receive commits information. + fetch-depth: 10 + + - name: Install Rust + if: ${{ matrix.rust_version }} + run: | + rustup install ${{ matrix.rust_version }} --profile minimal + rustup default ${{ matrix.rust_version }} + + - name: Install rustfmt + if: ${{ matrix.test_task == 'zjit-bindgen' }} + run: rustup component add rustfmt + + - name: Run configure + run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install ${{ matrix.configure }} + + - run: make incs + + - run: make prepare-gems + if: ${{ matrix.test_task == 'test-bundled-gems' }} + + - run: make + + - name: Verify that --zjit-dump-disasm works + run: | + ./miniruby --zjit-call-threshold=1 --zjit-dump-disasm -e0 | \ + wc -l | \ + ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10' + if: ${{ contains(matrix.configure, 'jit=dev') }} + + # Check that the binary was built with ZJIT + - name: Check ZJIT enabled + run: ./miniruby --zjit -v | grep "+ZJIT" + if: ${{ matrix.configure != '--disable-zjit' }} + + - name: Set ENV for ZJIT + run: | + echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV + + - name: make ${{ matrix.test_task }} + run: | + set -x + make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} \ + RUN_OPTS="$RUN_OPTS" MSPECOPT=--debug SPECOPTS="$SPECOPTS" \ + TESTOPTS="$TESTOPTS" \ + ZJIT_BINDGEN_DIFF_OPTS="$ZJIT_BINDGEN_DIFF_OPTS" + timeout-minutes: 90 + env: + RUBY_TESTOPTS: '-q --tty=no' + EXCLUDES: '../src/test/.excludes-zjit' + TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' + PRECHECK_BUNDLED_GEMS: 'no' + SYNTAX_SUGGEST_TIMEOUT: '5' + ZJIT_BINDGEN_DIFF_OPTS: '--exit-code' + CLANG_PATH: ${{ matrix.clang_path }} + continue-on-error: ${{ matrix.continue-on-test_task || false }} + + - name: Dump crash logs + if: ${{ failure() }} + continue-on-error: true + run: | + tail --verbose --lines=+1 rb_crash_*.txt + exit 1 + + - uses: ./.github/actions/slack + with: + label: ${{ matrix.test_task }} ${{ matrix.configure }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + + result: + if: ${{ always() }} + name: ${{ github.workflow }} result + runs-on: ubuntu-22.04 + needs: [make] + steps: + - name: ${{ github.workflow }} jobs have failed + run: exit 1 + working-directory: + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + + # Separated from `make` job to avoid making it a required status check for now + ruby-bench: + strategy: + matrix: + include: + # Test --call-threshold=2 with 2 iterations in total + - ruby_opts: '--zjit-call-threshold=2' + bench_opts: '--warmup=1 --bench=1 --excludes=lobsters' + configure: '--enable-zjit=dev_nodebug' # --enable-zjit=dev is too slow + + runs-on: ubuntu-24.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - uses: ./.github/actions/setup/ubuntu + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + + - name: Run configure + run: ../src/configure -C --disable-install-doc --prefix="$(pwd)/install" ${{ matrix.configure }} + + - run: make install + + - name: Checkout ruby-bench + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + repository: ruby/ruby-bench + path: ruby-bench + + # If you want to skip failing benchmark, consider using `--excludes`. + # e.g. `bench_opts: '--warmup=1 --bench=1 --excludes=railsbench,lobsters'` + - name: Run ruby-bench + run: ruby run_benchmarks.rb -e "zjit::../build/install/bin/ruby ${{ matrix.ruby_opts }}" ${{ matrix.bench_opts }} + working-directory: ruby-bench + + - uses: ./.github/actions/slack + with: + label: ruby-bench ${{ matrix.bench_opts }} ${{ matrix.ruby_opts }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + +defaults: + run: + working-directory: build diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..6cf5fb5f32 --- /dev/null +++ b/.gitignore @@ -0,0 +1,280 @@ +*-*-*.def +*-*-*.exp +*-*-*.lib +*.a +*.bak +*.bc +*.bundle +*.dSYM +*.dmyh +*.dylib +*.elc +*.i +*.ii +*.inc +*.log +*.o +*.o.tmp +*.obj +*.old +*.orig +*.pch +*.pdb +*.rbinc +*.rbbin +*.rej +*.s +*.sav +*.sl +*.so +*.so.* +*.swp +*.yarb +*~ +.*.list +.*.time +.DS_Store +.bundle +.ccmalloc +.ext +.pc +.ppack +.svn +.time +.ruby-version +Makefile +cygruby*.def +extconf.h +y.output +y.tab.c +*.gcda +*.gcno +*.gcov +*.vscode +!misc/.vscode +lcov*.info + +# / +/*-fake.rb +/*.dll +/*.exe +/*.res +/*.pc +/*.rc +/*_prelude.c +/.downloaded-cache +/.top-enc.mk +/build*/ +/COPYING.LIB +/ChangeLog +/Doxyfile +/GNUmakefile +/README.atheos +/README.fat-patch +/README.v6 +/TAGS +/archive +/autom4te*.cache +/automake +/benchmark/benchmark-driver +/beos +/bmlog-* +/breakpoints.gdb +/config.cache +/config.h +/config.h.in +/config.status +/config.status.lineno +/configure +/coverage/simplecov +/coverage/simplecov-html +/coverage/doclie +/coverage/.last_run.json +/coverage/.resultset.json* +/coverage/assets +/coverage/index.html +/doc/capi +/enc.mk +/encdb.h +/exts.mk +/goruby +/id.[ch] +/largefile.h +/lcov-c-out +/lcov-rb-out +/lcov-out +/lex.c +/libruby*.* +/miniprelude.c +/miniruby +/newdate.rb +/newline.c +/newver.rb +/parse.c +/parse.h +/patches +/patches-master +/pitest.rb +/ppack +/prelude.c +/preview +/probes.dmyh +/probes.h +/rbconfig.rb +/rename2.h +/repack +/revision.h +/revision.tmp +/ripper.tmp.y +/riscos +/rubicon +/ruby +/ruby-runner +/ruby-runner.h +/ruby-man.rd.gz +/rubyspec_temp +/run.gdb +/sizes.c +/static-ruby +/test.rb +/test-coverage.dat +/tmp +/vcpkg_installed +/transdb.h +/uncommon.mk +/verconf.h +/verconf.mk +/web + +# /bin/ + +/bin/*.exe +/bin/*.dll +/bin/goruby +/bin/ruby + +# /benchmark/ +/benchmark/bm_require.data +/benchmark/bmx_*.rb +/benchmark/fasta.output.* +/benchmark/wc.input + +/enc/*.def +/enc/*.exp +/enc/*.lib +/enc/jis/props.h +/enc/unicode/data + +# /coroutine/ +!/coroutine/**/*.s +!/coroutine/**/*.S + +# /enc/trans/ +/enc/trans/*.c +/enc/trans/*.def +/enc/trans/*.exp +/enc/trans/*.lib + +# /exe/ +/exe/goruby +/exe/ruby + +# /ext/ +/ext/extinit.c +/ext/configure-ext.mk +/ext/*/exts.mk + +# /ext/-test-/cxxanyargs +/ext/-test-/cxxanyargs/failure*.failed + +# /ext/-test-/win32/dln/ +/ext/-test-/win32/dln/dlntest.dll +/ext/-test-/win32/dln/dlntest.exp +/ext/-test-/win32/dln/dlntest.lib + +# /ext/-test-/gems +/ext/-test-/gems + +# /ext/etc/ +/ext/etc/constdefs.h + +# /ext/fiddle/ +/ext/fiddle/libffi-* + +# /ext/rbconfig/ +/ext/rbconfig/sizeof/sizes.c +/ext/rbconfig/sizeof/limits.c + +# /ext/ripper/ +/ext/ripper/eventids1.c +/ext/ripper/eventids1.h +/ext/ripper/.eventids2-check +/ext/ripper/eventids2table.c +/ext/ripper/ripper_init.c +/ext/ripper/ripper.* +/ext/ripper/ids1 +/ext/ripper/ids2 + +# /ext/socket/ +/ext/socket/constants.h +/ext/socket/constdefs.h +/ext/socket/constdefs.c + +# /gems +/gems/*.gem +/gems/src +/gems/*-* + +# /lib/ +/lib/ruby/[1-9]*.* +/lib/ruby/vendor_ruby + +# /misc/ +/misc/**/__pycache__ + +# for `make test-bundler` +/.rspec_status + +# /tool/ +/tool/config.guess +/tool/config.sub + +# /win32/ +/win32/*.ico + + +# YJIT +/yjit-bench +/yjit_exit_locations.dump + +# Rust +/target + +# /wasm/ +/wasm/tests/*.wasm + +# prism +/lib/prism/compiler.rb +/lib/prism/dispatcher.rb +/lib/prism/dot_visitor.rb +/lib/prism/dsl.rb +/lib/prism/inspect_visitor.rb +/lib/prism/mutation_compiler.rb +/lib/prism/node.rb +/lib/prism/reflection.rb +/lib/prism/serialize.rb +/lib/prism/visitor.rb +/prism/api_node.c +/prism/ast.h +/prism/diagnostic.c +/prism/diagnostic.h +/prism/node.c +/prism/prettyprint.c +/prism/serialize.c +/prism/token_type.c +/prism/srcs.mk + +# tool/update-NEWS-gemlist.rb +/bundled_gems.json +/default_gems.json +/gems/default_gems diff --git a/.indent.pro b/.indent.pro new file mode 100644 index 0000000000..1d61cbcad1 --- /dev/null +++ b/.indent.pro @@ -0,0 +1,32 @@ +-bap +-nbbb +-nbc +-br +-brs +-nbs +-ncdb +-nce +-cdw +-cli2 +-cbi2 +-ndj +-ncs +-nfc1 +-i4 +-l120 +-lp +-npcs +-psl +-sc +-sob +-sbi4 +-nut +-par + +-TID +-TVALUE +-Tst_data_t +-Tst_index_t +-Tst_table +-Trb_data_type_t +-TFILE diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000..213a0f4916 --- /dev/null +++ b/.mailmap @@ -0,0 +1,431 @@ +git[bot] <svn-admin@ruby-lang.org> +git[bot] <svn-admin@ruby-lang.org> git <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> +svn[bot] <svn-admin@ruby-lang.org> svn <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# a_matsuda +Akira Matsuda <ronnie@dio.jp> +Akira Matsuda <ronnie@dio.jp> <a_matsuda@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# aamine +Minero Aoki <aamine@loveruby.net> +Minero Aoki <aamine@loveruby.net> <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# akira +akira yamada <akira@ruby-lang.org> +## akira yamada <akira@ruby-lang.org> <akira@rice.p.arika.org> +akira yamada <akira@ruby-lang.org> <akira@arika.org> +akira yamada <akira@ruby-lang.org> <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# akiyoshi +AKIYOSHI, Masamichi <masamichi.akiyoshi@hp.com> +AKIYOSHI, Masamichi <masamichi.akiyoshi@hp.com> <akiyoshi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# akr +Tanaka Akira <akr@fsij.org> +Tanaka Akira <akr@fsij.org> <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# arai +Koji Arai <jca02266@nifty.ne.jp> +Koji Arai <jca02266@nifty.ne.jp> <arai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# arton +Akio Tajima <artonx@yahoo.co.jp> +Akio Tajima <artonx@yahoo.co.jp> <arton@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# aycabta +aycabta <aycabta@gmail.com> +aycabta <aycabta@gmail.com> <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ayumin +Ayumu AIZAWA <ayumu.aizawa@gmail.com> +Ayumu AIZAWA <ayumu.aizawa@gmail.com> <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# azav +Alexander Zavorine <alexandre.zavorine@nokia.com> +Alexander Zavorine <alexandre.zavorine@nokia.com> <azav@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# charliesome +Charlie Somerville <charliesome@ruby-lang.org> +Charlie Somerville <charliesome@ruby-lang.org> <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# dave +Dave Thomas <dave@pragprog.com> +Dave Thomas <dave@pragprog.com> <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# davidflanagan +David Flanagan <davidflanagan@ruby-lang.org> +David Flanagan <davidflanagan@ruby-lang.org> <david@think32> +David Flanagan <davidflanagan@ruby-lang.org> <david@davidflanagan.com> +David Flanagan <davidflanagan@ruby-lang.org> <davidflanagan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# dblack +David A. Black <dblack@rubypal.com> +David A. Black <dblack@rubypal.com> <dblack@wobblini.net> +David A. Black <dblack@rubypal.com> <dblack@superlink.net> +David A. Black <dblack@rubypal.com> <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# drbrain +Eric Hodel <drbrain@segment7.net> +Eric Hodel <drbrain@segment7.net> <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# duerst +Martin Dürst <duerst@it.aoyama.ac.jp> +Martin Dürst <duerst@it.aoyama.ac.jp> <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# eban +WATANABE Hirofumi <eban@ruby-lang.org> +WATANABE Hirofumi <eban@ruby-lang.org> <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# emboss +Martin Bosslet <Martin.Bosslet@gmail.com> +Martin Bosslet <Martin.Bosslet@gmail.com> <Martin.Bosslet@googlemail.com> +Martin Bosslet <Martin.Bosslet@gmail.com> <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# eregon +Benoit Daloze <eregontp@gmail.com> +Benoit Daloze <eregontp@gmail.com> <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# evan +Evan Phoenix <evan@ruby-lang.org> +Evan Phoenix <evan@ruby-lang.org> <evan@fallingsnow.net> +Evan Phoenix <evan@ruby-lang.org> <evan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# glass +Masaki Matsushita <glass.saga@gmail.com> +Masaki Matsushita <glass.saga@gmail.com> <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# gogotanaka +Kazuki Tanaka <gogotanaka@ruby-lang.org> +Kazuki Tanaka <gogotanaka@ruby-lang.org> <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# gotoken +Kentaro Goto <gotoken@gmail.com> +Kentaro Goto <gotoken@gmail.com> <gotoken@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# gotoyuzo +GOTOU Yuuzou <gotoyuzo@notwork.org> +GOTOU Yuuzou <gotoyuzo@notwork.org> <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# gsinclair +Gavin Sinclair <gsinclair@soyabean.com.au> +Gavin Sinclair <gsinclair@soyabean.com.au> <gsinclair@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# H_Konishi +KONISHI Hiromasa <konishih@fd6.so-net.ne.jp> +KONISHI Hiromasa <konishih@fd6.so-net.ne.jp> <H_Konishi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# headius +Charles Oliver Nutter <headius@headius.com> +Charles Oliver Nutter <headius@headius.com> <headius@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# hone +Terence Lee <hone@heroku.com> +Terence Lee <hone@heroku.com> <hone@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# hsbt +Hiroshi SHIBATA <hsbt@ruby-lang.org> +Hiroshi SHIBATA <hsbt@ruby-lang.org> <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# iwamatsu +Nobuhiro Iwamatsu <iwamatsu@nigauri.org> +Nobuhiro Iwamatsu <iwamatsu@nigauri.org> <iwamatsu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# jeg2 +James Edward Gray II <james@graysoftinc.com> +James Edward Gray II <james@graysoftinc.com> <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# jim +Jim Weirich <jim@tardis.local> +Jim Weirich <jim@tardis.local> <jim@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# k0kubun +Takashi Kokubun <takashikkbn@gmail.com> +Takashi Kokubun <takashikkbn@gmail.com> <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# kanemoto +Yutaka Kanemoto <kanemoto@ruby-lang.org> +Yutaka Kanemoto <kanemoto@ruby-lang.org> <kanemoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# katsu +UENO Katsuhiro <katsu@blue.sky.or.jp> +UENO Katsuhiro <katsu@blue.sky.or.jp> <katsu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# kazu +Kazuhiro NISHIYAMA <zn@mbf.nifty.com> +Kazuhiro NISHIYAMA <zn@mbf.nifty.com> <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# keiju +Keiju Ishitsuka <keiju@ishitsuka.com> +Keiju Ishitsuka <keiju@ishitsuka.com> <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# knu +Akinori MUSHA <knu@iDaemons.org> +Akinori MUSHA <knu@iDaemons.org> <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ko1 +Koichi Sasada <ko1@atdot.net> +Koichi Sasada <ko1@atdot.net> <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# kosaki +KOSAKI Motohiro <kosaki.motohiro@gmail.com> +KOSAKI Motohiro <kosaki.motohiro@gmail.com> <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# kosako +K.Kosako <sndgk393@ybb.ne.jp> +K.Kosako <sndgk393@ybb.ne.jp> <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# kou +Sutou Kouhei <kou@clear-code.com> +Sutou Kouhei <kou@clear-code.com> <kou@cozmixng.org> +Sutou Kouhei <kou@clear-code.com> <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# kouji +Kouji Takao <kouji.takao@gmail.com> +Kouji Takao <kouji.takao@gmail.com> <kouji@takao7.net> +Kouji Takao <kouji.takao@gmail.com> <kouji@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ksaito +Kazuo Saito <ksaito@uranus.dti.ne.jp> +Kazuo Saito <ksaito@uranus.dti.ne.jp> <ksaito@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ktsj +Kazuki Tsujimoto <kazuki@callcc.net> +Kazuki Tsujimoto <kazuki@callcc.net> <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# luislavena +Luis Lavena <luislavena@gmail.com> +Luis Lavena <luislavena@gmail.com> <luislavena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# mame +Yusuke Endoh <mame@ruby-lang.org> +## Yusuke Endoh <mame@ruby-lang.org> <mame@tsg.ne.jp> +Yusuke Endoh <mame@ruby-lang.org> <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# marcandre +Marc-Andre Lafortune <github@marc-andre.ca> +Marc-Andre Lafortune <ruby-core@marc-andre.ca> +Marc-Andre Lafortune <ruby-core@marc-andre.ca> <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# matz +Yukihiro "Matz" Matsumoto <matz@ruby.or.jp> +Yukihiro "Matz" Matsumoto <matz@ruby.or.jp> <matz@ruby-lang.org> +Yukihiro "Matz" Matsumoto <matz@ruby.or.jp> <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# michal +Michal Rokos <michal@ruby-lang.org> +Michal Rokos <michal@ruby-lang.org> <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# mneumann +Michael Neumann <mneumann@ruby-lang.org> +Michael Neumann <mneumann@ruby-lang.org> <mneumann@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# mrkn +Kenta Murata <mrkn@mrkn.jp> +Kenta Murata <mrkn@mrkn.jp> <muraken@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> +Kenta Murata <mrkn@mrkn.jp> <3959+mrkn@users.noreply.github.com> +Kenta Murata <mrkn@mrkn.jp> <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# nagachika +nagachika <nagachika@ruby-lang.org> +nagachika <nagachika@ruby-lang.org> <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# nagai +Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> +Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# nahi +Hiroshi Nakamura <nahi@ruby-lang.org> +Hiroshi Nakamura <nahi@ruby-lang.org> <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# nari +Narihiro Nakamura <authornari@gmail.com> +Narihiro Nakamura <authornari@gmail.com> <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# naruse +NARUSE, Yui <naruse@airemix.jp> +NARUSE, Yui <naruse@airemix.jp> <naruse@ruby-lang.org> +NARUSE, Yui <naruse@airemix.jp> <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ngoto +Naohisa Goto <ngotogenome@gmail.com> +Naohisa Goto <ngotogenome@gmail.com> <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# nobu +Nobuyoshi Nakada <nobu@ruby-lang.org> +Nobuyoshi Nakada <nobu@ruby-lang.org> <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# normal +Eric Wong <normal@ruby-lang.org> +Eric Wong <normal@ruby-lang.org> <e@80x24.org> +Eric Wong <normal@ruby-lang.org> <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ntalbott +Nathaniel Talbott <ntalbott@ruby-lang.org> +Nathaniel Talbott <ntalbott@ruby-lang.org> <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ocean +Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> +Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# odaira +Rei Odaira <rodaira@us.ibm.com> +Rei Odaira <rodaira@us.ibm.com> <Rei.Odaira@gmail.com> +Rei Odaira <rodaira@us.ibm.com> <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# okkez +okkez <okkez000@gmail.com> +okkez <okkez000@gmail.com> <okkez@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# rhe +Kazuki Yamaguchi <k@rhe.jp> +Kazuki Yamaguchi <k@rhe.jp> <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ryan +Ryan Davis <ryand-github@zenspider.com> +Ryan Davis <ryand-github@zenspider.com> <ryand-ruby@zenspider.com> +Ryan Davis <ryand-github@zenspider.com> <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# samuel +Samuel Williams <samuel.williams@oriontransfer.co.nz> +Samuel Williams <samuel.williams@oriontransfer.co.nz> <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# seki +Masatoshi SEKI <m_seki@mva.biglobe.ne.jp> +Masatoshi SEKI <m_seki@mva.biglobe.ne.jp> <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ser +Sean Russell <ser@germane-software.com> +Sean Russell <ser@germane-software.com> <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# shigek +Shigeo Kobayashi <shigek@ruby-lang.org> +Shigeo Kobayashi <shigek@ruby-lang.org> <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# shirosaki +Hiroshi Shirosaki <h.shirosaki@gmail.com> +Hiroshi Shirosaki <h.shirosaki@gmail.com> <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# sho-h +Sho Hashimoto <sho-h@ruby-lang.org> +Sho Hashimoto <sho-h@ruby-lang.org> <sho-h@netlab.jp> +Sho Hashimoto <sho-h@ruby-lang.org> <sho.hsmt@gmail.com> +Sho Hashimoto <sho-h@ruby-lang.org> <sho-h@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# shugo +Shugo Maeda <shugo@ruby-lang.org> +Shugo Maeda <shugo@ruby-lang.org> <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# shyouhei +卜部昌平 <shyouhei@ruby-lang.org> +卜部昌平 <shyouhei@ruby-lang.org> <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# siena +Siena. <siena@faculty.chiba-u.jp> +Siena. <siena@faculty.chiba-u.jp> <siena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# sonots +sonots <sonots@gmail.com> +sonots <sonots@gmail.com> <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# sorah +Sorah Fukumori <her@sorah.jp> +Sorah Fukumori <her@sorah.jp> <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# stomar +Marcus Stollsteimer <sto.mar@web.de> +Marcus Stollsteimer <sto.mar@web.de> <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# suke +Masaki Suketa <masaki.suketa@nifty.ne.jp> +Masaki Suketa <masaki.suketa@nifty.ne.jp> <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# tadd +Tadashi Saito <tad.a.digger@gmail.com> +Tadashi Saito <tad.a.digger@gmail.com> <tadd@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# tadf +Tadayoshi Funaba <tadf@dotrb.org> +Tadayoshi Funaba <tadf@dotrb.org> <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# takano32 +TAKANO Mitsuhiro <takano32@gmail.com> +TAKANO Mitsuhiro <takano32@gmail.com> <takano32@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# tarui +Masaya Tarui <tarui@ruby-lang.org> +Masaya Tarui <tarui@ruby-lang.org> <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# technorama +Technorama Ltd. <oss-ruby@technorama.net> +Technorama Ltd. <oss-ruby@technorama.net> <technorama@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# tenderlove +Aaron Patterson <tenderlove@ruby-lang.org> +Aaron Patterson <tenderlove@ruby-lang.org> <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# tmm1 +Aman Gupta <ruby@tmm1.net> +Aman Gupta <ruby@tmm1.net> <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ts +Guy Decoux <ts@moulon.inra.fr> +Guy Decoux <ts@moulon.inra.fr> <ts@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# ttate +Takaaki Tateishi <ttate@ttsky.net> +## Takaaki Tateishi <ttate@ttsky.net> <ttate@kt.jaist.ac.jp> +Takaaki Tateishi <ttate@ttsky.net> <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# uema2 +Takaaki Uematsu <uema2x@jcom.home.ne.jp> +Takaaki Uematsu <uema2x@jcom.home.ne.jp> <uema2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# usa +U.Nakamura <usa@ruby-lang.org> +U.Nakamura <usa@ruby-lang.org> <usa@garbagecollect.jp> +U.Nakamura <usa@ruby-lang.org> <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# wakou +Wakou Aoyama <wakou@ruby-lang.org> +Wakou Aoyama <wakou@ruby-lang.org> <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# wanabe +wanabe <s.wanabe@gmail.com> +wanabe <s.wanabe@gmail.com> <wanabe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# watson1978 +Watson <watson1978@gmail.com> +Watson <watson1978@gmail.com> <watson1978@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# wew +William Webber <william@williamwebber.com> +William Webber <william@williamwebber.com> <wew@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# why +why the lucky stiff <why@ruby-lang.org> +why the lucky stiff <why@ruby-lang.org> <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# xibbar +Takeyuki FUJIOKA <xibbar@ruby-lang.org> +Takeyuki FUJIOKA <xibbar@ruby-lang.org> <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# yugui +Yuki Yugui Sonoda <yugui@yugui.jp> +Yuki Yugui Sonoda <yugui@yugui.jp> <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# yui-knk +yui-knk <spiketeika@gmail.com> +yui-knk <spiketeika@gmail.com> <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# yuki +Yuki Nishijima <yuki24@hey.com> +Yuki Nishijima <yuki24@hey.com> <mail@yukinishijima.net> +Yuki Nishijima <yuki24@hey.com> <yuki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# zsombor +Dee Zsombor <zsombor@ruby-lang.org> +Dee Zsombor <zsombor@ruby-lang.org> <zsombor@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> + +# zzak +zzak <zzakscott@gmail.com> +zzak <zzakscott@gmail.com> <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> diff --git a/.rdoc_options b/.rdoc_options new file mode 100644 index 0000000000..89265cafd4 --- /dev/null +++ b/.rdoc_options @@ -0,0 +1,39 @@ +--- +page_dir: doc +charset: UTF-8 +encoding: UTF-8 +main_page: index.md +title: Documentation for Ruby development version +visibility: :private +rdoc_include: +- doc + +exclude: +- \.gemspec\z +- lib/set/subclass_compatible.rb + +autolink_excluded_words: +- Box +- Class +- Method +- Module +- Process +- RDoc +- Ruby +- Set +- ZJIT +- YJIT + +canonical_root: https://docs.ruby-lang.org/en/master + +footer_content: + Ruby: + Documentation: index.html + Official Website: https://www.ruby-lang.org/ + Playground: https://ruby.github.io/play-ruby/ + Resources: + GitHub: https://github.com/ruby/ruby + Issue Tracker: https://bugs.ruby-lang.org/projects/ruby-master/issues + RubyGems: https://rubygems.org/ + Community: + X: https://x.com/rubylangorg diff --git a/.rspec_parallel b/.rspec_parallel new file mode 100644 index 0000000000..aaff198a32 --- /dev/null +++ b/.rspec_parallel @@ -0,0 +1,2 @@ +--format progress +--format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log @@ -0,0 +1,22 @@ +Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..35e79dd3b9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +See ["Contributing to Ruby"](https://docs.ruby-lang.org/en/master/contributing/contributing_md.html), which includes setup and build instructions. @@ -1,56 +1,58 @@ +{日本語}[rdoc-ref:COPYING.ja] + Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>. -You can redistribute it and/or modify it under either the terms of the GPL -(see the file GPL), or the conditions below: +You can redistribute it and/or modify it under either the terms of the +2-clause BSDL (see the file BSDL), or the conditions below: - 1. You may make and give away verbatim copies of the source form of the - software without restriction, provided that you duplicate all of the - original copyright notices and associated disclaimers. +1. You may make and give away verbatim copies of the source form of the + software without restriction, provided that you duplicate all of the + original copyright notices and associated disclaimers. - 2. You may modify your copy of the software in any way, provided that - you do at least ONE of the following: +2. You may modify your copy of the software in any way, provided that + you do at least ONE of the following: - a) place your modifications in the Public Domain or otherwise - make them Freely Available, such as by posting said - modifications to Usenet or an equivalent medium, or by allowing - the author to include your modifications in the software. + a. place your modifications in the Public Domain or otherwise + make them Freely Available, such as by posting said + modifications to Usenet or an equivalent medium, or by allowing + the author to include your modifications in the software. - b) use the modified software only within your corporation or - organization. + b. use the modified software only within your corporation or + organization. - c) give non-standard binaries non-standard names, with - instructions on where to get the original software distribution. + c. give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. - d) make other distribution arrangements with the author. + d. make other distribution arrangements with the author. - 3. You may distribute the software in object code or binary form, - provided that you do at least ONE of the following: +3. You may distribute the software in object code or binary form, + provided that you do at least ONE of the following: - a) distribute the binaries and library files of the software, - together with instructions (in the manual page or equivalent) - on where to get the original distribution. + a. distribute the binaries and library files of the software, + together with instructions (in the manual page or equivalent) + on where to get the original distribution. - b) accompany the distribution with the machine-readable source of - the software. + b. accompany the distribution with the machine-readable source of + the software. - c) give non-standard binaries non-standard names, with - instructions on where to get the original software distribution. + c. give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. - d) make other distribution arrangements with the author. + d. make other distribution arrangements with the author. - 4. You may modify and include the part of the software into any other - software (possibly commercial). But some files in the distribution - are not written by the author, so that they are not under these terms. +4. You may modify and include the part of the software into any other + software (possibly commercial). But some files in the distribution + are not written by the author, so that they are not under these terms. - For the list of those files and their copying conditions, see the - file LEGAL. + For the list of those files and their copying conditions, see the + file LEGAL. - 5. The scripts and library files supplied as input to or produced as - output from the software do not automatically fall under the - copyright of the software, but belong to whomever generated them, - and may be sold commercially, and may be aggregated with this - software. +5. The scripts and library files supplied as input to or produced as + output from the software do not automatically fall under the + copyright of the software, but belong to whomever generated them, + and may be sold commercially, and may be aggregated with this + software. - 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. +6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. diff --git a/COPYING.ja b/COPYING.ja index 933cc7cb9a..5de2dbcc8f 100644 --- a/COPYING.ja +++ b/COPYING.ja @@ -1,51 +1,53 @@ -$BK\%W%m%0%i%`$O%U%j!<%=%U%H%&%'%"$G$9!%(BGPL(the GNU General -Public License)$B$^$?$O0J2<$K<($9>r7o$GK\%W%m%0%i%`$r:FG[I[$G(B -$B$-$^$9!%(BGPL$B$K$D$$$F$O(BGPL$B%U%!%$%k$r;2>H$7$F2<$5$$!%(B +{English}[rdoc-ref:COPYING] - 1. $BJ#@=$O@)8B$J$/<+M3$G$9!%(B +本プログラムはフリーソフトウェアです.2-clause BSDL +または以下に示す条件で本プログラムを再配布できます +2-clause BSDLについてはBSDLファイルを参照して下さい. - 2. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$N%=!<%9$r(B - $B<+M3$KJQ99$G$-$^$9!%(B +1. 複製は制限なく自由です. - (a) $B%M%C%H%K%e!<%:$K%]%9%H$7$?$j!$:n<T$KJQ99$rAwIU$9$k(B - $B$J$I$NJ}K!$G!$JQ99$r8x3+$9$k!%(B +2. 以下の条件のいずれかを満たす時に本プログラムのソースを + 自由に変更できます. - (b) $BJQ99$7$?K\%W%m%0%i%`$r<+J,$N=jB0$9$kAH?%FbIt$@$1$G(B - $B;H$&!%(B + a. ネットニューズにポストしたり,作者に変更を送付する + などの方法で,変更を公開する. - (c) $BJQ99E@$rL@<($7$?$&$(!$%=%U%H%&%'%"$NL>A0$rJQ99$9$k!%(B - $B$=$N%=%U%H%&%'%"$rG[I[$9$k;~$K$OJQ99A0$NK\%W%m%0%i(B - $B%`$bF1;~$KG[I[$9$k!%$^$?$OJQ99A0$NK\%W%m%0%i%`$N%=!<(B - $B%9$NF~<jK!$rL@<($9$k!%(B + b. 変更した本プログラムを自分の所属する組織内部だけで + 使う. - (d) $B$=$NB>$NJQ99>r7o$r:n<T$H9g0U$9$k!%(B + c. 変更点を明示したうえ,ソフトウェアの名前を変更する. + そのソフトウェアを配布する時には変更前の本プログラ + ムも同時に配布する.または変更前の本プログラムのソー + スの入手法を明示する. - 3. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$r%3%s%Q%$(B - $B%k$7$?%*%V%8%'%/%H%3!<%I$d<B9T7A<0$G$bG[I[$G$-$^$9!%(B + d. その他の変更条件を作者と合意する. - (a) $B%P%$%J%j$r<u$1<h$C$??M$,%=!<%9$rF~<j$G$-$k$h$&$K!$(B - $B%=!<%9$NF~<jK!$rL@<($9$k!%(B +3. 以下の条件のいずれかを満たす時に本プログラムをコンパイ + ルしたオブジェクトコードや実行形式でも配布できます. - (b) $B5!3#2DFI$J%=!<%9%3!<%I$rE:IU$9$k!%(B + a. バイナリを受け取った人がソースを入手できるように, + ソースの入手法を明示する. - (c) $BJQ99$r9T$C$?%P%$%J%j$OL>A0$rJQ99$7$?$&$(!$%*%j%8%J(B - $B%k$N%=!<%9%3!<%I$NF~<jK!$rL@<($9$k!%(B + b. 機械可読なソースコードを添付する. - (d) $B$=$NB>$NG[I[>r7o$r:n<T$H9g0U$9$k!%(B + c. 変更を行ったバイナリは名前を変更したうえ,オリジナ + ルのソースコードの入手法を明示する. - 4. $BB>$N%W%m%0%i%`$X$N0zMQ$O$$$+$J$kL\E*$G$"$l<+M3$G$9!%$?(B - $B$@$7!$K\%W%m%0%i%`$K4^$^$l$kB>$N:n<T$K$h$k%3!<%I$O!$$=(B - $B$l$>$l$N:n<T$N0U8~$K$h$k@)8B$,2C$($i$l$k>l9g$,$"$j$^$9!%(B + d. その他の配布条件を作者と合意する. - $B$=$l$i%U%!%$%k$N0lMw$H$=$l$>$l$NG[I[>r7o$J$I$KIU$$$F$O(B - LEGAL$B%U%!%$%k$r;2>H$7$F$/$@$5$$!%(B +4. 他のプログラムへの引用はいかなる目的であれ自由です.た + だし,本プログラムに含まれる他の作者によるコードは,そ + れぞれの作者の意向による制限が加えられる場合があります. - 5. $BK\%W%m%0%i%`$X$NF~NO$H$J$k%9%/%j%W%H$*$h$S!$K\%W%m%0%i(B - $B%`$+$i$N=PNO$N8"Mx$OK\%W%m%0%i%`$N:n<T$G$O$J$/!$$=$l$>(B - $B$l$NF~=PNO$r@8@.$7$??M$KB0$7$^$9!%$^$?!$K\%W%m%0%i%`$K(B - $BAH$_9~$^$l$k$?$a$N3HD%%i%$%V%i%j$K$D$$$F$bF1MM$G$9!%(B + それらファイルの一覧とそれぞれの配布条件などに付いては + LEGALファイルを参照してください. - 6. $BK\%W%m%0%i%`$OL5J]>Z$G$9!%:n<T$OK\%W%m%0%i%`$r%5%]!<%H(B - $B$9$k0U;V$O$"$j$^$9$,!$%W%m%0%i%`<+?H$N%P%0$"$k$$$OK\%W(B - $B%m%0%i%`$N<B9T$J$I$+$iH/@8$9$k$$$+$J$kB;32$KBP$7$F$b@U(B - $BG$$r;}$A$^$;$s!%(B +5. 本プログラムへの入力となるスクリプトおよび,本プログラ + ムからの出力の権利は本プログラムの作者ではなく,それぞ + れの入出力を生成した人に属します.また,本プログラムに + 組み込まれるための拡張ライブラリについても同様です. + +6. 本プログラムは無保証です.作者は本プログラムをサポート + する意志はありますが,プログラム自身のバグあるいは本プ + ログラムの実行などから発生するいかなる損害に対しても責 + 任を持ちません. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000000..9a4b2ebbba --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,193 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "capstone" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "015ef5d5ca1743e3f94af9509ba6bd2886523cfee46e48d15c2ef5216fd4ac9a" +dependencies = [ + "capstone-sys", + "libc", +] + +[[package]] +name = "capstone-sys" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2267cb8d16a1e4197863ec4284ffd1aec26fe7e57c58af46b02590a0235809a0" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "cc" +version = "1.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" +dependencies = [ + "shlex", +] + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "windows-sys", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "insta" +version = "1.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371" +dependencies = [ + "console", + "once_cell", + "similar", +] + +[[package]] +name = "jit" +version = "0.1.0" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "ruby" +version = "0.0.0" +dependencies = [ + "yjit", + "zjit", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "similar" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "yjit" +version = "0.1.0" +dependencies = [ + "capstone", + "jit", +] + +[[package]] +name = "zjit" +version = "0.0.1" +dependencies = [ + "capstone", + "insta", + "jit", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000000..521129d92d --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,60 @@ +# This is the root Cargo [workspace](https://doc.rust-lang.org/cargo/reference/workspaces.html) +# and the root package for all the rust code that are statically linked into ruby. Rust tooling +# limitations means all Rust code need to share a single archive library (staticlib) at the +# integration point with non-rust code. (See rustlang/rust#44322 and #104707 for a taste of +# the linking challenges.) +# +# Do not add required dependencies. This is a policy that helps downstream consumers and give +# us tight control over what we ship. All of the optional dependencies are used exclusively +# during development. +# +# Release builds avoid Cargo entirely because offline builds can fail even when none of the +# optional dependencies are built (rust-lang/cargo#10352). + +[workspace] +members = ["zjit", "yjit", "jit"] + +[package] +name = "ruby" +version = "0.0.0" +edition = "2024" +rust-version = "1.85.0" +publish = false # Don't publish to crates.io + +[dependencies] +yjit = { path = "yjit", optional = true } +zjit = { path = "zjit", optional = true } + +[lib] +crate-type = ["staticlib"] +path = "ruby.rs" + +[features] +disasm = ["yjit?/disasm", "zjit?/disasm"] +runtime_checks = ["yjit?/runtime_checks", "zjit?/runtime_checks"] +yjit = [ "dep:yjit" ] +zjit = [ "dep:zjit" ] + +[profile.dev] +opt-level = 0 +debug = true +debug-assertions = true +overflow-checks = true + +[profile.dev_nodebug] +inherits = "dev" + +[profile.stats] +inherits = "release" + +[profile.release] +# NOTE: --enable-yjit and zjit builds use `rustc` without going through Cargo. You +# might want to update the `rustc` invocation if you change this profile. +opt-level = 3 +# The extra robustness that comes from checking for arithmetic overflow is +# worth the performance cost for the compiler. +overflow-checks = true +# Generate debug info +debug = true +# Use ThinLTO. Much smaller output for a small amount of build time increase. +lto = "thin" diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index a50c345296..0000000000 --- a/ChangeLog +++ /dev/null @@ -1,388 +0,0 @@ -Mon Aug 18 11:23:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * dir.c (glob_helper): preserve raw order for **. - -Sun Aug 17 23:39:55 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * ext/openssl/extconf.rb (HAVE_VA_ARGS_MACRO): need to compile. - -Sun Aug 17 17:10:03 2003 GOTOU Yuuzou <gotoyuzo@notwork.org> - - * ext/openssl/lib/openssl/ssl.rb (SSLSocket#sync_close=): add a - method to specify if the underlying IO will be closed in - SSLSocket#close. - - * ext/openssl/lib/openssl/buffering.rb: add forwarders to - setsockopt, getsockopt and fcntl. - - * ext/openssl/lib/net/protocols.rb: enable sync for SSLSocket. - -Sun Aug 17 11:32:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * ext/extmk.rb (extmake): should not force to remake Makefile when - installation and so on. - -Sat Aug 16 23:58:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * marshal.c (w_symbol, w_object): get rid of warnings. - - * re.c (rb_memsearch): ditto. - - * time.c (time_dump): ditto. - - * ext/extmk.rb (extmake): not continue making when extconf.rb - failed. - - * ext/openssl/extconf.rb: check __VA_ARGS__ macro more precisely. - - * ext/openssl/ossl.h: remove version.h dependency. - - * ext/openssl/ruby_missing.h: ditto. - - * lib/mkmf.rb (pkg_config): use --libs output except with - only-L for other options. [ruby-list:38099] - - * lib/mkmf.rb (create_makefile): separate rule for static - library from shared object. - - * win32/Makefile.sub, bcc32/Makefile.sub, wince/Makefile.sub: - define exec_prefix and libdir. - -Fri Aug 15 23:15:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org> - - * ext/bigdecimal/bigdecimal.c .h: Bug in combination of limit & div - method fixed. - - * ext/bigdecimal/lib/bigdecimal/math.rb: atan() & sqrt() added. - -Fri Aug 15 12:01:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * configure.in (HUGE_ST_INO): check whether struct stat.st_ino - is larger than long. [ruby-dev:21194] - http://www.geocities.co.jp/SiliconValley-PaloAlto/1409/ruby/beos.html - - * error.c (syserr_eqq): errno might exceed Fixnum limit. - - * error.c (Init_Exception): moved base initialization from - init_syserr(). - - * inits.c (rb_call_inits): postpone initializing errnos until - Bignum is available. - -Fri Aug 15 12:01:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * ext/curses/curses.c (_XOPEN_SOURCE_EXTENDED): needed to let - keyname() and so on be declared. - - * ext/curses/curses.c (curses_resizeterm, window_resize): - arguments conflicted with macros in term.h. - - * ext/curses/curses.c (Curses module methods): ensure - initialized. [ruby-dev:21191] - -Fri Aug 15 02:08:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * gc.c (id2ref): recycle check should be done by klass == 0. - [ruby-core:01408] - -Fri Aug 15 00:38:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org> - - * ext/bigdecimal/bigdecimal.c: Bug in div method fixed. - - * ext/bigdecimal/lib/bigdecimal/math.rb: Newly added. - - * ext/bigdecimal/sample/pi.rb: Changed so as to use math.rb. - -Thu Aug 14 21:19:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c (Init_Thread): Continuation#[] added. [ruby-talk:79028] - -Thu Aug 14 20:03:34 2003 Masaki Suketa <masaki.suketa@nifty.ne.jp> - - * ext/win32ole/win32ole.c (OLE_FREE): should not call - ole_message_loop. - - * ext/win32ole/win32ole.c (ole_event_free): ditto. - - * ext/win32ole/win32ole.c (ole_initialize): stop calling - OleUninitialize at exit. - -Thu Aug 14 11:27:37 2003 NAKAMURA Usaku <usa@ruby-lang.org> - - * gc.c (rb_data_object_alloc): check type of 1st argument. - [ruby-dev:21192] - -Thu Aug 14 00:21:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * parse.y (mlhs_node): should allow "::Foo" (colon3) as lhs. - - * parse.y (lhs): ditto. - - * parse.y (yylex): should return tCOLON3 right after kCLASS. - [ruby-talk:78918] - - * error.c (exc_initialize): was converting argument to string too - eagerly. Only check was needed. [ruby-talk:78958] - -Wed Aug 13 23:31:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org> - - * ext/bigdecimal/bigdecimal.c .h .html: Ambiguity of - BigDecimal::limit removed. - -Wed Aug 13 19:21:34 2003 Christian Neukirchen <chneukirchen@yahoo.de> - - * lib/webrick/https.rb (HTTPServer#run): should set syncing-mode - to SSLSocket. [ruby-talk:78919] - -Wed Aug 13 18:13:49 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c (POP_BLOCK): turn on BLOCK_LEFT flag when leaving block. - - * eval.c (proc_invoke): unpack return/break destination when block - is already left. - -Wed Aug 13 15:58:31 2003 WATANABE Hirofumi <eban@ruby-lang.org> - - * object.c (rb_class_s_alloc): add function prototype to avoid VC++ - warning. - -Wed Aug 13 13:50:59 2003 NAKAMURA Usaku <usa@ruby-lang.org> - - * ext/Win32API/Win32API.c (Win32API_initialize): should pass some - class to first argument of Data_Wrap_Struct(). (ruby-bugs PR#1109) - -Tue Aug 12 16:55:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * Makefile.in: static link libraries to LIBRUBY_SO with static linked - ext. [ruby-dev:21157] - - * ext/extmk.rb (extmake): sort extension library initialization order. - - * ext/extmk.rb (extmake): compact $extlibs. - -Tue Aug 12 02:48:56 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c (THREAD_SAVE_CONTEXT): should explicitly turn off the - flag before calling getcontext(2). - - * eval.c (struct thread): add member to save backing store on - IA64. (ruby-bugs PR1086) - - * eval.c (thread_mark): mark IA64 backing store region. - - * eval.c (thread_free): free saved IA64 backing store. - - * eval.c (rb_thread_save_context): save IA64 backing store as well. - - * eval.c (rb_thread_restore_context): restore IA64 backing store. - - * eval.c (THREAD_ALLOC): initialize IA64 members. - -Mon Aug 11 22:31:50 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org> - * lib/debug.rb(debug_command): inspection command should inspect - resulting value even if it's nil. [ruby-dev:21180] by OMAE, jun - <jun66j5@ybb.ne.jp>. - - * lib/debug.rb(debug_command): incomplete regexp. - -Mon Aug 11 17:33:07 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c (rb_call_super): do not use rb_block_given_p() for - check. [ruby-talk:78656] - - * eval.c (BEGIN_CALLARGS): push ITER_NOT only when ITER_PRE. - -Sun Aug 10 10:43:05 2003 GOTOU Yuuzou <gotoyuzo@notwork.org> - - * ext/openssl/lib/openssl/buffering.rb: increase BLOCK_SIZE - from 1k to 16k bytes. [ruby-talk:78603] - - * ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc): enable - partial write to allow interruption in SSLSocket#write. - -Sun Aug 10 00:34:16 2003 WATANABE Hirofumi <eban@ruby-lang.org> - - * cygwin/GNUmakefile: remove unnecessary '--drive-name=$(CC)' - for ccache. - -Sat Aug 9 10:36:21 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * marshal.c (w_object): do not dump generic instance variable when - marshal_dump is defined. - -Sat Aug 9 00:35:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org> - - * ext/bigdecimal.c: F style output(like 1234.56789) implemented - to to_s method. - * ext/bigdecimal_??.html: F style output(like 1234.56789) - implemented to to_s method. - -Fri Aug 8 12:33:17 2003 WATANABE Hirofumi <eban@ruby-lang.org> - - * bcc32/Makefile.sub: rubyw.exe should be a Windows GUI program. - add the -aa option to WLDFLAGS. - -Fri Aug 8 11:29:26 2003 Koji Arai <jca02266@nifty.ne.jp> - - * marshal.c (w_object): should set `c_arg' at first. - -Fri Aug 8 03:22:28 2003 GOTOU Yuuzou <gotoyuzo@notwork.org> - - * lib/webrick/httputils.rb (FormData#list): should not take - a side effect for the receiver. - -Thu Aug 7 14:40:37 2003 WATANABE Hirofumi <eban@ruby-lang.org> - - * cygwin/GNUmakefile: better --disbale-shared option support. - - * cygwin/GNUmakefile: add forwarding DLL target for cygwin. - -Thu Aug 7 14:21:05 2003 Corinna Vinschen <vinschen@redhat.com> - - * configure.in: Fix Cygwin specific naming of libraries to - be net distribution compliant. (ruby-bugs PR#1077) - cygwin-ruby18.dll -> cygruby18.dll - -Thu Aug 7 12:51:38 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c (rb_f_at_exit): should not be called without a block. - block_given check added. - -Thu Aug 7 06:46:06 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c (rb_call0): forgot to pop ruby_class. - - * eval.c (rb_call0): update ruby_class as well as ruby_cref. - (ruby-bugs-ja PR#540) - -Thu Aug 7 04:52:50 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c (rb_yield_0): remove ruby_frame->cbase and unify to - ruby_cref. [ruby-talk:78141] - -Thu Aug 7 04:19:15 2003 Akinori MUSHA <knu@iDaemons.org> - - * gc.c: FreeBSD/ia64's mcontext_t is a bit different from that of - Linux/ia64. This makes gc.c compile but miniruby coredumps for - the moment. - -Wed Aug 7 00:15:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org> - - * ext/bigdecimal.c: Comparison results adjusted to Float's. - * ext/bigdecimal.c: Use rb_num_coerce_????(x,y) instead of own. - -Wed Aug 6 22:58:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org> - - * lib/test/unit/testcase.rb: Added equality checking. - * lib/test/unit/testsuite.rb: Added equality checking. - * lib/test/unit/assertions.rb: Fixed a warning. - -Wed Aug 6 17:28:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * ext/extmk.rb (extmake): pass LIBPATH to make ruby. [ruby-dev:21137] - - * ext/extmk.rb (extmake): set library name as source file name in - Init_ext(). [ruby-dev:21137] - - * lib/mkmf.rb (Logging::postpone): postpone logging messages after - heading message as the result of the block. - - * lib/mkmf.rb (macro_defined?): append newline to src unless ended - with it. - - * lib/mkmf.rb (have_library): treat nil function name as "main". - (ruby-bugs:PR#1083) - - * lib/mkmf.rb (pkg_config): should append additional libraries to - $libs but not $LIBS. [ruby-dev:21137] - - * ext/io/wait/extconf.rb: check DOSISH macro instead of platform. - - * ext/digest/sha1/extconf.rb: have_library already appends library - name. - -Wed Aug 6 17:23:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c: initialize /* OK */ variables by Qnil to stop warnings. - -Wed Aug 6 04:58:32 2003 NAKAMURA Usaku <usa@ruby-lang.org> - - * ext/Setup*: add io/wait and openssl. - -Wed Aug 6 01:13:38 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * eval.c (rb_f_autoload): use ruby_cbase instead of ruby_class. - - * eval.c (rb_f_autoload_p): ditto. - - * class.c (rb_mod_init_copy): no longer implements independent - clone and dup methods. override "initialize_copy" instead. - [ruby-core:01352] - - * object.c (rb_class_s_alloc): define Class allocation function. - this makes Classes to follow clone framework that uses - initialize_copy. - - * object.c (rb_class_initialize): separate instantiation and - initialization. - - * object.c (rb_obj_alloc): prohibit instantiation from - uninitialized class. - - * object.c (rb_class_superclass): check uninitialized class. - - * array.c (rb_ary_fill): wrong index processing with block. this - fix was done by Koji Arai <JCA02266@nifty.ne.jp> [ruby-list:38029] - - * marshal.c (w_object): should preserve generic ivar for nil, - true, false, symbols, and fixnums. - - * marshal.c (w_uclass): base_klass check should be done after - rb_class_real(). - -Wed Aug 6 01:18:50 2003 Minero Aoki <aamine@loveruby.net> - - * lib/net/http.rb: update document. - - * lib/net/pop.rb: ditto. - - * lib/net/protocol.rb: ditto. - -Wed Aug 6 00:48:37 2003 Koji Arai <jca02266@nifty.ne.jp> - - * marshal.c (w_object): should recommend marshal_dump rather than - _dump_data. - -Tue Aug 5 17:58:57 2003 WATANABE Hirofumi <eban@ruby-lang.org> - - * lib/fileutils.rb (install): should preserve timestamp only. - -Tue Aug 5 17:31:59 2003 Ian Macdonald <ian@caliban.org> - - * lib/shell/command-processor.rb (Shell::CommandProcessor::rmdir): - simple typo. - -Tue Aug 5 15:47:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * eval.c (rb_load): should preserve current source file/line. - -Tue Aug 5 10:04:42 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * string.c (str_new4): ptr may refer null_str. - -Mon Aug 4 17:25:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org> - - * stable version 1.8.0 released. - -For the changes before 1.8.0, see doc/ChangeLog-1.8.0 - -Local variables: -add-log-time-format: (lambda () - (let* ((time (current-time)) - (diff (+ (cadr time) 32400)) - (lo (% diff 65536)) - (hi (+ (car time) (/ diff 65536)))) - (format-time-string "%a %b %e %H:%M:%S %Y" (list hi lo) t))) -indent-tabs-mode: t -tab-width: 8 -end: @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE + + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -225,7 +225,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. @@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names: This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff --git a/KNOWNBUGS.rb b/KNOWNBUGS.rb new file mode 100644 index 0000000000..35a8e75876 --- /dev/null +++ b/KNOWNBUGS.rb @@ -0,0 +1,7 @@ +# +# IMPORTANT: Always keep the first 7 lines (comments), +# even if this file is otherwise empty. +# +# This test file includes tests which point out known bugs. +# So all tests will cause failure. +# @@ -1,61 +1,331 @@ -LEGAL NOTICE INFORMATION ------------------------- +# -*- rdoc -*- + += LEGAL NOTICE INFORMATION +-------------------------- All the files in this distribution are covered under either the Ruby's license (see the file COPYING) or public-domain except some files mentioned below. -regex.[ch]: +[addr2line.c] - These files are under LGPL. Treat them as LGPL says. (See the file - LGPL for details) + A part of this file is from FreeBSD. - Extended regular expression matching and search library. - Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc. + >>> + Copyright (c) 1986, 1988, 1991, 1993:: + The Regents of the University of California. All rights reserved. - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + (c) UNIX System Laboratories, Inc. - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + All or some portions of this file are derived from material licensed + to the University of California by American Telephone and Telegraph + Co. or Unix System Laboratories, Inc. and are reproduced herein with + the permission of UNIX System Laboratories, Inc. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 + + +[ccan/build_assert/build_assert.h] +[ccan/check_type/check_type.h] +[ccan/container_of/container_of.h] +[ccan/str/str.h] + + These files are licensed under the {CC0}[https://creativecommons.org/choose/zero/]. + +[ccan/list/list.h] + + This file is licensed under the {MIT License}[rdoc-ref:@MIT+License]. + +[coroutine] + + Unless otherwise specified, these files are licensed under the + {MIT License}[rdoc-ref:@MIT+License]. + +[include/ruby/onigmo.h] +[include/ruby/oniguruma.h] +[regcomp.c] +[regenc.c] +[regenc.h] +[regerror.c] +[regexec.c] +[regint.h] +[regparse.c] +[regparse.h] +[enc/ascii.c] +[enc/big5.c] +[enc/cp949.c] +[enc/emacs_mule.c] +[enc/encdb.c] +[enc/euc_jp.c] +[enc/euc_kr.c] +[enc/euc_tw.c] +[enc/gb18030.c] +[enc/gb2312.c] +[enc/gbk.c] +[enc/iso_8859_1.c] +[enc/iso_8859_10.c] +[enc/iso_8859_11.c] +[enc/iso_8859_13.c] +[enc/iso_8859_14.c] +[enc/iso_8859_15.c] +[enc/iso_8859_16.c] +[enc/iso_8859_2.c] +[enc/iso_8859_3.c] +[enc/iso_8859_4.c] +[enc/iso_8859_5.c] +[enc/iso_8859_6.c] +[enc/iso_8859_7.c] +[enc/iso_8859_8.c] +[enc/iso_8859_9.c] +[enc/koi8_r.c] +[enc/koi8_u.c] +[enc/shift_jis.c] +[enc/unicode.c] +[enc/us_ascii.c] +[enc/utf_16be.c] +[enc/utf_16le.c] +[enc/utf_32be.c] +[enc/utf_32le.c] +[enc/utf_8.c] +[enc/windows_1251.c] +[enc/windows_31j.c] + + Onigmo (Oniguruma-mod) LICENSE + + >>> + Copyright (c) 2002-2009:: K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + Copyright (c) 2011-2014:: K.Takata <kentkt AT csc DOT jp> + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + Oniguruma LICENSE + + >>> + Copyright (c) 2002-2009:: K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + * https://github.com/k-takata/Onigmo/ + * https://github.com/kkos/oniguruma + * https://svnweb.freebsd.org/ports/head/devel/oniguruma/ + + When this software is partly used or it is distributed with Ruby, + this of Ruby follows the license of Ruby. + +[enc/windows_1250.c] +[enc/windows_1252.c] + + >>> + Copyright (c) 2006-2007:: Byte <byte AT mail DOT kna DOT ru> + K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + All rights reserved. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file LGPL. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +[enc/cesu_8.c] +[enc/windows_1253.c] +[enc/windows_1254.c] +[enc/windows_1257.c] - Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto) - Last change: May 21, 1993 by t^2 - removed gapped buffer support, multiple syntax support by matz <matz@nts.co.jp> - Perl5 extension added by matz <matz@caelum.co.jp> - UTF-8 extension added Jan 16 1999 by Yoshida Masato <yoshidam@tau.bekkoame.ne.jp> + >>> + Copyright (c) 2002-2007:: K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. -configure: + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +[enc/trans/GB/GB12345%UCS.src] +[enc/trans/GB/UCS%GB12345.src] +[enc/trans/GB/GB2312%UCS.src] +[enc/trans/GB/UCS%GB2312.src] + + These files have this explanatory texts. + + >>> + This mapping data was created from files provided by Unicode, Inc. + (The Unicode Consortium). The files were used to create a product supporting + Unicode, as explicitly permitted in the files' copyright notices. + Please note that Unicode, Inc. never made any claims as to fitness of these + files for any particular purpose, and has ceased to publish the files many + years ago. + +[enc/trans/JIS/JISX0201-KANA%UCS.src] +[enc/trans/JIS/JISX0208\@1990%UCS.src] +[enc/trans/JIS/JISX0212%UCS.src] +[enc/trans/JIS/UCS%JISX0201-KANA.src] +[enc/trans/JIS/UCS%JISX0208@1990.src] +[enc/trans/JIS/UCS%JISX0212.src] + + These files are copyrighted as the following. + + >>> + © 2015 Unicode®, Inc. + + For terms of use, see http://www.unicode.org/terms_of_use.html + +[enc/trans/JIS/JISX0213-1%UCS@BMP.src] +[enc/trans/JIS/JISX0213-1%UCS@SIP.src] +[enc/trans/JIS/JISX0213-2%UCS@BMP.src] +[enc/trans/JIS/JISX0213-2%UCS@SIP.src] + + These files are copyrighted as the following. + + >>> + Copyright (C) 2001:: earthian@tama.or.jp, All Rights Reserved. + Copyright (C) 2001:: I'O, All Rights Reserved. + Copyright (C) 2006:: Project X0213, All Rights Reserved. + You can use, modify, distribute this table freely. + +[enc/trans/JIS/UCS@BMP%JISX0213-1.src] +[enc/trans/JIS/UCS@BMP%JISX0213-2.src] +[enc/trans/JIS/UCS@SIP%JISX0213-1.src] +[enc/trans/JIS/UCS@SIP%JISX0213-2.src] + + These files are copyrighted as the following. + + >>> + Copyright (C) 2001:: earthian@tama.or.jp, All Rights Reserved. + Copyright (C) 2001:: I'O, All Rights Reserved. + You can use, modify, distribute this table freely. + +[enc/trans/ucm/glibc-BIG5-2.3.3.ucm] +[enc/trans/ucm/glibc-BIG5HKSCS-2.3.3.ucm] + + >>> + Copyright (C) 2001-2005:: International Business Machines + Corporation and others. All Rights Reserved. + +[enc/trans/ucm/windows-950-2000.ucm] +[enc/trans/ucm/windows-950_hkscs-2001.ucm] + + >>> + Copyright (C) 2001-2002:: International Business Machines + Corporation and others. All Rights Reserved. + + +[configure] This file is free software. - Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. + >>> + Copyright (C) 1992-1996, 1998-2012:: Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -config.guess: -config.sub: -parse.c: +[tool/config.guess] +[tool/config.sub] As long as you distribute these files with the file configure, they are covered under the Ruby's license. - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 - Free Software Foundation, Inc. + >>> + Copyright 1992-2018:: Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but @@ -64,54 +334,165 @@ parse.c: General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + along with this program; if not, see <https://www.gnu.org/licenses/>. As a special exception to the GNU General Public License, if you distribute this file as part of a program that contains a configuration script generated by Autoconf, you may include it under - the same distribution terms that you use for the rest of that program. + the same distribution terms that you use for the rest of that + program. This Exception is an additional permission under section 7 + of the GNU General Public License, version 3 ("GPLv3"). + +[tool/lib/test/*] +[tool/lib/core_assertions.rb] + + Some of methods on these files are based on MiniTest 4. MiniTest 4 is + distributed under the MIT License. + + >>> + Copyright (c) Ryan Davis, seattle.rb + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + 'Software'), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +[parse.c] +[parse.h] + + These files are licensed under the GPL, but are incorporated into Ruby and + redistributed under the terms of the Ruby license, as permitted by the + exception to the GPL below. + + >>> + Copyright (C) 1984, 1989-1990, 2000-2015, 2018:: Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. + +[missing/dtoa.c] + + This file is under these licenses. -util.c (partly): -win32/win32.[ch]: + >>> + Copyright (c) 1991, 2000, 2001:: by Lucent Technologies. + + Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire notice + is included in all copies of any software which is or includes a copy + or modification of this software and in all copies of the supporting + documentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + + >>> + Copyright (c) 2004-2008:: David Schultz <das@FreeBSD.ORG> + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +[win32/win32.c] +[include/ruby/win32.h] You can apply the Artistic License to these files. (or GPL, alternatively) - Copyright (c) 1993, Intergraph Corporation + >>> + Copyright (c) 1993:: Intergraph Corporation You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the perl README file. -random.c +[missing/mt19937.c] This file is under the new-style BSD license. - A C-program for MT19937, with initialization improved 2002/2/10. + >>> + A C-program for MT19937, with initialization improved 2002/2/10.:: Coded by Takuji Nishimura and Makoto Matsumoto. + This is a faster version by taking Shawn Cokus's optimization, Matthe Bellew's simplification, Isaku Wada's real version. - Before using, initialize the state by using init_genrand(seed) + Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). - Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. + Copyright (C) 1997 - 2002:: Makoto Matsumoto and Takuji Nishimura, + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -130,72 +511,15 @@ random.c http://www.math.keio.ac.jp/matumoto/emt.html email: matumoto@math.keio.ac.jp -st.[ch]: -x68/*: -missing/alloca.c: -missing/dup2.c: -missing/erf.c: -missing/finite.c: -missing/hypot.c: -missing/isinf.c: -missing/isnan.c: -missing/memcmp.c: -missing/memmove.c: -missing/mkdir.c: -missing/strcasecmp.c: -missing/strchr.c: -missing/streror.c: -missing/strftime.c: -missing/strncasecmp.c: -missing/strstr.c: -missing/strtol.c: -ext/digest/sha1/sha1.[ch]: - - These files are all under public domain. - -missing/strtod.c: - - This file will not be used on most platforms depending on how the - configure script results. In any case you must not receive any fee - with the file itself. - - Copyright (c) 1988-1993 The Regents of the University of California. - Copyright (c) 1994 Sun Microsystems, Inc. - - Permission to use, copy, modify, and distribute this - software and its documentation for any purpose and without - fee is hereby granted, provided that the above copyright - notice appear in all copies. The University of California - makes no representations about the suitability of this - software for any purpose. It is provided "as is" without - express or implied warranty. - -missing/strtoul.c: + The Wayback Machine url: http://web.archive.org/web/19990429082237/http://www.math.keio.ac.jp/matumoto/emt.html - This file will not be used on most platforms depending on how the - configure script results. In any case you must not receive any fee - with the file itself. +[missing/procstat_vm.c] - Copyright 1988 Regents of the University of California - - Permission to use, copy, modify, and distribute this - software and its documentation for any purpose and without - fee is hereby granted, provided that the above copyright - notice appear in all copies. The University of California - makes no representations about the suitability of this - software for any purpose. It is provided "as is" without - express or implied warranty. - -missing/vsnprintf.c: - - This file is under the old-style BSD license. Note that the - paragraph 3 below is now null and void. + This file is under the new-style BSD license. - Copyright (c) 1990, 1993 - The Regents of the University of California. All rights reserved. - - This code is derived from software contributed to Berkeley by - Chris Torek. + >>> + Copyright (c) 2007:: Robert N. M. Watson + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -205,18 +529,11 @@ missing/vsnprintf.c: 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. - 4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -225,17 +542,100 @@ missing/vsnprintf.c: OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - IMPORTANT NOTE: - -------------- - From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change - paragraph 3 above is now null and void. + $FreeBSD: head/usr.bin/procstat/procstat_vm.c 261780 2014-02-11 21:57:37Z jhb $ + +[vsnprintf.c] + + This file is under the {old-style BSD license}[rdoc-ref:@Old-style+BSD+license]. + + >>> + Copyright (c) 1990, 1993:: + The Regents of the University of California. All rights reserved. + + This code is derived from software contributed to Berkeley by + Chris Torek. + +[st.c] +[strftime.c] +[include/ruby/st.h] +[missing/acosh.c] +[missing/alloca.c] +[missing/erf.c] +[missing/hypot.c] +[missing/lgamma_r.c] +[missing/memcmp.c] +[missing/memmove.c] +[missing/strchr.c] +[missing/strerror.c] +[missing/strstr.c] +[missing/tgamma.c] +[ext/date/date_strftime.c] +[ext/digest/sha1/sha1.c] +[ext/digest/sha1/sha1.h] + + These files are all under public domain. + +[missing/crypt.c] + + This file is under the {old-style BSD license}[rdoc-ref:@Old-style+BSD+license]. + + >>> + Copyright (c) 1989, 1993:: + The Regents of the University of California. All rights reserved. + + This code is derived from software contributed to Berkeley by + Tom Truscott. + +[missing/setproctitle.c] + + This file is under the {old-style BSD license}[rdoc-ref:@Old-style+BSD+license]. -ext/digest/md5/md5.[ch]: + >>> + Copyright 2003:: Damien Miller + Copyright (c) 1983, 1995-1997:: Eric P. Allman + Copyright (c) 1988, 1993:: + The Regents of the University of California. All rights reserved. + +[missing/strlcat.c] +[missing/strlcpy.c] + + These files are under an ISC-style license. + + >>> + Copyright (c) 1998, 2015:: Todd C. Miller <Todd.Miller@courtesan.com> + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +[missing/langinfo.c] + + This file is from http://www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c. + Ruby uses a modified version. The file contains the following + author/copyright notice: + + >>> + Markus.Kuhn@cl.cam.ac.uk -- 2002-03-11:: + Permission to use, copy, modify, and distribute this software + for any purpose and without fee is hereby granted. The author + disclaims all warranties with regard to this software. + +[ext/digest/md5/md5.c] +[ext/digest/md5/md5.h] These files are under the following license. Ruby uses modified versions of them. - Copyright (C) 1999, 2000 Aladdin Enterprises. All rights reserved. + >>> + Copyright (C) 1999, 2000:: Aladdin Enterprises. All rights reserved. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -256,34 +656,27 @@ ext/digest/md5/md5.[ch]: L. Peter Deutsch ghost@aladdin.com -ext/digest/rmd160/rmd160.[ch]: +[ext/digest/rmd160/rmd160.c] +[ext/digest/rmd160/rmd160.h] These files have the following copyright information, and by the author we are allowed to use it under the new-style BSD license. - AUTHOR: Antoon Bosselaers, ESAT-COSIC + >>> + AUTHOR:: Antoon Bosselaers, ESAT-COSIC (Arranged for libc by Todd C. Miller) - DATE: 1 March 1996 + DATE:: 1 March 1996 - Copyright (c) Katholieke Universiteit Leuven + Copyright (c):: Katholieke Universiteit Leuven 1996, All Rights Reserved -ext/digest/rmd160/rmd160hl.c: -ext/digest/sha1/sha1hl.c: - - These files are under the beer-ware license. - - "THE BEER-WARE LICENSE" (Revision 42): - <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you - can do whatever you want with this stuff. If we meet some day, and you think - this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - -ext/digest/sha2/sha2.[ch]: -ext/digest/sha2/sha2hl.c: +[ext/digest/sha2/sha2.c] +[ext/digest/sha2/sha2.h] These files are under the new-style BSD license. - Copyright 2000 Aaron D. Gifford. All rights reserved. + >>> + Copyright 2000:: Aaron D. Gifford. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -309,26 +702,71 @@ ext/digest/sha2/sha2hl.c: OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -ext/nkf/nkf1.7/nkf.c: +[ext/json/vendor/fpconv.c] + + This file is under the {Boost Software License}[rdoc-ref:@Boost+Software+License+1.0]. + +[ext/json/vendor/jeaiii-ltoa.h] + + >>> + Copyright (c) 2024,2025 Enrico Thierbach - https://github.com/radiospiel + Copyright (c) 2022 James Edward Anhalt III - https://github.com/jeaiii/itoa + + {MIT License}[rdoc-ref:@MIT+License] + +[ext/json/vendor/ryu.h] + This file is adapted from the Ryu algorithm by Ulf Adams https://github.com/ulfjack/ryu. + It is dual-licensed under {Apache License 2.0}[rdoc-ref:@Apache+License+2.0] OR + {Boost Software License 1.0}[rdoc-ref:@Boost+Software+License+1.0]. + +[ext/psych] +[test/psych] - This file is under the following license. So to speak, it is - copyrighted semi-public-domain software. + The files under these directories are under the following license. - Copyright (C) 1987, Fujitsu LTD. (Itaru ICHIKAWA) - Everyone is permitted to do anything on this program - including copying, modifying, improving. - as long as you don't try to pretend that you wrote it. - i.e., the above copyright notice has to appear in all copies. - You don't have to ask before copying or publishing. - THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. + >>> + Copyright 2009:: Aaron Patterson, et al. -ext/socket/addrinfo.h: -ext/socket/getaddrinfo.c: -ext/socket/getnameinfo.c: + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the 'Software'), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do + so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +[ext/pty/pty.c] + + >>> + C) Copyright 1998:: by Akinori Ito. + + This software may be redistributed freely for this purpose, in full + or in part, provided that this entire copyright notice is included + on any copies of this software and applications and derivations thereof. + + This software is provided on an "as is" basis, without warranty of any + kind, either expressed or implied, as to any matter including, but not + limited to warranty of fitness of purpose, or merchantability, or + results obtained from use of this software. + +[ext/socket/addrinfo.h] +[ext/socket/getaddrinfo.c] +[ext/socket/getnameinfo.c] These files are under the new-style BSD license. - Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. + >>> + Copyright (C) 1995, 1996, 1997, 1998, and 1999:: WIDE Project. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -355,17 +793,508 @@ ext/socket/getnameinfo.c: OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -ext/win32ole/win32ole.c: +[ext/win32ole/win32ole.c] You can apply the Artistic License to this file. (or GPL, alternatively) - (c) 1995 Microsoft Corporation. All rights reserved. + >>> + (c) 1995:: Microsoft Corporation. All rights reserved. Developed by ActiveWare Internet Corp., http://www.ActiveWare.com - Other modifications Copyright (c) 1997, 1998 by Gurusamy Sarathy + Other modifications Copyright (c) 1997, 1998:: by Gurusamy Sarathy <gsar@umich.edu> and Jan Dubois <jan.dubois@ibm.net> - + You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the README file of the Perl distribution. + + The Wayback Machine url: http://web.archive.org/web/19970607104352/http://www.activeware.com:80/ + +[lib/rdoc/generator/template/darkfish/css/fonts.css] + + This file is licensed under the {SIL Open Font License}[http://scripts.sil.org/OFL]. + +[spec/mspec] +[spec/ruby] + + The files under these directories are under the following license. + + >>> + Copyright (c) 2008:: Engine Yard, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +[lib/rubygems.rb] +[lib/rubygems] +[test/rubygems] + + RubyGems is under the following license. + + >>> + RubyGems is copyrighted free software by Chad Fowler, Rich Kilmer, Jim + Weirich and others. You can redistribute it and/or modify it under + either the terms of the {MIT license}[rdoc-ref:@MIT+License], or the conditions + below: + + 1. You may make and give away verbatim copies of the source form of the + software without restriction, provided that you duplicate all of the + original copyright notices and associated disclaimers. + + 2. You may modify your copy of the software in any way, provided that + you do at least ONE of the following: + + a. place your modifications in the Public Domain or otherwise + make them Freely Available, such as by posting said + modifications to Usenet or an equivalent medium, or by allowing + the author to include your modifications in the software. + + b. use the modified software only within your corporation or + organization. + + c. give non-standard executables non-standard names, with + instructions on where to get the original software distribution. + + d. make other distribution arrangements with the author. + + 3. You may distribute the software in object code or executable + form, provided that you do at least ONE of the following: + + a. distribute the executables and library files of the software, + together with instructions (in the manual page or equivalent) + on where to get the original distribution. + + b. accompany the distribution with the machine-readable source of + the software. + + c. give non-standard executables non-standard names, with + instructions on where to get the original software distribution. + + d. make other distribution arrangements with the author. + + 4. You may modify and include the part of the software into any other + software (possibly commercial). + + 5. The scripts and library files supplied as input to or produced as + output from the software do not automatically fall under the + copyright of the software, but belong to whomever generated them, + and may be sold commercially, and may be aggregated with this + software. + + 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. + +[lib/bundler] +[lib/bundler.rb] +[spec/bundler] + + Bundler is under the following license. + + >>> + Portions copyright (c) 2010:: Andre Arko + Portions copyright (c) 2009:: Engine Yard + + {MIT License}[rdoc-ref:@MIT+License] + +[lib/bundler/vendor/thor] + + Thor is under the following license. + + >>> + Copyright (c) 2008 Yehuda Katz, Eric Hodel, et al. + + {MIT License}[rdoc-ref:@MIT+License] + +[lib/rubygems/vendor/molinillo] + + molinillo is under the following license. + + >>> + Copyright (c) 2014 Samuel E. Giddins segiddins@segiddins.me + + {MIT License}[rdoc-ref:@MIT+License] + +[lib/bundler/vendor/pub_grub] + + pub_grub is under the following license. + + >>> + Copyright (c) 2018 John Hawthorn + + {MIT License}[rdoc-ref:@MIT+License] + +[lib/bundler/vendor/connection_pool] + + connection_pool is under the following license. + + >>> + Copyright (c) 2011 Mike Perham + + {MIT License}[rdoc-ref:@MIT+License] + +[lib/bundler/vendor/net-http-persistent] + + net-http-persistent is under the following license. + + >>> + Copyright (c) Eric Hodel, Aaron Patterson + + {MIT License}[rdoc-ref:@MIT+License] + +[lib/did_you_mean] +[lib/did_you_mean.rb] +[test/did_you_mean] + + did_you_mean is under the following license. + + >>> + Copyright (c) 2014-2016 Yuki Nishijima + + {MIT License}[rdoc-ref:@MIT+License] + +[lib/error_highlight] +[lib/error_highlight.rb] +[test/error_highlight] + + error_highlight is under the following license. + + >>> + Copyright (c) 2021 Yusuke Endoh + + {MIT License}[rdoc-ref:@MIT+License] + +[benchmark/so_ackermann.rb] +[benchmark/so_array.rb] +[benchmark/so_binary_trees.rb] +[benchmark/so_concatenate.rb] +[benchmark/so_count_words.yml] +[benchmark/so_exception.rb] +[benchmark/so_fannkuch.rb] +[benchmark/so_fasta.rb] +[benchmark/so_k_nucleotide.yml] +[benchmark/so_lists.rb] +[benchmark/so_mandelbrot.rb] +[benchmark/so_matrix.rb] +[benchmark/so_meteor_contest.rb] +[benchmark/so_nbody.rb] +[benchmark/so_nested_loop.rb] +[benchmark/so_nsieve.rb] +[benchmark/so_nsieve_bits.rb] +[benchmark/so_object.rb] +[benchmark/so_partial_sums.rb] +[benchmark/so_pidigits.rb] +[benchmark/so_random.rb] +[benchmark/so_reverse_complement.yml] +[benchmark/so_sieve.rb] +[benchmark/so_spectralnorm.rb] + + These files are very old copy of then-called "The Great Computer Language + Shootout". LEGAL SITUATION OF THESE FILES ARE UNCLEAR because the original + site has been lost. Upstream diverged to delete several benchmarks listed + above. + +== MIT License +>>> + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +== Old-style BSD license +>>> + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + IMPORTANT NOTE:: + + From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change + paragraph 3 above is now null and void. + +== Boost Software License 1.0 + +>>> + Boost Software License - Version 1.0 - August 17th, 2003 + + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +== Apache License 2.0 + +>>> + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + a. You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + b. You must cause any modified files to carry prominent notices + stating that You changed the files; and + + c. You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + d. If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + >>> + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index 78af741762..0000000000 --- a/MANIFEST +++ /dev/null @@ -1,519 +0,0 @@ -COPYING -COPYING.ja -ChangeLog -GPL -LEGAL -LGPL -MANIFEST -Makefile.in -README -README.ja -README.EXT -README.EXT.ja -ToDo -array.c -bignum.c -class.c -compar.c -configure -configure.in -config.guess -config.sub -defines.h -dir.c -dln.c -dln.h -dmyext.c -enum.c -env.h -error.c -eval.c -file.c -gc.c -hash.c -inits.c -install-sh -instruby.rb -intern.h -io.c -keywords -lex.c -main.c -marshal.c -math.c -mdoc2man.rb -missing.h -mkconfig.rb -node.h -numeric.c -object.c -pack.c -parse.c -parse.y -prec.c -process.c -random.c -range.c -re.c -re.h -regex.c -regex.h -ruby.1 -ruby.c -ruby.h -rubyio.h -rubysig.h -rubytest.rb -signal.c -sprintf.c -st.c -st.h -string.c -struct.c -time.c -util.h -util.c -variable.c -version.c -version.h -bcc32/Makefile.sub -bcc32/README.bcc32 -bcc32/configure.bat -bcc32/mkexports.rb -bcc32/setup.mak -bin/erb -bin/irb -cygwin/GNUmakefile.in -djgpp/GNUmakefile.in -djgpp/README.djgpp -djgpp/config.hin -djgpp/config.sed -djgpp/configure.bat -djgpp/mkver.sed -doc/ChangeLog-1.8.0 -doc/NEWS -doc/forwardable.rd -doc/forwardable.rd.ja -doc/irb/irb-tools.rd.ja -doc/irb/irb.rd -doc/irb/irb.rd.ja -doc/shell.rd -doc/shell.rd.ja -ext/Setup -ext/Setup.atheos -ext/Setup.dj -ext/Setup.emx -ext/Setup.nt -ext/Setup.x68 -ext/extmk.rb -lib/English.rb -lib/Env.rb -lib/README -lib/base64.rb -lib/benchmark.rb -lib/cgi-lib.rb -lib/cgi.rb -lib/cgi/session.rb -lib/cgi/session/pstore.rb -lib/complex.rb -lib/csv.rb -lib/date.rb -lib/date/format.rb -lib/date2.rb -lib/debug.rb -lib/delegate.rb -lib/drb.rb -lib/drb/drb.rb -lib/drb/eq.rb -lib/drb/extserv.rb -lib/drb/extservm.rb -lib/drb/gw.rb -lib/drb/invokemethod.rb -lib/drb/observer.rb -lib/drb/timeridconv.rb -lib/drb/unix.rb -lib/e2mmap.rb -lib/erb.rb -lib/eregex.rb -lib/fileutils.rb -lib/finalize.rb -lib/find.rb -lib/forwardable.rb -lib/ftools.rb -lib/getoptlong.rb -lib/getopts.rb -lib/gserver.rb -lib/importenv.rb -lib/ipaddr.rb -lib/irb.rb -lib/irb/cmd/chws.rb -lib/irb/cmd/fork.rb -lib/irb/cmd/load.rb -lib/irb/cmd/nop.rb -lib/irb/cmd/pushws.rb -lib/irb/cmd/subirb.rb -lib/irb/completion.rb -lib/irb/context.rb -lib/irb/ext/change-ws.rb -lib/irb/ext/history.rb -lib/irb/ext/loader.rb -lib/irb/ext/math-mode.rb -lib/irb/ext/multi-irb.rb -lib/irb/ext/tracer.rb -lib/irb/ext/use-loader.rb -lib/irb/ext/workspaces.rb -lib/irb/extend-command.rb -lib/irb/frame.rb -lib/irb/help.rb -lib/irb/init.rb -lib/irb/input-method.rb -lib/irb/lc/error.rb -lib/irb/lc/help-message -lib/irb/lc/ja/error.rb -lib/irb/lc/ja/help-message -lib/irb/locale.rb -lib/irb/ruby-lex.rb -lib/irb/ruby-token.rb -lib/irb/slex.rb -lib/irb/version.rb -lib/irb/workspace.rb -lib/irb/ws-for-case-2.rb -lib/irb/xmp.rb -lib/jcode.rb -lib/mailread.rb -lib/mathn.rb -lib/matrix.rb -lib/mkmf.rb -lib/monitor.rb -lib/mutex_m.rb -lib/net/ftp.rb -lib/net/http.rb -lib/net/imap.rb -lib/net/pop.rb -lib/net/protocol.rb -lib/net/smtp.rb -lib/net/telnet.rb -lib/observer.rb -lib/open-uri.rb -lib/open3.rb -lib/optparse.rb -lib/optparse/date.rb -lib/optparse/shellwords.rb -lib/optparse/time.rb -lib/optparse/uri.rb -lib/ostruct.rb -lib/parsearg.rb -lib/parsedate.rb -lib/pathname.rb -lib/ping.rb -lib/pp.rb -lib/prettyprint.rb -lib/profile.rb -lib/profiler.rb -lib/pstore.rb -lib/racc/parser.rb -lib/rational.rb -lib/readbytes.rb -lib/resolv-replace.rb -lib/resolv.rb -lib/rubyunit.rb -lib/runit/assert.rb -lib/runit/cui/testrunner.rb -lib/runit/error.rb -lib/runit/testcase.rb -lib/runit/testresult.rb -lib/runit/testsuite.rb -lib/runit/topublic.rb -lib/scanf.rb -lib/set.rb -lib/shell.rb -lib/shell/builtin-command.rb -lib/shell/command-processor.rb -lib/shell/error.rb -lib/shell/filter.rb -lib/shell/process-controller.rb -lib/shell/system-command.rb -lib/shell/version.rb -lib/shellwords.rb -lib/singleton.rb -lib/sync.rb -lib/tempfile.rb -lib/test/unit.rb -lib/test/unit/assertionfailederror.rb -lib/test/unit/assertions.rb -lib/test/unit/error.rb -lib/test/unit/failure.rb -lib/test/unit/testcase.rb -lib/test/unit/testresult.rb -lib/test/unit/testsuite.rb -lib/test/unit/ui/console/testrunner.rb -lib/test/unit/ui/fox/testrunner.rb -lib/test/unit/ui/gtk/testrunner.rb -lib/test/unit/ui/testrunnermediator.rb -lib/test/unit/ui/testrunnerutilities.rb -lib/test/unit/util/observable.rb -lib/test/unit/util/procwrapper.rb -lib/thread.rb -lib/thwait.rb -lib/time.rb -lib/timeout.rb -lib/tmpdir.rb -lib/tracer.rb -lib/tsort.rb -lib/un.rb -lib/uri.rb -lib/uri/common.rb -lib/uri/ftp.rb -lib/uri/generic.rb -lib/uri/http.rb -lib/uri/https.rb -lib/uri/ldap.rb -lib/uri/mailto.rb -lib/weakref.rb -lib/rexml/dtd/attlistdecl.rb -lib/rexml/dtd/dtd.rb -lib/rexml/dtd/elementdecl.rb -lib/rexml/dtd/entitydecl.rb -lib/rexml/dtd/notationdecl.rb -lib/rexml/attlistdecl.rb -lib/rexml/attribute.rb -lib/rexml/cdata.rb -lib/rexml/child.rb -lib/rexml/comment.rb -lib/rexml/doctype.rb -lib/rexml/document.rb -lib/rexml/element.rb -lib/rexml/encoding.rb -lib/rexml/entity.rb -lib/rexml/functions.rb -lib/rexml/instruction.rb -lib/rexml/namespace.rb -lib/rexml/node.rb -lib/rexml/output.rb -lib/rexml/parent.rb -lib/rexml/parseexception.rb -lib/rexml/quickpath.rb -lib/rexml/rexml.rb -lib/rexml/sax2listener.rb -lib/rexml/source.rb -lib/rexml/streamlistener.rb -lib/rexml/text.rb -lib/rexml/xmldecl.rb -lib/rexml/xmltokens.rb -lib/rexml/xpath.rb -lib/rexml/xpath_parser.rb -lib/rexml/encodings/EUC-JP.rb -lib/rexml/encodings/EUC-JP_decl.rb -lib/rexml/encodings/ISO-8859-1.rb -lib/rexml/encodings/ISO-8859-1_decl.rb -lib/rexml/encodings/SHIFT-JIS.rb -lib/rexml/encodings/SHIFT_JIS.rb -lib/rexml/encodings/Shift-JIS_decl.rb -lib/rexml/encodings/UNILE.rb -lib/rexml/encodings/UNILE_decl.rb -lib/rexml/encodings/US-ASCII.rb -lib/rexml/encodings/US-ASCII_decl.rb -lib/rexml/encodings/UTF-16.rb -lib/rexml/encodings/UTF-16_decl.rb -lib/rexml/light/node.rb -lib/rexml/parsers/baseparser.rb -lib/rexml/parsers/lightparser.rb -lib/rexml/parsers/pullparser.rb -lib/rexml/parsers/sax2parser.rb -lib/rexml/parsers/streamparser.rb -lib/rexml/parsers/ultralightparser.rb -lib/rexml/parsers/xpathparser.rb -lib/webrick.rb -lib/webrick/httpauth/authenticator.rb -lib/webrick/httpauth/basicauth.rb -lib/webrick/httpauth/digestauth.rb -lib/webrick/httpauth/htdigest.rb -lib/webrick/httpauth/htgroup.rb -lib/webrick/httpauth/htpasswd.rb -lib/webrick/httpauth/userdb.rb -lib/webrick/httpservlet/abstract.rb -lib/webrick/httpservlet/cgi_runner.rb -lib/webrick/httpservlet/erbhandler.rb -lib/webrick/httpservlet/filehandler.rb -lib/webrick/httpservlet/prochandler.rb -lib/webrick/httpservlet/cgihandler.rb -lib/webrick/accesslog.rb -lib/webrick/cookie.rb -lib/webrick/htmlutils.rb -lib/webrick/httpauth.rb -lib/webrick/httpproxy.rb -lib/webrick/httprequest.rb -lib/webrick/httpresponse.rb -lib/webrick/https.rb -lib/webrick/httpserver.rb -lib/webrick/httpservlet.rb -lib/webrick/httpstatus.rb -lib/webrick/httputils.rb -lib/webrick/httpversion.rb -lib/webrick/log.rb -lib/webrick/server.rb -lib/webrick/utils.rb -lib/webrick/version.rb -lib/webrick/compat.rb -lib/webrick/config.rb -lib/xmlrpc/base64.rb -lib/xmlrpc/client.rb -lib/xmlrpc/config.rb -lib/xmlrpc/create.rb -lib/xmlrpc/datetime.rb -lib/xmlrpc/httpserver.rb -lib/xmlrpc/marshal.rb -lib/xmlrpc/parser.rb -lib/xmlrpc/server.rb -lib/xmlrpc/utils.rb -lib/yaml.rb -lib/yaml/baseemitter.rb -lib/yaml/basenode.rb -lib/yaml/constants.rb -lib/yaml/dbm.rb -lib/yaml/emitter.rb -lib/yaml/encoding.rb -lib/yaml/error.rb -lib/yaml/loader.rb -lib/yaml/rubytypes.rb -lib/yaml/store.rb -lib/yaml/stream.rb -lib/yaml/stringio.rb -lib/yaml/syck.rb -lib/yaml/types.rb -lib/yaml/yamlnode.rb -lib/yaml/ypath.rb -misc/README -misc/inf-ruby.el -misc/ruby-mode.el -misc/rubydb2x.el -misc/rubydb3x.el -missing/acosh.c -missing/alloca.c -missing/crypt.c -missing/dup2.c -missing/erf.c -missing/file.h -missing/fileblocks.c -missing/finite.c -missing/flock.c -missing/hypot.c -missing/isinf.c -missing/isnan.c -missing/memcmp.c -missing/memmove.c -missing/mkdir.c -missing/os2.c -missing/strcasecmp.c -missing/strchr.c -missing/strerror.c -missing/strftime.c -missing/strncasecmp.c -missing/strstr.c -missing/strtod.c -missing/strtol.c -missing/strtoul.c -missing/vsnprintf.c -missing/x68.c -sample/README -sample/biorhythm.rb -sample/cal.rb -sample/cbreak.rb -sample/clnt.rb -sample/dbmtest.rb -sample/dir.rb -sample/dualstack-fetch.rb -sample/dualstack-httpd.rb -sample/eval.rb -sample/export.rb -sample/exyacc.rb -sample/fact.rb -sample/fib.awk -sample/fib.pl -sample/fib.py -sample/fib.rb -sample/fib.scm -sample/freq.rb -sample/from.rb -sample/fullpath.rb -sample/getopts.test -sample/goodfriday.rb -sample/less.rb -sample/list.rb -sample/list2.rb -sample/list3.rb -sample/mine.rb -sample/mkproto.rb -sample/mpart.rb -sample/mrshtest.rb -sample/observ.rb -sample/occur.pl -sample/occur.rb -sample/occur2.rb -sample/philos.rb -sample/pi.rb -sample/rcs.awk -sample/rcs.dat -sample/rcs.rb -sample/regx.rb -sample/sieve.rb -sample/svr.rb -sample/test.rb -sample/time.rb -sample/trojan.rb -sample/tsvr.rb -sample/uumerge.rb -vms/config.h_in -vms/vms.h -win32/Makefile.sub -win32/README.win32 -win32/configure.bat -win32/dir.h -win32/mkexports.rb -win32/resource.rb -win32/setup.mak -win32/win32.c -win32/win32.h -win32/winmain.c -x68/_dtos18.c -x68/_round.c -x68/fconvert.c -x68/select.c -wince/Makefile.sub -wince/README.wince -wince/assert.c -wince/assert.h -wince/configure.bat -wince/direct.c -wince/direct.h -wince/errno.c -wince/errno.h -wince/fcntl.h -wince/io.h -wince/io_wce.c -wince/mkexports.rb -wince/process.h -wince/process_wce.c -wince/resource.rb -wince/setup.mak -wince/signal.h -wince/signal_wce.c -wince/stddef.h -wince/stdio.c -wince/stdlib.c -wince/string_wce.c -wince/sys/stat.c -wince/sys/stat.h -wince/sys/timeb.c -wince/sys/timeb.h -wince/sys/types.h -wince/sys/utime.c -wince/sys/utime.h -wince/time.h -wince/time_wce.c -wince/varargs.h -wince/wince.c -wince/wince.h -wince/wincemain.c -wince/wincon.h -wince/winsock2.c diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 26c2bb820b..0000000000 --- a/Makefile.in +++ /dev/null @@ -1,364 +0,0 @@ -SHELL = /bin/sh - -#### Start of system configuration section. #### - -srcdir = @srcdir@ -VPATH = $(srcdir):$(srcdir)/missing - -CC = @CC@ -YACC = @YACC@ -PURIFY = -AUTOCONF = autoconf -@SET_MAKE@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -sbindir = @sbindir@ -libdir = @libdir@ -libexecdir = @libexecdir@ -arch = @arch@ -sitearch = @sitearch@ -sitedir = @sitedir@ - -CFLAGS = @CFLAGS@ @XCFLAGS@ -CPPFLAGS = -I. -I$(srcdir) -LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ -EXTLDFLAGS = -XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS) -EXTLIBS = -LIBS = @LIBS@ $(EXTLIBS) -MISSING = @LIBOBJS@ @ALLOCA@ -LDSHARED = @LIBRUBY_LDSHARED@ -DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) -SOLIBS = @SOLIBS@ -MAINLIBS = @MAINLIBS@ - -RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@ -RUBY_SO_NAME=@RUBY_SO_NAME@ -EXEEXT = @EXEEXT@ -PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) -RUBY = $(RUBY_INSTALL_NAME) -MINIRUBY = @MINIRUBY@ - -#### End of system configuration section. #### - -MAJOR= @MAJOR@ -MINOR= @MINOR@ -TEENY= @TEENY@ - -LIBRUBY_A = @LIBRUBY_A@ -LIBRUBY_SO = @LIBRUBY_SO@ -LIBRUBY_ALIASES= @LIBRUBY_ALIASES@ -LIBRUBY = @LIBRUBY@ -LIBRUBYARG = @LIBRUBYARG@ -LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@ -LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@ - -PREP = @PREP@ @ARCHFILE@ -SETUP = -EXTSTATIC = @EXTSTATIC@ - -EXTOBJS = -DLDOBJS = $(DMYEXT) -DMYEXT = dmyext.@OBJEXT@ - -MAINOBJ = main.@OBJEXT@ - -OBJS = array.@OBJEXT@ \ - bignum.@OBJEXT@ \ - class.@OBJEXT@ \ - compar.@OBJEXT@ \ - dir.@OBJEXT@ \ - dln.@OBJEXT@ \ - enum.@OBJEXT@ \ - error.@OBJEXT@ \ - eval.@OBJEXT@ \ - file.@OBJEXT@ \ - gc.@OBJEXT@ \ - hash.@OBJEXT@ \ - inits.@OBJEXT@ \ - io.@OBJEXT@ \ - marshal.@OBJEXT@ \ - math.@OBJEXT@ \ - numeric.@OBJEXT@ \ - object.@OBJEXT@ \ - pack.@OBJEXT@ \ - parse.@OBJEXT@ \ - process.@OBJEXT@ \ - prec.@OBJEXT@ \ - random.@OBJEXT@ \ - range.@OBJEXT@ \ - re.@OBJEXT@ \ - regex.@OBJEXT@ \ - ruby.@OBJEXT@ \ - signal.@OBJEXT@ \ - sprintf.@OBJEXT@ \ - st.@OBJEXT@ \ - string.@OBJEXT@ \ - struct.@OBJEXT@ \ - time.@OBJEXT@ \ - util.@OBJEXT@ \ - variable.@OBJEXT@ \ - version.@OBJEXT@ \ - $(MISSING) - -MANTYPE = @MANTYPE@ - -SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \ - --make="$(MAKE)" \ - --mflags="$(MFLAGS)" \ - --make-flags="$(MAKEFLAGS)" - -all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY) - @$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic="$(EXTSTATIC)" $(SCRIPT_ARGS) - -miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(DMYEXT) - @rm -f $@ - $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(DMYEXT) $(LIBRUBY_A) $(LIBS) -o $@ - -$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS) $(SETUP) miniruby$(EXEEXT) - @rm -f $@ - $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@ - -$(LIBRUBY_A): $(OBJS) $(DMYEXT) - @AR@ rcu $@ $(OBJS) $(DMYEXT) - @-@RANLIB@ $@ 2> /dev/null || true - -$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) miniruby$(EXEEXT) $(PREP) - $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) -o $@ - @-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \ - File.symlink "$(LIBRUBY_SO)", link}' \ - $(LIBRUBY_ALIASES) || true - -ruby.imp: $(LIBRUBY_A) - @@NM@ -Pgp $(LIBRUBY_A) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@ -# $(MINIRUBY) $< $@ - -install: rbconfig.rb - $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --mantype="$(MANTYPE)" - $(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) install - -what-where no-install: rbconfig.rb - $(MINIRUBY) $(srcdir)/instruby.rb -n $(SCRIPT_ARGS) --mantype="$(MANTYPE)" - $(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(SCRIPT_ARGS) install - -clean-ext: - @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) clean 2> /dev/null || true - -clean-local: - @rm -f $(OBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES) - @rm -f ext/extinit.c ext/extinit.@OBJEXT@ dmyext.@OBJEXT@ - @rm -f $(PROGRAM) miniruby$(EXEEXT) - -clean: clean-ext clean-local - -distclean-ext: - @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) distclean 2> /dev/null || true - -distclean-local: clean-local - @rm -f @MAKEFILES@ config.h rbconfig.rb - @rm -f ext/config.cache config.cache config.log config.status - @rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp - -distclean: distclean-ext distclean-local - -realclean: distclean - @rm -f parse.c - @rm -f lex.c - -test: miniruby$(EXEEXT) rbconfig.rb $(PROGRAM) - @./miniruby$(EXEEXT) $(srcdir)/rubytest.rb - -rbconfig.rb: miniruby$(EXEEXT) $(srcdir)/mkconfig.rb config.status $(PREP) - @$(MINIRUBY) $(srcdir)/mkconfig.rb rbconfig.rb - -fake.rb: miniruby$(EXEEXT) Makefile - @echo ' \ - class Object; \ - CROSS_COMPILING = RUBY_PLATFORM; \ - remove_const :RUBY_PLATFORM; \ - remove_const :RUBY_VERSION; \ - RUBY_PLATFORM = "@arch@"; \ - RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"; \ - end; \ - if RUBY_PLATFORM =~ /mswin|bccwin|mingw/; \ - class File; \ - remove_const :ALT_SEPARATOR; \ - ALT_SEPARATOR = "\\"; \ - end; \ - end; \ - ' > $@ - -Makefile: $(srcdir)/Makefile.in - -.PRECIOUS: @MAKEFILES@ - -@MAKEFILES@: config.status - MAKE=$(MAKE) $(SHELL) ./config.status - @{ \ - echo "all:; -@rm -f conftest.mk"; \ - echo "conftest.mk: .force; @echo AUTO_REMAKE"; \ - echo ".force:"; \ - } > conftest.mk || exit 1; \ - $(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \ - { echo "Makefile updated, restart."; exit 1; } - -config.status: $(srcdir)/configure - MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck - -$(srcdir)/configure: $(srcdir)/configure.in - cd $(srcdir) && $(AUTOCONF) - -.c.@OBJEXT@: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< - -lex.c: keywords - gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $(srcdir)/keywords > lex.c - -.y.c: - $(YACC) $< - sed '/^#/s|y\.tab\.c|$@|' y.tab.c > $@ - rm -f y.tab.c - -ext/extinit.@OBJEXT@: ext/extinit.c $(SETUP) - $(CC) $(CFLAGS) $(CPPFLAGS) @OUTFLAG@$@ -c ext/extinit.c - -acosh.@OBJEXT@: $(srcdir)/missing/acosh.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/acosh.c - -alloca.@OBJEXT@: $(srcdir)/missing/alloca.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/alloca.c - -crypt.@OBJEXT@: $(srcdir)/missing/crypt.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/crypt.c - -dup2.@OBJEXT@: $(srcdir)/missing/dup2.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/dup2.c - -fileblocks.@OBJEXT@: $(srcdir)/missing/fileblocks.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/fileblocks.c - -finite.@OBJEXT@: $(srcdir)/missing/finite.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/finite.c - -flock.@OBJEXT@: $(srcdir)/missing/flock.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/flock.c - -isinf.@OBJEXT@: $(srcdir)/missing/isinf.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/isinf.c - -isnan.@OBJEXT@: $(srcdir)/missing/isnan.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/isnan.c - -fnmatch.@OBJEXT@: $(srcdir)/missing/fnmatch.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/fnmatch.c - -memcmp.@OBJEXT@: $(srcdir)/missing/memcmp.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/memcmp.c - -memmove.@OBJEXT@: $(srcdir)/missing/memmove.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/memmove.c - -mkdir.@OBJEXT@: $(srcdir)/missing/mkdir.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/mkdir.c - -vsnprintf.@OBJEXT@: $(srcdir)/missing/vsnprintf.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/vsnprintf.c - -strcasecmp.@OBJEXT@: $(srcdir)/missing/strcasecmp.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strcasecmp.c - -strncasecmp.@OBJEXT@: $(srcdir)/missing/strncasecmp.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strncasecmp.c - -strchr.@OBJEXT@: $(srcdir)/missing/strchr.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strchr.c - -strerror.@OBJEXT@: $(srcdir)/missing/strerror.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strerror.c - -strftime.@OBJEXT@: $(srcdir)/missing/strftime.c - $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strftime.c - -strstr.@OBJEXT@: $(srcdir)/missing/strstr.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strstr.c - -strtol.@OBJEXT@: $(srcdir)/missing/strtol.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtol.c - -strtoul.@OBJEXT@: $(srcdir)/missing/strtoul.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtoul.c - -x68.@OBJEXT@: $(srcdir)/missing/x68.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/x68.c - -os2.@OBJEXT@: $(srcdir)/missing/os2.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/os2.c - -dl_os2.@OBJEXT@: $(srcdir)/missing/dl_os2.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/dl_os2.c - -win32.@OBJEXT@: $(srcdir)/win32/win32.c - $(CC) $(CFLAGS) $(CPPFLAGS) -I$(srcdir)/win32 -c $(srcdir)/win32/win32.c - -# Prevent GNU make v3 from overflowing arg limit on SysV. -.NOEXPORT: -### -array.@OBJEXT@: array.c ruby.h config.h defines.h intern.h missing.h \ - util.h st.h -bignum.@OBJEXT@: bignum.c ruby.h config.h defines.h intern.h missing.h -class.@OBJEXT@: class.c ruby.h config.h defines.h intern.h missing.h \ - rubysig.h node.h st.h version.h -compar.@OBJEXT@: compar.c ruby.h config.h defines.h intern.h missing.h -dir.@OBJEXT@: dir.c ruby.h config.h defines.h intern.h missing.h util.h -dln.@OBJEXT@: dln.c ruby.h config.h defines.h intern.h missing.h dln.h -dmyext.@OBJEXT@: dmyext.c -enum.@OBJEXT@: enum.c ruby.h config.h defines.h intern.h missing.h node.h \ - util.h -error.@OBJEXT@: error.c ruby.h config.h defines.h intern.h missing.h \ - env.h version.h st.h -eval.@OBJEXT@: eval.c ruby.h config.h defines.h intern.h missing.h node.h \ - env.h util.h rubysig.h st.h dln.h -file.@OBJEXT@: file.c ruby.h config.h defines.h intern.h missing.h \ - rubyio.h rubysig.h util.h dln.h -gc.@OBJEXT@: gc.c ruby.h config.h defines.h intern.h missing.h rubysig.h \ - st.h node.h env.h re.h regex.h -hash.@OBJEXT@: hash.c ruby.h config.h defines.h intern.h missing.h st.h \ - util.h rubysig.h version.h -inits.@OBJEXT@: inits.c ruby.h config.h defines.h intern.h missing.h -io.@OBJEXT@: io.c ruby.h config.h defines.h intern.h missing.h rubyio.h \ - rubysig.h env.h util.h -main.@OBJEXT@: main.c ruby.h config.h defines.h intern.h missing.h -marshal.@OBJEXT@: marshal.c ruby.h config.h defines.h intern.h missing.h \ - rubyio.h st.h util.h -math.@OBJEXT@: math.c ruby.h config.h defines.h intern.h missing.h -numeric.@OBJEXT@: numeric.c ruby.h config.h defines.h intern.h missing.h -object.@OBJEXT@: object.c ruby.h config.h defines.h intern.h missing.h \ - st.h util.h -pack.@OBJEXT@: pack.c ruby.h config.h defines.h intern.h missing.h -parse.@OBJEXT@: parse.c ruby.h config.h defines.h intern.h missing.h \ - env.h node.h st.h regex.h util.h lex.c -prec.@OBJEXT@: prec.c ruby.h config.h defines.h intern.h missing.h -process.@OBJEXT@: process.c ruby.h config.h defines.h intern.h missing.h \ - rubysig.h st.h -random.@OBJEXT@: random.c ruby.h config.h defines.h intern.h missing.h -range.@OBJEXT@: range.c ruby.h config.h defines.h intern.h missing.h -re.@OBJEXT@: re.c ruby.h config.h defines.h intern.h missing.h re.h \ - regex.h -regex.@OBJEXT@: regex.c config.h regex.h -ruby.@OBJEXT@: ruby.c ruby.h config.h defines.h intern.h missing.h dln.h \ - node.h util.h -signal.@OBJEXT@: signal.c ruby.h config.h defines.h intern.h missing.h \ - rubysig.h -sprintf.@OBJEXT@: sprintf.c ruby.h config.h defines.h intern.h missing.h -st.@OBJEXT@: st.c config.h st.h -string.@OBJEXT@: string.c ruby.h config.h defines.h intern.h missing.h \ - re.h regex.h version.h -struct.@OBJEXT@: struct.c ruby.h config.h defines.h intern.h missing.h -time.@OBJEXT@: time.c ruby.h config.h defines.h intern.h missing.h -util.@OBJEXT@: util.c ruby.h config.h defines.h intern.h missing.h util.h -variable.@OBJEXT@: variable.c ruby.h config.h defines.h intern.h \ - missing.h env.h node.h st.h util.h -version.@OBJEXT@: version.c ruby.h config.h defines.h intern.h missing.h \ - version.h diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000000..2b021e7cdd --- /dev/null +++ b/NEWS.md @@ -0,0 +1,87 @@ +# NEWS for Ruby 4.1.0 + +This document is a list of user-visible feature changes +since the **4.0.0** release, except for bug fixes. + +Note that each entry is kept to a minimum, see links for details. + +## Language changes + +## Core classes updates + +Note: We're only listing outstanding class updates. + +* Method + + * `Method#source_location`, `Proc#source_location`, and + `UnboundMethod#source_location` now return extended location + information with 5 elements: `[path, start_line, start_column, + end_line, end_column]`. The previous 2-element format `[path, + line]` can still be obtained by calling `.take(2)` on the result. + [[Feature #6012]] + +* Set + + * A deprecated behavior, `Set#to_set`, `Range#to_set`, and + `Enumerable#to_set` accepting arguments, was removed. [[Feature #21390]] + +## Stdlib updates + +### The following bundled gems are added. + + +We only list stdlib changes that are notable feature changes. + +Other changes are listed in the following sections. We also listed release +history from the previous bundled version that is Ruby 3.4.0 if it has GitHub +releases. + +### The following bundled gem is promoted from default gems. + +* tsort 0.2.0 + +### The following default gem is added. + +### The following default gems are updated. + +* RubyGems 4.1.0.dev +* bundler 4.1.0.dev +* prism 1.8.0 +* stringio 3.2.1.dev +* strscan 3.1.7.dev + +### The following bundled gems are updated. + +* minitest 6.0.1 +* test-unit 3.7.7 +* rss 0.3.2 +* net-imap 0.6.2 +* rbs 3.10.2 +* typeprof 0.31.1 +* debug 1.11.1 +* mutex_m 0.3.0 +* resolv-replace 0.2.0 +* rdoc 7.1.0 + +### RubyGems and Bundler + +Ruby 4.0 bundled RubyGems and Bundler version 4. see the following links for details. + +## Supported platforms + +## Compatibility issues + +## Stdlib compatibility issues + +## C API updates + +## Implementation improvements + +### Ractor + +A lot of work has gone into making Ractors more stable, performant, and usable. These improvements bring Ractor implementation closer to leaving experimental status. + +## JIT + +[Feature #6012]: https://bugs.ruby-lang.org/issues/6012 +[Feature #21390]: https://bugs.ruby-lang.org/issues/21390 diff --git a/README b/README deleted file mode 100644 index bde22dff78..0000000000 --- a/README +++ /dev/null @@ -1,106 +0,0 @@ -* What's Ruby - -Ruby is the interpreted scripting language for quick and -easy object-oriented programming. It has many features to -process text files and to do system management tasks (as in -Perl). It is simple, straight-forward, and extensible. - - -* Features of Ruby - - + Simple Syntax - + *Normal* Object-Oriented features(ex. class, method calls) - + *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method) - + Operator Overloading - + Exception Handling - + Iterators and Closures - + Garbage Collection - + Dynamic Loading of Object files(on some architecture) - + Highly Portable(works on many UNIX machines, and on DOS, - Windows, Mac, BeOS etc.) - - -* How to get Ruby - -The Ruby distribution can be found on: - - ftp://ftp.ruby-lang.org/pub/ruby/ - -You can get it by anonymous CVS. How to check out is: - - $ cvs -d :pserver:anonymous@cvs.ruby-lang.org:/src login - (Logging in to anonymous@cvs.ruby-lang.org) - CVS password: anonymous - $ cvs -z4 -d :pserver:anonymous@cvs.ruby-lang.org:/src checkout ruby - - -* Ruby home-page - -The URL of the Ruby home-page is: - - http://www.ruby-lang.org/ - - -* Mailing list - -There is a mailing list to talk about Ruby. -To subscribe this list, please send the following phrase - - subscribe YourFirstName YourFamilyName -e.g. - subscribe Joseph Smith - -in the mail body (not subject) to the address <ruby-talk-ctl@ruby-lang.org>. - - -* How to compile and install - -This is what you need to do to compile and install Ruby: - - 1. If ./configure does not exist or is older than configure.in, - run autoconf to (re)generate configure. - - 2. Run ./configure, which will generate config.h and Makefile. - - 3. Edit defines.h if you need. Probably this step will not need. - - 4. Remove comment mark(#) before the module names from ext/Setup (or - add module names if not present), if you want to link modules - statically. - - If you don't want to compile non static extension modules - (probably on architectures which does not allow dynamic loading), - remove comment mark from the line "#option nodynamic" in - ext/Setup. - - 5. Run make. - - 6. Optionally, run 'make test' to check whether the compiled Ruby - interpreter works well. If you see the message "test succeeded", - your ruby works as it should (hopefully). - - 7. Run 'make install' - - You may have to be a super user to install ruby. - -If you fail to compile ruby, please send the detailed error report with -the error log and machine/OS type, to help others. - - -* Copying - -See the file COPYING. - - -* The Author - -Feel free to send comments and bug reports to the author. Here is the -author's latest mail address: - - matz@netlab.jp - -------------------------------------------------------- -created at: Thu Aug 3 11:57:36 JST 1995 -Local variables: -mode: indented-text -end: diff --git a/README.EXT b/README.EXT index 3a37db4e11..48b8d964c4 100644 --- a/README.EXT +++ b/README.EXT @@ -1,1069 +1 @@ -.\" README.EXT - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995 - -This document explains how to make extension libraries for Ruby. - -1. Basic knowledge - -In C, variables have types and data do not have types. In contrast, -Ruby variables do not have a static type, and data themselves have -types, so data will need to be converted between the languages. - -Data in Ruby are represented by C type `VALUE'. Each VALUE data has -its data-type. - -To retrieve C data from a VALUE, you need to: - - (1) Identify the VALUE's data type - (2) Convert the VALUE into C data - -Converting to the wrong data type may cause serious problems. - - -1.1 Data-types - -The Ruby interpreter has the following data types: - - T_NIL nil - T_OBJECT ordinary object - T_CLASS class - T_MODULE module - T_FLOAT floating point number - T_STRING string - T_REGEXP regular expression - T_ARRAY array - T_FIXNUM Fixnum(31bit integer) - T_HASH associative array - T_STRUCT (Ruby) structure - T_BIGNUM multi precision integer - T_FILE IO - T_TRUE true - T_FALSE false - T_DATA data - T_SYMBOL symbol - -In addition, there are several other types used internally: - - T_ICLASS - T_MATCH - T_UNDEF - T_VARMAP - T_SCOPE - T_NODE - -Most of the types are represented by C structures. - -1.2 Check Data Type of the VALUE - -The macro TYPE() defined in ruby.h shows the data type of the VALUE. -TYPE() returns the constant number T_XXXX described above. To handle -data types, your code will look something like this: - - switch (TYPE(obj)) { - case T_FIXNUM: - /* process Fixnum */ - break; - case T_STRING: - /* process String */ - break; - case T_ARRAY: - /* process Array */ - break; - default: - /* raise exception */ - rb_raise(rb_eTypeError, "not valid value"); - break; - } - -There is the data-type check function - - void Check_Type(VALUE value, int type) - -which raises an exception if the VALUE does not have the type specified. - -There are also faster check macros for fixnums and nil. - - FIXNUM_P(obj) - NIL_P(obj) - -1.3 Convert VALUE into C data - -The data for type T_NIL, T_FALSE, T_TRUE are nil, true, false -respectively. They are singletons for the data type. - -The T_FIXNUM data is a 31bit length fixed integer (63bit length on -some machines), which can be convert to a C integer by using the -FIX2INT() macro. There is also NUM2INT() which converts any Ruby -numbers into C integers. The NUM2INT() macro includes a type check, so -an exception will be raised if the conversion failed. NUM2DBL() can -be used to retrieve the double float value in same way. - -To get char* from a VALUE, version 1.7 recommend to use new macros -StringValue() and StringValuePtr(). StringValue(var) replaces var's -value to the result of "var.to_str()". StringValuePtr(var) does same -replacement and returns char* representation of var. These macros -will skip the replacement if var is a String. Notice that the macros -requires to take only lvalue as their argument, to change the value -of var in the replacement. - -In version 1.6 or earlier, STR2CSTR() was used to do same thing -but now it is obsoleted in version 1.7 because of STR2CSTR() has -a risk of dangling pointer problem in to_str() impliclit conversion. - -Other data types have corresponding C structures, e.g. struct RArray -for T_ARRAY etc. The VALUE of the type which has corresponding structure -can be cast to retrieve the pointer to the struct. The casting macro -will be of the form RXXXX for each data type; for instance, RARRAY(obj). -See "ruby.h". - -For example, `RSTRING(size)->len' is the way to get the size of the -Ruby String object. The allocated region can be accessed by -`RSTRING(str)->ptr'. For arrays, use `RARRAY(ary)->len' and -`RARRAY(ary)->ptr' respectively. - -Notice: Do not change the value of the structure directly, unless you -are responsible for the result. This ends up being the cause of interesting -bugs. - -1.4 Convert C data into VALUE - -To convert C data to Ruby values: - - * FIXNUM - - left shift 1 bit, and turn on LSB. - - * Other pointer values - - cast to VALUE. - -You can determine whether a VALUE is pointer or not by checking its LSB. - -Notice Ruby does not allow arbitrary pointer values to be a VALUE. They -should be pointers to the structures which Ruby knows about. The known -structures are defined in <ruby.h>. - -To convert C numbers to Ruby values, use these macros. - - INT2FIX() for integers within 31bits. - INT2NUM() for arbitrary sized integer. - -INT2NUM() converts an integer into a Bignum if it is out of the FIXNUM -range, but is a bit slower. - -1.5 Manipulating Ruby data - -As I already mentioned, it is not recommended to modify an object's internal -structure. To manipulate objects, use the functions supplied by the Ruby -interpreter. Some (not all) of the useful functions are listed below: - - String functions - - rb_str_new(const char *ptr, long len) - - Creates a new Ruby string. - - rb_str_new2(const char *ptr) - - Creates a new Ruby string from a C string. This is equivalent to - rb_str_new(ptr, strlen(ptr)). - - rb_tainted_str_new(const char *ptr, long len) - - Creates a new tainted Ruby string. Strings from external data - sources should be tainted. - - rb_tainted_str_new2(const char *ptr) - - Creates a new tainted Ruby string from a C string. - - rb_str_cat(VALUE str, const char *ptr, long len) - - Appends len bytes of data from ptr to the Ruby string. - - Array functions - - rb_ary_new() - - Creates an array with no elements. - - rb_ary_new2(long len) - - Creates an array with no elements, allocating internal buffer - for len elements. - - rb_ary_new3(long n, ...) - - Creates an n-element array from the arguments. - - rb_ary_new4(long n, VALUE *elts) - - Creates an n-element array from a C array. - - rb_ary_push(VALUE ary, VALUE val) - rb_ary_pop(VALUE ary) - rb_ary_shift(VALUE ary) - rb_ary_unshift(VALUE ary, VALUE val) - - Array operations. The first argument to each functions must be an - array. They may dump core if other types given. - -2. Extending Ruby with C - -2.1 Addding new features to Ruby - -You can add new features (classes, methods, etc.) to the Ruby -interpreter. Ruby provides APIs for defining the following things: - - * Classes, Modules - * Methods, Singleton Methods - * Constants - -2.1.1 Class/module definition - -To define a class or module, use the functions below: - - VALUE rb_define_class(const char *name, VALUE super) - VALUE rb_define_module(const char *name) - -These functions return the newly created class or module. You may -want to save this reference into a variable to use later. - -To define nested classes or modules, use the functions below: - - VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super) - VALUE rb_define_module_under(VALUE outer, const char *name) - -2.1.2 Method/singleton method definition - -To define methods or singleton methods, use these functions: - - void rb_define_method(VALUE klass, const char *name, - VALUE (*func)(), int argc) - - void rb_define_singleton_method(VALUE object, const char *name, - VALUE (*func)(), int argc) - -The `argc' represents the number of the arguments to the C function, -which must be less than 17. But I believe you don't need that much. :-) - -If `argc' is negative, it specifies the calling sequence, not number of -the arguments. - -If argc is -1, the function will be called as: - - VALUE func(int argc, VALUE *argv, VALUE obj) - -where argc is the actual number of arguments, argv is the C array of -the arguments, and obj is the receiver. - -If argc is -2, the arguments are passed in a Ruby array. The function -will be called like: - - VALUE func(VALUE obj, VALUE args) - -where obj is the receiver, and args is the Ruby array containing -actual arguments. - -There are two more functions to define methods. One is to define -private methods: - - void rb_define_private_method(VALUE klass, const char *name, - VALUE (*func)(), int argc) - -The other is to define module functions, which are private AND singleton -methods of the module. For example, sqrt is the module function -defined in Math module. It can be call in the form like: - - Math.sqrt(4) - -or - - include Math - sqrt(4) - -To define module functions, use: - - void rb_define_module_function(VALUE module, const char *name, - VALUE (*func)(), int argc) - -Oh, in addition, function-like methods, which are private methods defined -in the Kernel module, can be defined using: - - void rb_define_global_function(const char *name, VALUE (*func)(), int argc) - -To define alias to the method, - - void rb_define_alias(VALUE module, const char* new, const char* old); - -2.1.3 Constant definition - -We have 2 functions to define constants: - - void rb_define_const(VALUE klass, const char *name, VALUE val) - void rb_define_global_const(const char *name, VALUE val) - -The former is to define a constant under specified class/module. The -latter is to define a global constant. - -2.2 Use Ruby features from C - -There are several ways to invoke Ruby's features from C code. - -2.2.1 Evaluate Ruby Programs in a String - -The easiest way to use Ruby's functionality from a C program is to -evaluate the string as Ruby program. This function will do the job. - - VALUE rb_eval_string(const char *str) - -Evaluation is done under the current context, thus current local variables -of the innermost method (which is defined by Ruby) can be accessed. - -2.2.2 ID or Symbol - -You can invoke methods directly, without parsing the string. First I -need to explain about symbols (whose data type is ID). ID is the -integer number to represent Ruby's identifiers such as variable names. -It can be accessed from Ruby in the form: - - :Identifier - -You can get the symbol value from a string within C code by using - - rb_intern(const char *name) - -2.2.3 Invoke Ruby method from C - -To invoke methods directly, you can use the function below - - VALUE rb_funcall(VALUE recv, ID mid, int argc, ...) - -This function invokes a method on the recv, with the method name -specified by the symbol mid. - -2.2.4 Accessing the variables and constants - -You can access class variables and instance variables using access -functions. Also, global variables can be shared between both environments. -There's no way to access Ruby's local variables. - -The functions to access/modify instance variables are below: - - VALUE rb_ivar_get(VALUE obj, ID id) - VALUE rb_ivar_set(VALUE obj, ID id, VALUE val) - -id must be the symbol, which can be retrieved by rb_intern(). - -To access the constants of the class/module: - - VALUE rb_const_get(VALUE obj, ID id) - -See 2.1.3 for defining new constant. - -3. Information sharing between Ruby and C - -3.1 Ruby constants that C can be accessed from C - -The following Ruby constants can be referred from C. - - Qtrue - Qfalse - -Boolean values. Qfalse is false in C also (i.e. 0). - - Qnil - -Ruby nil in C scope. - -3.2 Global variables shared between C and Ruby - -Information can be shared between the two environments using shared global -variables. To define them, you can use functions listed below: - - void rb_define_variable(const char *name, VALUE *var) - -This function defines the variable which is shared by both environments. -The value of the global variable pointed to by `var' can be accessed -through Ruby's global variable named `name'. - -You can define read-only (from Ruby, of course) variables using the -function below. - - void rb_define_readonly_variable(const char *name, VALUE *var) - -You can defined hooked variables. The accessor functions (getter and -setter) are called on access to the hooked variables. - - void rb_define_hooked_variable(constchar *name, VALUE *var, - VALUE (*getter)(), void (*setter)()) - -If you need to supply either setter or getter, just supply 0 for the -hook you don't need. If both hooks are 0, rb_define_hooked_variable() -works just like rb_define_variable(). - - void rb_define_virtual_variable(const char *name, - VALUE (*getter)(), void (*setter)()) - -This function defines a Ruby global variable without a corresponding C -variable. The value of the variable will be set/get only by hooks. - -The prototypes of the getter and setter functions are as follows: - - (*getter)(ID id, void *data, struct global_entry* entry); - (*setter)(VALUE val, ID id, void *data, struct global_entry* entry); - -3.3 Encapsulate C data into Ruby object - -To wrap and objectify a C pointer as a Ruby object (so called -DATA), use Data_Wrap_Struct(). - - Data_Wrap_Struct(klass, mark, free, ptr) - -Data_Wrap_Struct() returns a created DATA object. The klass argument -is the class for the DATA object. The mark argument is the function -to mark Ruby objects pointed by this data. The free argument is the -function to free the pointer allocation. If this is -1, the pointer -will be just freed. The functions mark and free will be called from -garbage collector. - -You can allocate and wrap the structure in one step. - - Data_Make_Struct(klass, type, mark, free, sval) - -This macro returns an allocated Data object, wrapping the pointer to -the structure, which is also allocated. This macro works like: - - (sval = ALLOC(type), Data_Wrap_Struct(klass, mark, free, sval)) - -Arguments klass, mark, and free work like their counterparts in -Data_Wrap_Struct(). A pointer to the allocated structure will be -assigned to sval, which should be a pointer of the type specified. - -To retrieve the C pointer from the Data object, use the macro -Data_Get_Struct(). - - Data_Get_Struct(obj, type, sval) - -A pointer to the structure will be assigned to the variable sval. - -See the example below for details. - -4. Example - Creating dbm extension - -OK, here's the example of making an extension library. This is the -extension to access DBMs. The full source is included in the ext/ -directory in the Ruby's source tree. - -(1) make the directory - - % mkdir ext/dbm - -Make a directory for the extension library under ext directory. - -(2) create MANIFEST file - - % cd ext/dbm - % touch MANIFEST - -There should be MANIFEST file in the directory for the extension -library. Make an empty file for now. - -(3) design the library - -You need to design the library features, before making it. - -(4) write C code. - -You need to write C code for your extension library. If your library -has only one source file, choosing ``LIBRARY.c'' as a file name is -preferred. On the other hand, in case your library has multiple source -files, avoid choosing ``LIBRARY.c'' for a file name. It may conflict -with an intermediate file ``LIBRARY.o'' on some platforms. - -Ruby will execute the initializing function named ``Init_LIBRARY'' in -the library. For example, ``Init_dbm()'' will be executed when loading -the library. - -Here's the example of an initializing function. - --- -Init_dbm() -{ - /* define DBM class */ - cDBM = rb_define_class("DBM", rb_cObject); - /* DBM includes Enumerate module */ - rb_include_module(cDBM, rb_mEnumerable); - - /* DBM has class method open(): arguments are received as C array */ - rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1); - - /* DBM instance method close(): no args */ - rb_define_method(cDBM, "close", fdbm_close, 0); - /* DBM instance method []: 1 argument */ - rb_define_method(cDBM, "[]", fdbm_fetch, 1); - : - - /* ID for a instance variable to store DBM data */ - id_dbm = rb_intern("dbm"); -} --- - -The dbm extension wraps the dbm struct in the C environment using -Data_Make_Struct. - --- -struct dbmdata { - int di_size; - DBM *di_dbm; -}; - - -obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp); --- - -This code wraps the dbmdata structure into a Ruby object. We avoid wrapping -DBM* directly, because we want to cache size information. - -To retrieve the dbmdata structure from a Ruby object, we define the -following macro: - --- -#define GetDBM(obj, dbmp) {\ - Data_Get_Struct(obj, struct dbmdata, dbmp);\ - if (dbmp->di_dbm == 0) closed_dbm();\ -} --- - -This sort of complicated macro does the retrieving and close checking for -the DBM. - -There are three kinds of way to receive method arguments. First, -methods with a fixed number of arguments receive arguments like this: - --- -static VALUE -fdbm_delete(obj, keystr) - VALUE obj, keystr; -{ - : -} --- - -The first argument of the C function is the self, the rest are the -arguments to the method. - -Second, methods with an arbitrary number of arguments receive -arguments like this: - --- -static VALUE -fdbm_s_open(argc, argv, klass) - int argc; - VALUE *argv; - VALUE klass; -{ - : - if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) { - mode = 0666; /* default value */ - } - : -} --- - -The first argument is the number of method arguments, the second -argument is the C array of the method arguments, and the third -argument is the receiver of the method. - -You can use the function rb_scan_args() to check and retrieve the -arguments. For example, "11" means that the method requires at least one -argument, and at most receives two arguments. - -Methods with an arbitrary number of arguments can receive arguments -by Ruby's array, like this: - --- -static VALUE -fdbm_indexes(obj, args) - VALUE obj, args; -{ - : -} --- - -The first argument is the receiver, the second one is the Ruby array -which contains the arguments to the method. - -** Notice - -GC should know about global variables which refer to Ruby's objects, but -are not exported to the Ruby world. You need to protect them by - - void rb_global_variable(VALUE *var) - -(5) prepare extconf.rb - -If the file named extconf.rb exists, it will be executed to generate -Makefile. If not, the compilation scheme will try to generate Makefile -anyway. - -extconf.rb is the file for check compilation conditions etc. You -need to put - - require 'mkmf' - -at the top of the file. You can use the functions below to check -various conditions. - - have_library(lib, func): check whether library containing function exists. - have_func(func, header): check whether function exists - have_header(header): check whether header file exists - create_makefile(target): generate Makefile - -The value of the variables below will affect the Makefile. - - $CFLAGS: included in CFLAGS make variable (such as -I) - $LDFLAGS: included in LDFLAGS make variable (such as -L) - -If a compilation condition is not fulfilled, you should not call -``create_makefile''. The Makefile will not generated, compilation will -not be done. - -(6) prepare depend (optional) - -If the file named depend exists, Makefile will include that file to -check dependencies. You can make this file by invoking - - % gcc -MM *.c > depend - -It's no harm. Prepare it. - -(7) put file names into MANIFEST (optional) - - % find * -type f -print > MANIFEST - % vi MANIFEST - -Append file names into MANIFEST. The compilation scheme requires -MANIFEST only to exist, but it's better to take this step in order -to distinguish which files are required. - -(8) generate Makefile - -Try generating the Makefile by: - - ruby extconf.rb - -You don't need this step if you put the extension library under the ext -directory of the ruby source tree. In that case, compilation of the -interpreter will do this step for you. - -(9) make - -Type - - make - -to compile your extension. You don't need this step either if you have -put extension library under the ext directory of the ruby source tree. - -(9) debug - -You may need to rb_debug the extension. Extensions can be linked -statically by the adding directory name in the ext/Setup file so that -you can inspect the extension with the debugger. - -(10) done, now you have the extension library - -You can do anything you want with your library. The author of Ruby -will not claim any restrictions on your code depending on the Ruby API. -Feel free to use, modify, distribute or sell your program. - -Appendix A. Ruby source files overview - -ruby language core - - class.c - error.c - eval.c - gc.c - object.c - parse.y - variable.c - -utility functions - - dln.c - regex.c - st.c - util.c - -ruby interpreter implementation - - dmyext.c - inits.c - main.c - ruby.c - version.c - -class library - - array.c - bignum.c - compar.c - dir.c - enum.c - file.c - hash.c - io.c - marshal.c - math.c - numeric.c - pack.c - prec.c - process.c - random.c - range.c - re.c - signal.c - sprintf.c - string.c - struct.c - time.c - -Appendix B. Ruby extension API reference - -** Types - - VALUE - -The type for the Ruby object. Actual structures are defined in ruby.h, -such as struct RString, etc. To refer the values in structures, use -casting macros like RSTRING(obj). - -** Variables and constants - - Qnil - -const: nil object - - Qtrue - -const: true object(default true value) - - Qfalse - -const: false object - -** C pointer wrapping - - Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) - -Wrap a C pointer into a Ruby object. If object has references to other -Ruby objects, they should be marked by using the mark function during -the GC process. Otherwise, mark should be 0. When this object is no -longer referred by anywhere, the pointer will be discarded by free -function. - - Data_Make_Struct(klass, type, mark, free, sval) - -This macro allocates memory using malloc(), assigns it to the variable -sval, and returns the DATA encapsulating the pointer to memory region. - - Data_Get_Struct(data, type, sval) - -This macro retrieves the pointer value from DATA, and assigns it to -the variable sval. - -** Checking data types - -TYPE(value) -FIXNUM_P(value) -NIL_P(value) -void Check_Type(VALUE value, int type) -void Check_SafeStr(VALUE value) - -** Data type conversion - -FIX2INT(value) -INT2FIX(i) -NUM2INT(value) -INT2NUM(i) -NUM2DBL(value) -rb_float_new(f) -STR2CSTR(value) -rb_str_new2(s) - -** defining class/module - - VALUE rb_define_class(const char *name, VALUE super) - -Defines a new Ruby class as a subclass of super. - - VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) - -Creates a new Ruby class as a subclass of super, under the module's -namespace. - - VALUE rb_define_module(const char *name) - -Defines a new Ruby module. - - VALUE rb_define_module_under(VALUE module, const char *name, VALUE super) - -Defines a new Ruby module under the module's namespace. - - void rb_include_module(VALUE klass, VALUE module) - -Includes module into class. If class already includes it, just -ignored. - - void rb_extend_object(VALUE object, VALUE module) - -Extend the object with the module's attributes. - -** Defining Global Variables - - void rb_define_variable(const char *name, VALUE *var) - -Defines a global variable which is shared between C and Ruby. If name -contains a character which is not allowed to be part of the symbol, -it can't be seen from Ruby programs. - - void rb_define_readonly_variable(const char *name, VALUE *var) - -Defines a read-only global variable. Works just like -rb_define_variable(), except defined variable is read-only. - - void rb_define_virtual_variable(const char *name, - VALUE (*getter)(), VALUE (*setter)()) - -Defines a virtual variable, whose behavior is defined by a pair of C -functions. The getter function is called when the variable is -referred. The setter function is called when the value is set to the -variable. The prototype for getter/setter functions are: - - VALUE getter(ID id) - void setter(VALUE val, ID id) - -The getter function must return the value for the access. - - void rb_define_hooked_variable(const char *name, VALUE *var, - VALUE (*getter)(), VALUE (*setter)()) - -Defines hooked variable. It's a virtual variable with a C variable. -The getter is called as - - VALUE getter(ID id, VALUE *var) - -returning a new value. The setter is called as - - void setter(VALUE val, ID id, VALUE *var) - -GC requires C global variables which hold Ruby values to be marked. - - void rb_global_variable(VALUE *var) - -Tells GC to protect these variables. - -** Constant Definition - - void rb_define_const(VALUE klass, const char *name, VALUE val) - -Defines a new constant under the class/module. - - void rb_define_global_const(const char *name, VALUE val) - -Defines a global constant. This is just the same as - - rb_define_const(cKernal, name, val) - -** Method Definition - - rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) - -Defines a method for the class. func is the function pointer. argc -is the number of arguments. if argc is -1, the function will receive -3 arguments: argc, argv, and self. if argc is -2, the function will -receive 2 arguments, self and args, where args is a Ruby array of -the method arguments. - - rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) - -Defines a private method for the class. Arguments are same as -rb_define_method(). - - rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) - -Defines a singleton method. Arguments are same as rb_define_method(). - - rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) - -Retrieve argument from argc, argv. The fmt is the format string for -the arguments, such as "12" for 1 non-optional argument, 2 optional -arguments. If `*' appears at the end of fmt, it means the rest of -the arguments are assigned to the corresponding variable, packed in -an array. - -** Invoking Ruby method - - VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) - -Invokes a method. To retrieve mid from a method name, use rb_intern(). - - VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) - -Invokes a method, passing arguments by an array of values. - - VALUE rb_eval_string(const char *str) - -Compiles and executes the string as a Ruby program. - - ID rb_intern(const char *name) - -Returns ID corresponding to the name. - - char *rb_id2name(ID id) - -Returns the name corresponding ID. - - char *rb_class2name(VALUE klass) - -Returns the name of the class. - - int rb_respond_to(VALUE object, ID id) - -Returns true if the object responds to the message specified by id. - -** Instance Variables - - VALUE rb_iv_get(VALUE obj, const char *name) - -Retrieve the value of the instance variable. If the name is not -prefixed by `@', that variable shall be inaccessible from Ruby. - - VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) - -Sets the value of the instance variable. - -** Control Structure - - VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2) - -Calls the function func1, supplying func2 as the block. func1 will be -called with the argument arg1. func2 receives the value from yield as -the first argument, arg2 as the second argument. - - VALUE rb_yield(VALUE val) - -Evaluates the block with value val. - - VALUE rb_rescue(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2) - -Calls the function func1, with arg1 as the argument. If an exception -occurs during func1, it calls func2 with arg2 as the argument. The -return value of rb_rescue() is the return value from func1 if no -exception occurs, from func2 otherwise. - - VALUE rb_ensure(VALUE (*func1)(), void *arg1, void (*func2)(), void *arg2) - -Calls the function func1 with arg1 as the argument, then calls func2 -with arg2 if execution terminated. The return value from -rb_ensure() is that of func1. - -** Exceptions and Errors - - void rb_warn(const char *fmt, ...) - -Prints a warning message according to a printf-like format. - - void rb_warning(const char *fmt, ...) - -Prints a warning message according to a printf-like format, if -$VERBOSE is true. - -void rb_raise(rb_eRuntimeError, const char *fmt, ...) - -Raises RuntimeError. The fmt is a format string just like printf(). - - void rb_raise(VALUE exception, const char *fmt, ...) - -Raises a class exception. The fmt is a format string just like printf(). - - void rb_fatal(const char *fmt, ...) - -Raises a fatal error, terminates the interpreter. No exception handling -will be done for fatal errors, but ensure blocks will be executed. - - void rb_bug(const char *fmt, ...) - -Terminates the interpreter immediately. This function should be -called under the situation caused by the bug in the interpreter. No -exception handling nor ensure execution will be done. - -** Initialize and Starts the Interpreter - -The embedding API functions are below (not needed for extension libraries): - - void ruby_init() - -Initializes the interpreter. - - void ruby_options(int argc, char **argv) - -Process command line arguments for the interpreter. - - void ruby_run() - -Starts execution of the interpreter. - - void ruby_script(char *name) - -Specifies the name of the script ($0). - -Appendix C. Functions Available in extconf.rb - -These functions are available in extconf.rb: - - have_library(lib, func) - -Checks whether the library exists, containing the specified function. -Returns true if the library exists. - - find_library(lib, func, path...) - -Checks whether a library which contains the specified function exists in -path. Returns true if the library exists. - - have_func(func, header) - -Checks whether func exists with header. Returns true if the function -exists. To check functions in an additional library, you need to -check that library first using have_library(). - - have_header(header) - -Checks whether header exists. Returns true if the header file exists. - - create_makefile(target) - -Generates the Makefile for the extension library. If you don't invoke -this method, the compilation will not be done. - - with_config(withval[, default=nil]) - -Parses the command line options and returns the value specified by ---with-<withval>. - - dir_config(target[, default_dir]) - dir_config(target[, default_include, default_lib]) - -Parses the command line options and adds the directories specified by ---with-<target>-dir, --with-<target>-include, and/or --with-<target>-lib -to $CFLAGS and/or $LDFLAGS. --with-<target>-dir=/path is equivalent to ---with-<target>-include=/path/include --with-<target>-lib=/path/lib. -Returns an array of the added directories ([include_dir, lib_dir]). - -/* - * Local variables: - * fill-column: 70 - * end: - */ +Moved to doc/extension.rdoc diff --git a/README.EXT.ja b/README.EXT.ja |
