Skip to content

Commit 9f1d1ad

Browse files
committed
[GR-18930] Ignore env variables CC, CFLAGS, and LDFLAGS when building C API.
PullRequest: graalpython/695
2 parents 81aa8f9 + 005206b commit 9f1d1ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,12 @@ def __str__(self):
11671167
return 'Building C API project {} with setuptools'.format(self.subject.name)
11681168

11691169
def run(self, args, env=None, cwd=None):
1170+
env = env.copy() if env else os.environ.copy()
1171+
1172+
# distutils will honor env variables CC, CFLAGS, LDFLAGS but we won't allow to change them
1173+
for var in ["CC", "CFLAGS", "LDFLAGS"]:
1174+
env.pop(var, None)
1175+
11701176
return do_run_python(args, env=env, cwd=cwd, out=self.PrefixingOutput(self.subject.name, mx.log), err=self.PrefixingOutput(self.subject.name, mx.log_error))
11711177

11721178
def _dev_headers_dir(self):

0 commit comments

Comments
 (0)