Use --enable_platform_specific_config in .bazelrc.

This magically applies the `linux`, `macos` or `windows` configuration
depending on the OS. Apart from simplifying things for us, this should
hopefully also unbreak the RE2 build that Bazel folks run in their CI.

Fixes #428.

Change-Id: I2f4192dd728661558a8c4c4c8dd68a720af3ff71
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61370
Reviewed-by: Perry Lorier <perryl@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
This commit is contained in:
Paul Wankadia
2023-05-26 10:10:36 +00:00
parent 63aeffa8d0
commit 03da4fc085
4 changed files with 7 additions and 10 deletions

View File

@@ -45,7 +45,7 @@ Known issues with regard to building the C++ extension:
class BuildExt(setuptools.command.build_ext.build_ext):
def build_extension(self, ext):
if 'RUNNER_OS' not in os.environ:
if 'GITHUB_ACTIONS' not in os.environ:
return super().build_extension(ext)
# For @pybind11_bazel's `python_configure()`.
@@ -55,7 +55,6 @@ class BuildExt(setuptools.command.build_ext.build_ext):
self.spawn(cmd)
cmd = ['bazel', 'build']
cmd.append(f'--config={os.environ["RUNNER_OS"].lower()}')
if 'BAZEL_CPU' in os.environ:
cmd.append(f'--cpu={os.environ["BAZEL_CPU"].lower()}')
cmd += ['--compilation_mode=opt', '--', ':all']