diff options
author | Yuta Saito <[email protected]> | 2024-05-15 07:58:41 +0000 |
---|---|---|
committer | git <[email protected]> | 2024-06-18 00:59:36 +0000 |
commit | 97a23db5acc87c3a44bd005aef00c8003f45adb4 (patch) | |
tree | 71d1497f6bca7e9f87e17eb9437413aaec647605 /lib/rubygems/ext | |
parent | 3e4b694565f8459c95283f6ec6aed52ad38cc57a (diff) |
[rubygems/rubygems] Disable `install_extension_in_lib` when cross-compiling
https://github.com/rubygems/rubygems/commit/643e154f32
Diffstat (limited to 'lib/rubygems/ext')
-rw-r--r-- | lib/rubygems/ext/ext_conf_builder.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb index 6645c56773..e652a221f8 100644 --- a/lib/rubygems/ext/ext_conf_builder.rb +++ b/lib/rubygems/ext/ext_conf_builder.rb @@ -45,7 +45,10 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder full_tmp_dest = File.join(extension_dir, tmp_dest_relative) - if Gem.install_extension_in_lib && lib_dir + is_cross_compiling = target_rbconfig["platform"] != RbConfig::CONFIG["platform"] + # Do not copy extension libraries by default when cross-compiling + # not to conflict with the one already built for the host platform. + if Gem.install_extension_in_lib && lib_dir && !is_cross_compiling FileUtils.mkdir_p lib_dir entries = Dir.entries(full_tmp_dest) - %w[. ..] entries = entries.map {|entry| File.join full_tmp_dest, entry } |