Skip to content

Commit 3decf7d

Browse files
committed
merge revision(s) 3a7367c: [Backport #19403]
mkconfig: Map `includedir` only for system ruby Only when installing to the system path on macOS, prepend '$(SDKROOT)' and remap `includedir`. Fix rbenv/ruby-build#2123 --- test/mkmf/test_config.rb | 4 ++-- test/test_rbconfig.rb | 9 --------- tool/mkconfig.rb | 4 +++- 3 files changed, 5 insertions(+), 12 deletions(-)
1 parent 7246cd0 commit 3decf7d

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

test/mkmf/test_config.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
class TestMkmfConfig < Test::Unit::TestCase
88
def test_dir_config
99
bug8074 = '[Bug #8074]'
10-
lib = RbConfig.expand(RbConfig::MAKEFILE_CONFIG["libdir"], "exec_prefix"=>"")
10+
lib = RbConfig.expand(RbConfig::MAKEFILE_CONFIG["libdir"], "exec_prefix"=>"/test/foo")
1111
assert_separately %w[-rmkmf - -- --with-foo-dir=/test/foo], %{
12-
assert_equal(%w[/test/foo/include /test/foo#{lib}], dir_config("foo"), #{bug8074.dump})
12+
assert_equal(%w[/test/foo/include #{lib}], dir_config("foo"), #{bug8074.dump})
1313
}
1414
end
1515
end

test/test_rbconfig.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,4 @@ def test_vendorarchdirs
5151
assert_match(/\$\(sitearch|\$\(rubysitearchprefix\)/, val, "#{key} #{bug7823}")
5252
end
5353
end
54-
55-
if /darwin/ =~ RUBY_PLATFORM
56-
def test_sdkroot
57-
assert_separately([{"SDKROOT" => "$(prefix)/SDKRoot"}], "#{<<~"begin;"}\n#{<<~'end;'}")
58-
begin;
59-
assert_equal RbConfig::CONFIG["prefix"]+"/SDKRoot", RbConfig::CONFIG["SDKROOT"]
60-
end;
61-
end
62-
end
6354
end

tool/mkconfig.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ module RbConfig
276276
print <<EOS if $unicode_emoji_version
277277
CONFIG["UNICODE_EMOJI_VERSION"] = #{$unicode_emoji_version.dump}
278278
EOS
279-
print <<EOS if /darwin/ =~ arch
279+
print prefix.start_with?("/System/") ? <<EOS : <<EOS if /darwin/ =~ arch
280280
if sdkroot = ENV["SDKROOT"]
281281
sdkroot = sdkroot.dup
282282
elsif File.exist?(File.join(CONFIG["prefix"], "include")) ||
@@ -286,6 +286,8 @@ module RbConfig
286286
sdkroot.chomp!
287287
end
288288
CONFIG["SDKROOT"] = sdkroot
289+
EOS
290+
CONFIG["SDKROOT"] = ""
289291
EOS
290292
print <<EOS
291293
CONFIG["platform"] = #{platform || '"$(arch)"'}

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
1212
#define RUBY_VERSION_TEENY 0
1313
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
14-
#define RUBY_PATCHLEVEL 29
14+
#define RUBY_PATCHLEVEL 30
1515

1616
#include "ruby/version.h"
1717
#include "ruby/internal/abi.h"

0 commit comments

Comments
 (0)