From 51022b8e06ae81daa8a84a1122f329119ed95d31 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 7 Sep 2022 00:04:28 +0900 Subject: [PATCH 01/18] Exit status macros need sys/wait.h on FreeBSD --- thread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/thread.c b/thread.c index c42c79914d325c..e50b2ce6ca43ab 100644 --- a/thread.c +++ b/thread.c @@ -100,6 +100,10 @@ #include "vm_debug.h" #include "vm_sync.h" +#if USE_MJIT && defined(HAVE_SYS_WAIT_H) +#include +#endif + #ifndef USE_NATIVE_THREAD_PRIORITY #define USE_NATIVE_THREAD_PRIORITY 0 #define RUBY_THREAD_PRIORITY_MAX 3 From a9c85c0c456d809adab8387f4bb3f296838351db Mon Sep 17 00:00:00 2001 From: git Date: Wed, 7 Sep 2022 00:05:24 +0900 Subject: [PATCH 02/18] * 2022-09-07 [ci skip] --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.h b/version.h index 40999ed5ac7674..513a862e648b85 100644 --- a/version.h +++ b/version.h @@ -15,7 +15,7 @@ #define RUBY_RELEASE_YEAR 2022 #define RUBY_RELEASE_MONTH 9 -#define RUBY_RELEASE_DAY 6 +#define RUBY_RELEASE_DAY 7 #include "ruby/version.h" #include "ruby/internal/abi.h" From 87ef90909b7656aaf8bb968376b879f9aa207a0b Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 7 Sep 2022 05:54:37 +0900 Subject: [PATCH 03/18] Drop an unused method for debugging and add another useful one instead. --- mjit_compiler.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mjit_compiler.rb b/mjit_compiler.rb index 6785e2ffabba1e..77dcf7ef5109f9 100644 --- a/mjit_compiler.rb +++ b/mjit_compiler.rb @@ -104,13 +104,10 @@ def to_ruby(value) Primitive.cexpr! '(VALUE)NUM2PTR(value)' end - def debug(status) - _cc_entries_addr = status.compiled_iseq.jit_unit.cc_entries.instance_variable_get(:@addr) - Primitive.cstmt! %{ - const struct rb_callcache **cc_entries = (const struct rb_callcache **)NUM2PTR(_cc_entries_addr); - fprintf(stderr, "debug: %p\n", cc_entries[0]); - return Qnil; - } + # Convert RubyVM::InstructionSequence to C.rb_iseq_t. Not used by the compiler, but useful for debugging. + def rb_iseqw_to_iseq(iseqw) + iseq_addr = Primitive.cexpr! 'PTR2NUM((VALUE)rb_iseqw_to_iseq(iseqw))' + rb_iseq_t.new(iseq_addr) end # TODO: remove this after migration From 4c1f6750f2c333be2adf7ceab644598b230606d2 Mon Sep 17 00:00:00 2001 From: Antonio Paulino Date: Mon, 29 Aug 2022 16:00:07 -0300 Subject: [PATCH 04/18] [rubygems/rubygems] Fix: Gem info bug with version flag https://github.com/rubygems/rubygems/commit/e4cee1f975 --- lib/rubygems/query_utils.rb | 4 +-- .../test_gem_commands_info_command.rb | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/rubygems/query_utils.rb b/lib/rubygems/query_utils.rb index a502717f94c96a..c72955f83b4e85 100644 --- a/lib/rubygems/query_utils.rb +++ b/lib/rubygems/query_utils.rb @@ -151,7 +151,7 @@ def show_remote_gems(name) fetcher.detect(specs_type) { true } else fetcher.detect(specs_type) do |name_tuple| - name === name_tuple.name + name === name_tuple.name && options[:version].satisfied_by?(name_tuple.version) end end @@ -159,7 +159,7 @@ def show_remote_gems(name) end def specs_type - if options[:all] + if options[:all] || options[:version].specific? if options[:prerelease] :complete else diff --git a/test/rubygems/test_gem_commands_info_command.rb b/test/rubygems/test_gem_commands_info_command.rb index b18b405da60a65..1c9ab7b07cd206 100644 --- a/test/rubygems/test_gem_commands_info_command.rb +++ b/test/rubygems/test_gem_commands_info_command.rb @@ -40,4 +40,30 @@ def test_execute assert_match %r{#{@gem.summary}\n}, @ui.output assert_match "", @ui.error end + + def test_execute_with_version_flag + spec_fetcher do |fetcher| + fetcher.spec "coolgem", "1.0" + fetcher.spec "coolgem", "2.0" + end + + @cmd.handle_options %w[coolgem --remote --version 1.0] + + use_ui @ui do + @cmd.execute + end + + expected = <<-EOF + +*** REMOTE GEMS *** + +coolgem (1.0) + Author: A User + Homepage: http://example.com + + this is a summary + EOF + + assert_equal expected, @ui.output + end end From d5752f73d2288f5ccce0ff6015d929227b914588 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 7 Sep 2022 06:21:00 +0900 Subject: [PATCH 05/18] Add another method for debugging --- mjit_compiler.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mjit_compiler.rb b/mjit_compiler.rb index 77dcf7ef5109f9..9e032fc747703e 100644 --- a/mjit_compiler.rb +++ b/mjit_compiler.rb @@ -90,10 +90,16 @@ def mjit_capture_is_entries(body, is_entries) } end + # Convert encoded VM pointers to insn BINs. def rb_vm_insn_decode(encoded) Primitive.cexpr! 'INT2NUM(rb_vm_insn_decode(NUM2PTR(encoded)))' end + # Convert insn BINs to encoded VM pointers. This one is not used by the compiler, but useful for debugging. + def rb_vm_insn_encode(bin) + Primitive.cexpr! 'PTR2NUM((VALUE)rb_vm_get_insns_address_table()[NUM2INT(bin)])' + end + def insn_may_depend_on_sp_or_pc(insn, opes) _opes_addr = opes.to_i Primitive.cexpr! 'RBOOL(insn_may_depend_on_sp_or_pc(NUM2INT(insn), (VALUE *)NUM2PTR(_opes_addr)))' From bfa6d0f6d75f375e4055fb7f5af8194aa1de5947 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 7 Sep 2022 09:41:28 +0900 Subject: [PATCH 06/18] fixup 8cd6f2a0872e74c6cc089d2a4f8140483080c67a we should handle ensure block when omit this test --- test/socket/test_socket.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb index d061aee46a0ce7..e3ce2b920e65cd 100644 --- a/test/socket/test_socket.rb +++ b/test/socket/test_socket.rb @@ -562,8 +562,6 @@ def test_bintime end def test_closed_read - omit if RUBY_PLATFORM.include?("freebsd") - require 'timeout' require 'socket' bug4390 = '[ruby-core:35203]' @@ -585,7 +583,7 @@ def test_closed_read ensure serv_thread.value.close server.close - end + end unless RUBY_PLATFORM.include?("freebsd") def test_connect_timeout host = "127.0.0.1" From cbdde8e0c574f19e170c3de05dd0bbd276acb741 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 9 Aug 2022 09:22:53 +0900 Subject: [PATCH 07/18] [ruby/psych] Dump Date/DateTime as proleptic Gregorian date as well as Time Fix ruby/psych#572 https://github.com/ruby/psych/commit/92304269bc --- ext/psych/lib/psych/scalar_scanner.rb | 2 +- ext/psych/lib/psych/visitors/to_ruby.rb | 4 +++- ext/psych/lib/psych/visitors/yaml_tree.rb | 16 ++++++++-------- test/psych/test_date_time.rb | 20 ++++++++++++++++++++ 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb index b50667c31500f6..3cb4bf3c7e89da 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/lib/psych/scalar_scanner.rb @@ -63,7 +63,7 @@ def tokenize string elsif string.match?(/^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/) require 'date' begin - class_loader.date.strptime(string, '%Y-%m-%d') + class_loader.date.strptime(string, '%F', Date::GREGORIAN) rescue ArgumentError string end diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb index cce5daf3bbdbfe..8614251ca9e6c3 100644 --- a/ext/psych/lib/psych/visitors/to_ruby.rb +++ b/ext/psych/lib/psych/visitors/to_ruby.rb @@ -80,7 +80,9 @@ def deserialize o when "!ruby/object:DateTime" class_loader.date_time require 'date' unless defined? DateTime - @ss.parse_time(o.value).to_datetime + t = @ss.parse_time(o.value) + DateTime.civil(*t.to_a[0, 6].reverse, Rational(t.utc_offset, 86400)) + + (t.subsec/86400) when '!ruby/encoding' ::Encoding.find o.value when "!ruby/object:Complex" diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb index 316a3a949641f4..31858798e447cd 100644 --- a/ext/psych/lib/psych/visitors/yaml_tree.rb +++ b/ext/psych/lib/psych/visitors/yaml_tree.rb @@ -192,12 +192,13 @@ def visit_Regexp o register o, @emitter.scalar(o.inspect, nil, '!ruby/regexp', false, false, Nodes::Scalar::ANY) end + def visit_Date o + register o, visit_Integer(o.gregorian) + end + def visit_DateTime o - formatted = if o.offset.zero? - o.strftime("%Y-%m-%d %H:%M:%S.%9N Z".freeze) - else - o.strftime("%Y-%m-%d %H:%M:%S.%9N %:z".freeze) - end + t = o.italy + formatted = format_time t, t.offset.zero? tag = '!ruby/object:DateTime' register o, @emitter.scalar(formatted, nil, tag, false, false, Nodes::Scalar::ANY) end @@ -235,7 +236,6 @@ def visit_Integer o end alias :visit_TrueClass :visit_Integer alias :visit_FalseClass :visit_Integer - alias :visit_Date :visit_Integer def visit_Float o if o.nan? @@ -482,8 +482,8 @@ def dump_exception o, msg @emitter.end_mapping end - def format_time time - if time.utc? + def format_time time, utc = time.utc? + if utc time.strftime("%Y-%m-%d %H:%M:%S.%9N Z") else time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z") diff --git a/test/psych/test_date_time.rb b/test/psych/test_date_time.rb index 6f1e8b509e546e..3379bd24bf4c69 100644 --- a/test/psych/test_date_time.rb +++ b/test/psych/test_date_time.rb @@ -44,6 +44,26 @@ def test_datetime_timezone_offset assert_match(/12:00:00-05:00/, cycled.last.to_s) end + def test_julian_date + d = Date.new(1582, 10, 4, Date::GREGORIAN) + assert_cycle d + end + + def test_proleptic_gregorian_date + d = Date.new(1582, 10, 14, Date::GREGORIAN) + assert_cycle d + end + + def test_julian_datetime + dt = DateTime.new(1582, 10, 4, 23, 58, 59, 0, Date::GREGORIAN) + assert_cycle dt + end + + def test_proleptic_gregorian_datetime + dt = DateTime.new(1582, 10, 14, 23, 58, 59, 0, Date::GREGORIAN) + assert_cycle dt + end + def test_invalid_date assert_cycle "2013-10-31T10:40:07-000000000000033" end From 1b034d66f529d662b0ae61cba1fb8622dac3169c Mon Sep 17 00:00:00 2001 From: Chad Wilson Date: Sun, 4 Sep 2022 00:18:15 +0800 Subject: [PATCH 08/18] [ruby/psych] Bump snakeyaml from 1.28 to 1.31 Resolves CVE-2022-25857, among other fixes. https://github.com/ruby/psych/commit/918cd25d37 --- ext/psych/lib/psych/versions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/psych/lib/psych/versions.rb b/ext/psych/lib/psych/versions.rb index 0fdead154c19b0..f39d30ce5a1daa 100644 --- a/ext/psych/lib/psych/versions.rb +++ b/ext/psych/lib/psych/versions.rb @@ -5,6 +5,6 @@ module Psych VERSION = '5.0.0.dev' if RUBY_ENGINE == 'jruby' - DEFAULT_SNAKEYAML_VERSION = '1.28'.freeze + DEFAULT_SNAKEYAML_VERSION = '1.31'.freeze end end From 3a575d13d55751c6b5f34d26a8d87a4c449ddaeb Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 6 Sep 2022 13:45:45 +0900 Subject: [PATCH 09/18] Ensure BASERUBY when cross-compiling --- configure.ac | 1 + win32/Makefile.sub | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index 5b0aa218d947d7..f981d1aa701825 100644 --- a/configure.ac +++ b/configure.ac @@ -76,6 +76,7 @@ AS_IF([test "$HAVE_BASERUBY" != no -a "`RUBYOPT=- $BASERUBY --disable=gems -e 'p HAVE_BASERUBY=no ]) AS_IF([test "$HAVE_BASERUBY" = no], [ + AS_IF([test "$cross_compiling" = yes], [AC_MSG_ERROR([executable host ruby is required for cross-compiling])]) BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false" ]) AC_SUBST(BASERUBY) diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 2910901d7e9ea2..b3d0a2f76e7266 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -24,6 +24,14 @@ REVISION_FORCE = PHONY !ifndef CROSS_COMPILING CROSS_COMPILING = no +!else if "$(CROSS_COMPILING)" == "yes" +! if "$(HAVE_BASERUBY)" != "yes" +! error executable host ruby is required for cross-compiling +! endif +!else +! if "$(CROSS_COMPILING)" != "no" +! error Bad CROSS_COMPILING +! endif !endif !ifndef win_srcdir win_srcdir = $(srcdir)/win32 From 6a43245e6cda89eddd105f5a6e0182a7229657af Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 6 Sep 2022 15:13:27 +0900 Subject: [PATCH 10/18] Use BOOTSTRAPRUBY_COMMAND instead of fake.rb directly --- common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.mk b/common.mk index 0853c5896de390..d57470373949bc 100644 --- a/common.mk +++ b/common.mk @@ -909,7 +909,7 @@ ENC_HEADERS = $(srcdir)/enc/jis/props.h $(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \ $(srcdir)/enc/encinit.c.erb $(ENC_HEADERS) $(srcdir)/lib/mkmf.rb $(RBCONFIG) $(HAVE_BASERUBY)-fake $(ECHO) generating $@ - $(Q) $(BOOTSTRAPRUBY) -r./$(arch)-fake $(srcdir)/enc/make_encmake.rb \ + $(Q) $(BOOTSTRAPRUBY_COMMAND) $(srcdir)/enc/make_encmake.rb \ --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(ENCSTATIC) $(ENCS) $@ .PRECIOUS: $(MKFILES) From f24c65ea7e68d97e92e5ccdb0e1a95c017dc5ebf Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 6 Sep 2022 18:25:16 -0700 Subject: [PATCH 11/18] Skip calling check_unit_queue with mjit_opts.custom fixing the behavior of b726c06e7eeafff52e368179dbe79a11b1aff975 --- mjit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mjit.c b/mjit.c index d3e18c112cc65d..04bdf404b7cd4c 100644 --- a/mjit.c +++ b/mjit.c @@ -1237,6 +1237,7 @@ static void mjit_wait(struct rb_iseq_constant_body *body); static void check_unit_queue(void) { + if (mjit_opts.custom) return; if (worker_stopped) return; if (current_cc_pid != 0) return; // still compiling From e6b47f2fb077d1a3bcef9100846b633989a93cfe Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 7 Sep 2022 10:27:29 +0900 Subject: [PATCH 12/18] Now Psych uses the proleptic Gregorian calendar --- test/excludes/Psych/TestDateTime.rb | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 test/excludes/Psych/TestDateTime.rb diff --git a/test/excludes/Psych/TestDateTime.rb b/test/excludes/Psych/TestDateTime.rb deleted file mode 100644 index 63d99be809279a..00000000000000 --- a/test/excludes/Psych/TestDateTime.rb +++ /dev/null @@ -1,4 +0,0 @@ -exclude(:test_new_datetime, < Date: Tue, 6 Sep 2022 18:40:22 -0700 Subject: [PATCH 13/18] Skip early mjit_add_iseq_to_process on --mjit=pause --- mjit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mjit.c b/mjit.c index 04bdf404b7cd4c..67b6845cb63d97 100644 --- a/mjit.c +++ b/mjit.c @@ -1432,7 +1432,7 @@ mjit_hook_custom_compile(const rb_iseq_t *iseq) static void mjit_add_iseq_to_process(const rb_iseq_t *iseq, const struct rb_mjit_compile_info *compile_info, bool recompile_p) { - if (!mjit_enabled || pch_status == PCH_FAILED || !rb_ractor_main_p()) // TODO: Support non-main Ractors + if (!mjit_enabled || pch_status != PCH_SUCCESS || !rb_ractor_main_p()) // TODO: Support non-main Ractors return; if (mjit_opts.custom) { mjit_hook_custom_compile(iseq); From 496bdf01e25cb13f0b676d0f23f47bb04907b1f6 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 6 Sep 2022 18:46:49 -0700 Subject: [PATCH 14/18] Adjust pch_status for --mjit=pause to let mjit_add_iseq_to_process work --- mjit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mjit.c b/mjit.c index 67b6845cb63d97..864e682c246729 100644 --- a/mjit.c +++ b/mjit.c @@ -1961,6 +1961,7 @@ mjit_resume(void) if (rb_respond_to(rb_mMJITCompiler, rb_intern("compile"))) { // [experimental] defining RubyVM::MJIT.compile allows you to replace JIT mjit_opts.custom = true; + pch_status = PCH_SUCCESS; } else { // Lazy MJIT boot @@ -2041,7 +2042,7 @@ mjit_finish(bool close_handle_p) mjit_dump_total_calls(); #endif - if (!mjit_opts.save_temps && getpid() == pch_owner_pid && pch_status != PCH_NOT_READY) + if (!mjit_opts.save_temps && getpid() == pch_owner_pid && pch_status == PCH_SUCCESS && !mjit_opts.custom) remove_file(pch_file); xfree(header_file); header_file = NULL; From cac0dcfbffe630a0c763392358ca745007ae854d Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 7 Sep 2022 14:26:29 +0900 Subject: [PATCH 15/18] Fix typo I meant the other one. Otherwise this option doesn't make sense. --- mjit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mjit.c b/mjit.c index 864e682c246729..1997eaa939ab85 100644 --- a/mjit.c +++ b/mjit.c @@ -1958,7 +1958,7 @@ mjit_resume(void) // Lazily prepare PCH when --mjit=pause is given if (pch_status == PCH_NOT_READY) { - if (rb_respond_to(rb_mMJITCompiler, rb_intern("compile"))) { + if (rb_respond_to(rb_mMJIT, rb_intern("compile"))) { // [experimental] defining RubyVM::MJIT.compile allows you to replace JIT mjit_opts.custom = true; pch_status = PCH_SUCCESS; From 1f91dcdab3b530dde93fa29fba8bf60683cd8056 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 6 Sep 2022 15:15:47 +0900 Subject: [PATCH 16/18] Define BOOTSTRAPRUBY from HAVE_BASERUBY --- common.mk | 1 + configure.ac | 8 -------- template/Makefile.in | 7 +++++-- win32/Makefile.sub | 6 ++++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/common.mk b/common.mk index d57470373949bc..8d9fc0862906eb 100644 --- a/common.mk +++ b/common.mk @@ -195,6 +195,7 @@ INSTRUBY_ARGS = $(SCRIPT_ARGS) \ INSTALL_PROG_MODE = 0755 INSTALL_DATA_MODE = 0644 +BOOTSTRAPRUBY_COMMAND = $(BOOTSTRAPRUBY) $(BOOTSTRAPRUBY_OPT) TESTSDIR = $(srcdir)/test TOOL_TESTSDIR = $(tooldir)/test TEST_EXCLUDES = --excludes-dir=$(TESTSDIR)/excludes --name=!/memory_leak/ diff --git a/configure.ac b/configure.ac index f981d1aa701825..e5454f117e29ea 100644 --- a/configure.ac +++ b/configure.ac @@ -3348,8 +3348,6 @@ for var in bindir includedir libdir rubylibprefix; do done BTESTRUBY='$(MINIRUBY)' -BOOTSTRAPRUBY='$(BASERUBY)' -BOOTSTRAPRUBY_COMMAND='$(BOOTSTRAPRUBY)' AS_IF([test x"$cross_compiling" = xyes], [ test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`$CHDIR .; pwd` "-r'$(arch)-fake' XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']` @@ -3362,7 +3360,6 @@ AS_IF([test x"$cross_compiling" = xyes], [ RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`' RUNRUBY='$(RUNRUBY_COMMAND)' XRUBY='$(MINIRUBY)' - BOOTSTRAPRUBY_COMMAND='$(BOOTSTRAPRUBY) -r./$(arch)-fake' TEST_RUNNABLE=no CROSS_COMPILING=yes AC_DEFINE(CROSS_COMPILING, 1) @@ -3373,9 +3370,6 @@ AS_IF([test x"$cross_compiling" = xyes], [ RUNRUBY_COMMAND='$(MINIRUBY) $(tooldir)/runruby.rb --extout=$(EXTOUT) $(RUNRUBYOPT)' RUNRUBY='$(RUNRUBY_COMMAND) --' XRUBY='$(RUNRUBY)' - AS_CASE(["$HAVE_BASERUBY"], - [yes], [BOOTSTRAPRUBY_COMMAND='$(BOOTSTRAPRUBY) -r./$(arch)-fake'], - [BOOTSTRAPRUBY='$(MINIRUBY)']) TEST_RUNNABLE=yes CROSS_COMPILING=no ]) @@ -3387,8 +3381,6 @@ AC_SUBST(PREP) AC_SUBST(RUNRUBY_COMMAND) AC_SUBST(RUNRUBY) AC_SUBST(XRUBY) -AC_SUBST(BOOTSTRAPRUBY) -AC_SUBST(BOOTSTRAPRUBY_COMMAND) AC_SUBST(EXTOUT, [${EXTOUT=.ext}]) FIRSTMAKEFILE="" diff --git a/template/Makefile.in b/template/Makefile.in index 1e2a09139ef468..bfd18936e0046f 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -165,8 +165,11 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ XRUBY_LIBDIR = @XRUBY_LIBDIR@ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@ XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@ -BOOTSTRAPRUBY = @BOOTSTRAPRUBY@ -BOOTSTRAPRUBY_COMMAND = @BOOTSTRAPRUBY_COMMAND@ + +yes_baseruby = $(HAVE_BASERUBY:no=) +no_baseruby = $(HAVE_BASERUBY:yes=) +BOOTSTRAPRUBY = $(yes_baseruby:yes=$(BASERUBY)) $(no_baseruby:$(MINIRUBY)) +BOOTSTRAPRUBY_OPT = $(yes_baseruby:yes=-r./$(arch)-fake) COROUTINE_H = @X_COROUTINE_H@ COROUTINE_OBJ = $(COROUTINE_H:.h=.$(OBJEXT)) diff --git a/win32/Makefile.sub b/win32/Makefile.sub index b3d0a2f76e7266..e4b9a3cac88875 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -363,13 +363,15 @@ RUNRUBY = .\$(PROGRAM) -I$(srcdir)/lib -I"$(EXTOUT)/$(arch)" -I. !endif MINIRUBY = $(MINIRUBY) $(MINIRUBYOPT) RUNRUBY = $(RUNRUBY) "$(tooldir)/runruby.rb" --extout="$(EXTOUT)" $(RUNRUBYOPT) -- $(RUN_OPTS) +yes_baseruby = $(HAVE_BASERUBY:no=) +no_baseruby = $(HAVE_BASERUBY:yes=) !if "$(CROSS_COMPILING)" == "yes" XRUBY = $(MINIRUBY) BOOTSTRAPRUBY = $(BASERUBY) -BOOTSTRAPRUBY_COMMAND = $(BOOTSTRAPRUBY) -r./$(arch)-fake +BOOTSTRAPRUBY_OPT = -r./$(arch)-fake !else BOOTSTRAPRUBY = $(MINIRUBY) -BOOTSTRAPRUBY_COMMAND = $(BOOTSTRAPRUBY) +BOOTSTRAPRUBY_OPT = XRUBY = $(RUNRUBY) !endif BTESTRUBY = $(MINIRUBY) -r./$(arch)-fake From 35c493ecf5d71c9164bafe03ae8831445c207b2a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 7 Sep 2022 14:41:37 +0900 Subject: [PATCH 17/18] Dump cross.rb only when verbose [ci skip] --- common.mk | 2 +- tool/make-snapshot | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common.mk b/common.mk index 8d9fc0862906eb..f86bf3ff787e24 100644 --- a/common.mk +++ b/common.mk @@ -1333,7 +1333,7 @@ lldb-ruby: $(PROGRAM) PHONY DISTPKGS = gzip,zip,all PKGSDIR = tmp dist: - $(BASERUBY) $(tooldir)/make-snapshot \ + $(BASERUBY) $(V0:1=-v) $(tooldir)/make-snapshot \ -srcdir=$(srcdir) -packages=$(DISTPKGS) \ -unicode-version=$(UNICODE_VERSION) \ $(DISTOPTS) $(PKGSDIR) $(RELNAME) diff --git a/tool/make-snapshot b/tool/make-snapshot index b88bcdc2973cd0..02b5d182f5a213 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -22,6 +22,7 @@ $keep_temp ||= nil $patch_file ||= nil $packages ||= nil $digests ||= nil +$no7z ||= nil $tooldir = File.expand_path("..", __FILE__) $unicode_version = nil if ($unicode_version ||= nil) == "" $colorize = Colorize.new @@ -146,7 +147,7 @@ unless destdir = ARGV.shift end revisions = ARGV.empty? ? [nil] : ARGV -if $exported +if defined?($exported) abort "#{File.basename $0}: -exported option is deprecated; use -srcdir instead" end @@ -416,7 +417,7 @@ def package(vcs, rev, destdir, tmp = nil) f.puts "Object.__send__(:remove_const, :RUBY_VERSION)" f.puts "RUBY_VERSION='#{version}'" end - warn "cross.rb:", File.read("cross.rb").gsub(/^/, "> "), "" + puts "cross.rb:", File.read("cross.rb").gsub(/^/, "> "), "" if $VERBOSE unless File.exist?("configure") print "creating configure..." unless system([ENV["AUTOCONF"]]*2) From 2d57447ae80e0b0895d6d22d606391b48516ba93 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 7 Sep 2022 19:07:24 +0900 Subject: [PATCH 18/18] Fix missing replacement in 1f91dcdab3b --- template/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/Makefile.in b/template/Makefile.in index bfd18936e0046f..966170aa76c670 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -168,7 +168,7 @@ XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@ yes_baseruby = $(HAVE_BASERUBY:no=) no_baseruby = $(HAVE_BASERUBY:yes=) -BOOTSTRAPRUBY = $(yes_baseruby:yes=$(BASERUBY)) $(no_baseruby:$(MINIRUBY)) +BOOTSTRAPRUBY = $(yes_baseruby:yes=$(BASERUBY)) $(no_baseruby:no=$(MINIRUBY)) BOOTSTRAPRUBY_OPT = $(yes_baseruby:yes=-r./$(arch)-fake) COROUTINE_H = @X_COROUTINE_H@