Try using bazelbuild/setup-bazelisk everywhere.

This should hopefully mean that the `bazel`
command found first in the path is actually
Bazelisk.

Revert various previous attempts to get all
this working...

Change-Id: I9a6267aff334de3dc55c7333d83e67ad2ad4ef05
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61610
Reviewed-by: Perry Lorier <perryl@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
This commit is contained in:
Paul Wankadia
2023-07-28 13:17:41 +00:00
parent c20f76ecc5
commit 44277d289e
5 changed files with 23 additions and 17 deletions

View File

@@ -45,13 +45,13 @@ Known issues with regard to building the C++ extension:
class BuildExt(setuptools.command.build_ext.build_ext):
def build_extension(self, ext):
if 'BAZELISK' not in os.environ:
if 'GITHUB_ACTIONS' not in os.environ:
return super().build_extension(ext)
# For @pybind11_bazel's `python_configure()`.
os.environ['PYTHON_BIN_PATH'] = sys.executable
cmd = [os.environ['BAZELISK'], 'build']
cmd = ['bazel', 'build']
if 'BAZEL_CPU' in os.environ:
cmd.append(f'--cpu={os.environ["BAZEL_CPU"].lower()}')
cmd += ['--compilation_mode=opt', '--', ':all']
@@ -62,7 +62,7 @@ class BuildExt(setuptools.command.build_ext.build_ext):
shutil.copyfile('../bazel-bin/python/_re2.so',
self.get_ext_fullpath(ext.name))
cmd = [os.environ['BAZELISK'], 'clean', '--expunge']
cmd = ['bazel', 'clean', '--expunge']
self.spawn(cmd)