summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-11-22 20:32:19 +0900
committernagachika <nagachika@ruby-lang.org>2022-11-22 21:50:22 +0900
commit14704023ec57546b1bed85d54f4f425986385ab4 (patch)
treedbf1b3479c60dcb6a4bf71eb464b85a2ab080e54 /lib
parentb102175b4dcfebe7455e3b27653fab0288f68326 (diff)
Merge RubyGems-3.3.26 and Bundler-2.3.26
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--lib/bundler/man/bundle-clean.12
-rw-r--r--lib/bundler/man/bundle-clean.1.ronn2
-rw-r--r--lib/bundler/rubygems_ext.rb22
-rw-r--r--lib/bundler/version.rb2
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/ext/cargo_builder.rb4
7 files changed, 31 insertions, 5 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 3ba4d0f8c4..c5edfadd37 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -620,7 +620,7 @@ module Bundler
method_option "dry-run", :type => :boolean, :default => false, :banner =>
"Only print out changes, do not clean gems"
method_option "force", :type => :boolean, :default => false, :banner =>
- "Forces clean even if --path is not set"
+ "Forces cleaning up unused gems even if Bundler is configured to use globally installed gems. As a consequence, removes all system gems except for the ones in the current application."
def clean
require_relative "cli/clean"
Clean.new(options.dup).run
diff --git a/lib/bundler/man/bundle-clean.1 b/lib/bundler/man/bundle-clean.1
index f89ae3a1b0..27e249cb64 100644
--- a/lib/bundler/man/bundle-clean.1
+++ b/lib/bundler/man/bundle-clean.1
@@ -20,5 +20,5 @@ Print the changes, but do not clean the unused gems\.
.
.TP
\fB\-\-force\fR
-Force a clean even if \fB\-\-path\fR is not set\.
+Forces cleaning up unused gems even if Bundler is configured to use globally installed gems\. As a consequence, removes all system gems except for the ones in the current application\.
diff --git a/lib/bundler/man/bundle-clean.1.ronn b/lib/bundler/man/bundle-clean.1.ronn
index de23991782..dae27c21ee 100644
--- a/lib/bundler/man/bundle-clean.1.ronn
+++ b/lib/bundler/man/bundle-clean.1.ronn
@@ -15,4 +15,4 @@ useful when you have made many changes to your gem dependencies.
* `--dry-run`:
Print the changes, but do not clean the unused gems.
* `--force`:
- Force a clean even if `--path` is not set.
+ Forces cleaning up unused gems even if Bundler is configured to use globally installed gems. As a consequence, removes all system gems except for the ones in the current application.
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index d53d688009..12d6789065 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -308,6 +308,28 @@ module Gem
end
end
+ # On universal Rubies, resolve the "universal" arch to the real CPU arch, without changing the extension directory.
+ class Specification
+ if /^universal\.(?<arch>.*?)-/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
+ local_platform = Platform.local
+ if local_platform.cpu == "universal"
+ ORIGINAL_LOCAL_PLATFORM = local_platform.to_s.freeze
+
+ local_platform.cpu = if arch == "arm64e" # arm64e is only permitted for Apple system binaries
+ "arm64"
+ else
+ arch
+ end
+
+ def extensions_dir
+ Gem.default_ext_dir_for(base_dir) ||
+ File.join(base_dir, "extensions", ORIGINAL_LOCAL_PLATFORM,
+ Gem.extension_api_version)
+ end
+ end
+ end
+ end
+
require "rubygems/util"
Util.singleton_class.module_eval do
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index 953e62c610..4957902683 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: false
module Bundler
- VERSION = "2.3.25".freeze
+ VERSION = "2.3.26".freeze
def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 8a70822890..bad8e80d0d 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -8,7 +8,7 @@
require "rbconfig"
module Gem
- VERSION = "3.3.25".freeze
+ VERSION = "3.3.26".freeze
end
# Must be first since it unloads the prelude from 1.9.2
diff --git a/lib/rubygems/ext/cargo_builder.rb b/lib/rubygems/ext/cargo_builder.rb
index e33b07a8a2..24c1d3ae6e 100644
--- a/lib/rubygems/ext/cargo_builder.rb
+++ b/lib/rubygems/ext/cargo_builder.rb
@@ -37,6 +37,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
def build_env
build_env = rb_config_env
build_env["RUBY_STATIC"] = "true" if ruby_static? && ENV.key?("RUBY_STATIC")
+ build_env["RUSTFLAGS"] = "#{ENV["RUSTFLAGS"]} --cfg=rb_sys_gem".strip
build_env
end
@@ -92,6 +93,9 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
# run on one that isn't the missing libraries will cause the extension
# to fail on start.
flags += ["-C", "link-arg=-static-libgcc"]
+ elsif darwin_target?
+ # Ventura does not always have this flag enabled
+ flags += ["-C", "link-arg=-Wl,-undefined,dynamic_lookup"]
end
flags