Attempt to convince Bazel 7 that X64 can build for X86.

Change-Id: I0b205639d1c71ccea7be88312a41defdc4207817
Reviewed-on: https://code-review.googlesource.com/c/re2/+/62430
Reviewed-by: Paul Wankadia <junyer@google.com>
Reviewed-by: Perry Lorier <perryl@google.com>
This commit is contained in:
Paul Wankadia
2024-01-18 09:13:52 +00:00
parent 4e3b5cc548
commit 70abe6b3b1

View File

@@ -53,8 +53,12 @@ class BuildExt(setuptools.command.build_ext.build_ext):
cmd = ['bazel', 'build']
try:
cmd.append(f'--cpu={os.environ["BAZEL_CPU"].lower()}')
cmd.append(f'--platforms=//python:{os.environ["BAZEL_CPU"].lower()}')
cpu = os.environ['BAZEL_CPU']
cmd.append(f'--cpu={cpu}')
cmd.append(f'--platforms=//python:{cpu}')
if cpu == 'x64_x86_windows':
# Attempt to convince Bazel 7 that X64 can build for X86.
cmd.append('--extra_execution_platforms=//python:x64_windows')
except KeyError:
pass
# Register the local Python toolchain with highest priority.