From 554161236a263e47f6a2590bafbf9e7b59415736 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Wed, 7 Dec 2022 00:07:46 -0500 Subject: [rubygems/rubygems] Always build in release mode https://github.com/rubygems/rubygems/commit/7b84fc1f19 --- lib/rubygems/ext/cargo_builder.rb | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'lib') diff --git a/lib/rubygems/ext/cargo_builder.rb b/lib/rubygems/ext/cargo_builder.rb index 24c1d3ae6e..3377c9a8ad 100644 --- a/lib/rubygems/ext/cargo_builder.rb +++ b/lib/rubygems/ext/cargo_builder.rb @@ -52,7 +52,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder cmd += ["--manifest-path", manifest] cmd += ["--lib"] cmd += ["--profile", profile.to_s] - cmd += ["--locked"] if profile == :release + cmd += ["--locked"] cmd += Gem::Command.build_args cmd += args cmd += ["--"] @@ -75,7 +75,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder *rustc_dynamic_linker_flags(dest_dir), *rustc_lib_flags(dest_dir), *platform_specific_rustc_args(dest_dir), - *debug_flags, ] end @@ -149,7 +148,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder prefix = so_ext == "dll" ? "" : "lib" path_parts = [dest_path] path_parts << ENV["CARGO_BUILD_TARGET"] if ENV["CARGO_BUILD_TARGET"] - path_parts += [profile_target_directory, "#{prefix}#{cargo_crate_name}.#{so_ext}"] + path_parts += ["release", "#{prefix}#{cargo_crate_name}.#{so_ext}"] File.join(*path_parts) end @@ -254,13 +253,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder RbConfig.expand(val.dup) end - # Good balance between binary size and debugability - def debug_flags - return [] if profile == :dev - - ["-C", "debuginfo=1"] - end - # Copied from ExtConfBuilder def finalize_directory(dest_path, lib_dir, extension_dir) require "fileutils" @@ -299,14 +291,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder path end - def profile_target_directory - case profile - when :release then "release" - when :dev then "debug" - else raise "unknown target directory for profile: #{profile}" - end - end - # Error raised when no cdylib artifact was created class DylibNotFoundError < StandardError def initialize(dir) -- cgit v1.2.3