Skip to content

Commit

Permalink
pw_presubmit: Expose name of Bazel executable
Browse files Browse the repository at this point in the history
This will make the transition easier downstream.

Bug: 355438774
Change-Id: I76f6da37e523fe8cdf180a1fb619c56bbf85bd60
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/226378
Pigweed-Auto-Submit: Rob Mohr <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Ted Pudlik <[email protected]>
Commit-Queue: Rob Mohr <[email protected]>
  • Loading branch information
mohrr authored and CQ Bot Account committed Jul 29, 2024
1 parent 262f3ce commit eb94603
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions pw_presubmit/py/pw_presubmit/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
_LOG = logging.getLogger(__name__)


BAZEL_EXECUTABLE = 'bazel'


def bazel(
ctx: PresubmitContext,
cmd: str,
Expand Down Expand Up @@ -109,10 +112,16 @@ def bazel(
with (ctx.output_dir / 'bazel.output.base').open('w') as outs, (
ctx.output_dir / 'bazel.output.base.err'
).open('w') as errs:
call('bazel', 'info', 'output_base', tee=outs, stderr=errs)
call(
BAZEL_EXECUTABLE,
'info',
'output_base',
tee=outs,
stderr=errs,
)

call(
'bazel',
BAZEL_EXECUTABLE,
cmd,
'--verbose_failures',
'--worker_verbose',
Expand Down Expand Up @@ -482,7 +491,10 @@ def check_bazel_build_for_files(
for directory in bazel_dirs:
bazel_builds.update(
_get_paths_from_command(
directory, 'bazel', 'query', 'kind("source file", //...:*)'
directory,
BAZEL_EXECUTABLE,
'query',
'kind("source file", //...:*)',
)
)

Expand Down

0 comments on commit eb94603

Please sign in to comment.