summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2025-02-21 13:34:23 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2025-06-12 14:28:43 +0900
commit166ff187bd2a84fddd7a633bdbdbcd4ae393c91e (patch)
treee28c85457b395399b8addfe2712bdccee0b33606 /lib
parent4585ccd90f4251f4d42bfc338a5e14100236fa15 (diff)
[rubygems/rubygems] Removed ccache or sccache from args of Rust builder
``` " = note: some arguments are omitted. use `--verbose` to show all linker arguments\n" + " = note: error: unexpected argument '-W' found\n" + " \n" + " tip: to pass '-W' as a value, use '-- -W'\n" + " \n" + " Usage: sccache [OPTIONS] <--dist-auth|--debug-preprocessor-cache|--dist-status|--show-stats|--show-adv-stats|--start-server|--stop-server|--zero-stats|--package-toolchain <EXE> <OUT>|CMD>\n" + " \n" + " For more information, try '--help'.\n" + " \n" + ``` https://github.com/rubygems/rubygems/commit/45e688ae62
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/ext/cargo_builder.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rubygems/ext/cargo_builder.rb b/lib/rubygems/ext/cargo_builder.rb
index 03024a640e..21b50f394d 100644
--- a/lib/rubygems/ext/cargo_builder.rb
+++ b/lib/rubygems/ext/cargo_builder.rb
@@ -158,6 +158,10 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
# mkmf work properly.
def linker_args
cc_flag = self.class.shellsplit(makefile_config("CC"))
+ # Avoid to ccache like tool from Rust build
+ # see https://github.com/rubygems/rubygems/pull/8521#issuecomment-2689854359
+ # ex. CC="ccache gcc" or CC="sccache clang --any --args"
+ cc_flag.shift if cc_flag.size >= 2 && !cc_flag[1].start_with?("-")
linker = cc_flag.shift
link_args = cc_flag.flat_map {|a| ["-C", "link-arg=#{a}"] }