mirror of
https://fuchsia.googlesource.com/third_party/pigweed.googlesource.com/pigweed/pigweed
synced 2024-09-21 06:12:09 +00:00
pw_presubmit: Add message about the Bazel cache
Sometimes the Bazel cache gets in a bad state where it complains about undeclared inclusions on C standard library headers. The only way to fix this is to delete the Bazel cache. This adds a message to the presubmit about how to clear the cache if the Bazel build fails. Fixed: 114 Change-Id: I7c3ad45bdce919a325f721f2071e99c1e56582c0
This commit is contained in:
parent
bab0e20539
commit
6908e47768
|
@ -280,15 +280,21 @@ CMAKE = (cmake_tests, )
|
|||
#
|
||||
@filter_paths(endswith=(*format_code.C_FORMAT.extensions, '.bzl', 'BUILD'))
|
||||
def bazel_test(ctx: PresubmitContext):
|
||||
call('bazel',
|
||||
'test',
|
||||
'//...',
|
||||
'--verbose_failures',
|
||||
'--verbose_explanations',
|
||||
'--worker_verbose',
|
||||
'--symlink_prefix',
|
||||
ctx.output_directory.joinpath('bazel-'),
|
||||
cwd=ctx.repository_root)
|
||||
try:
|
||||
call('bazel',
|
||||
'test',
|
||||
'//...',
|
||||
'--verbose_failures',
|
||||
'--verbose_explanations',
|
||||
'--worker_verbose',
|
||||
'--symlink_prefix',
|
||||
ctx.output_directory.joinpath('bazel-'),
|
||||
cwd=ctx.repository_root)
|
||||
except:
|
||||
_LOG.info('If the Bazel build inexplicably fails while the '
|
||||
'other builds are passing, try deleting the Bazel cache:\n'
|
||||
' rm -rf ~/.cache/bazel')
|
||||
raise
|
||||
|
||||
|
||||
BAZEL = (bazel_test, )
|
||||
|
|
Loading…
Reference in New Issue
Block a user