[前][次][番号順一覧][スレッド一覧]

ruby-changes:74006

From: nagachika <ko1@a...>
Date: Sat, 15 Oct 2022 17:28:37 +0900 (JST)
Subject: [ruby-changes:74006] fa2ddb67c5 (ruby_3_1): merge revision(s) 79fa27acc452c50ae47936880f91424e729fda72:

https://git.ruby-lang.org/ruby.git/commit/?id=fa2ddb67c5

From fa2ddb67c5a19d1c165fbba4102ca7a397fa50d5 Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@r...>
Date: Sat, 15 Oct 2022 16:33:24 +0900
Subject: merge revision(s) 79fa27acc452c50ae47936880f91424e729fda72:

	rbinstall: Also do `Gem.ruby` patching for unpacked bundled gems

	Pointing `Gem.ruby` to the newly installed ruby gives mkmf the right
	inputs to build extensions in bundled gems. Previously, this patching
	was only done for compressed bundled gems.

	This patch also prevents `tool/fake.rb` from propagating to the child
	process running mkmf for the native extension. The way `tool/fake.rb`
	changes mkmf variables using `Kernel#trace_var` created spooky action at
	a distance which made debugging difficult.

	AppVeyor Windows CI started to fail starting with
	8a3663789c52ec5635194656af6b69d3d03120ee because it enabled extension
	building for bundled gems on mswin. This patch should address the CI
	failures.
	---
	 tool/rbinstall.rb | 8 +++++++-
	 1 file changed, 7 insertions(+), 1 deletion(-)
---
 tool/rbinstall.rb | 8 +++++++-
 version.h         | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index b7ecb9a47b..b643fc8676 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -1034,6 +1034,13 @@ install?(:ext, :comm, :gem, :'bundled-gems') do https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L1034
   specifications_dir = File.join(gem_dir, "specifications")
   build_dir = Gem::StubSpecification.gemspec_stub("", ".bundle", ".bundle").extensions_dir
 
+  # We are about to build extensions, and want to configure extensions with the
+  # newly installed ruby.
+  Gem.instance_variable_set(:@ruby, with_destdir(File.join(bindir, ruby_install_name)))
+  # Prevent fake.rb propagation. It conflicts with the natural mkmf configs of
+  # the newly installed ruby.
+  ENV.delete('RUBYOPT')
+
   File.foreach("#{srcdir}/gems/bundled_gems") do |name|
     next if /^\s*(?:#|$)/ =~ name
     next unless /^(\S+)\s+(\S+).*/ =~ name
@@ -1061,7 +1068,6 @@ install?(:ext, :comm, :gem, :'bundled-gems') do https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L1068
   end
   next if gems.empty?
   if defined?(Zlib)
-    Gem.instance_variable_set(:@ruby, with_destdir(File.join(bindir, ruby_install_name)))
     silent = Gem::SilentUI.new
     gems.each do |gem|
       package = Gem::Package.new(gem)
diff --git a/version.h b/version.h
index 7b96013c08..b8964bd1be 100644
--- a/version.h
+++ b/version.h
@@ -11,7 +11,7 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L11
 # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
 #define RUBY_VERSION_TEENY 3
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 84
+#define RUBY_PATCHLEVEL 85
 
 #define RUBY_RELEASE_YEAR 2022
 #define RUBY_RELEASE_MONTH 10
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]