Skip to content

Commit

Permalink
Attempt to convince Bazel 7 that X64 can build for X86.
Browse files Browse the repository at this point in the history
Change-Id: I0b205639d1c71ccea7be88312a41defdc4207817
Reviewed-on: https://code-review.googlesource.com/c/re2/+/62430
Reviewed-by: Paul Wankadia <[email protected]>
Reviewed-by: Perry Lorier <[email protected]>
  • Loading branch information
junyer committed Jan 18, 2024
1 parent 4e3b5cc commit 70abe6b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ def build_extension(self, 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.
Expand Down

0 comments on commit 70abe6b

Please sign in to comment.