Skip to content

Commit

Permalink
ruby: Avoid environment flags when building gprc code
Browse files Browse the repository at this point in the history
#27660 caused `CPPFLAGS` to inherit
from the environment, but this can cause the Makefile to use external
include files for re2 and other libraries if `-I` flags are defined.

This commit reverts to the original behavior of only using
`RbConfig::CONFIG` values to avoid using the wrong headers.
  • Loading branch information
stanhu committed Mar 18, 2023
1 parent 8cc4ac4 commit 3496434
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/ruby/ext/grpc/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,11 @@

ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.10'

def env_unset?(name)
ENV[name].nil? || ENV[name].size == 0
end

def rbconfig_set?(name)
RbConfig::CONFIG[name] && RbConfig::CONFIG[name].size > 0
end

def inherit_rbconfig(name)
ENV[name] = RbConfig::CONFIG[name] if env_unset?(name) && rbconfig_set?(name)
ENV[name] = RbConfig::CONFIG[name] || ''
end

def env_append(name, string)
ENV[name] ||= ''
ENV[name] += ' ' + string
end

Expand Down

0 comments on commit 3496434

Please sign in to comment.