google / fleetbench

Benchmarking suite for Google workloads
Apache License 2.0
111 stars 9 forks source link

FDO build failing due to missing bazel_tools #9

Closed iqbalIntel closed 9 months ago

iqbalIntel commented 1 year ago

I am trying to build fleetbench with FDO following these steps from FAQ -

Instrument.

bazel build --config=clang --config=opt --fdo_instrument=.fdo fleetbench/swissmap:hot_swissmap_benchmark

Run to generate instrumentation.

bazel-bin/fleetbench/swissmap/hot_swissmap_benchmark --benchmark_filter=all

There should be a file with a .profraw extension in $PWD/.fdo/.

Build an optimized binary.

bazel build --config=clang --config=opt --fdo_optimize=.fdo/.profraw fleetbench/swissmap:hot_swissmap_benchmark

Run the FDO-optimized binary.

bazel-bin/fleetbench/swissmap/hot_swissmap_benchmark --benchmark_filter=all

Clang15 and Bazel5

Build failing with this error - $ bazel build --config=clang --config=opt --fdo_optimize=.fdo/default_18006715353208796581_0.profraw fleetbench/swissmap:hot_swissmap_benchmark

DEBUG: /root/.cache/bazel/_bazel_root/9906b1d63bb73ec34cafd40427c4e498/external/rules_python/python/repositories.bzl:32:10: py_repositories is a no-op and is deprecated. You can remove this from your WORKSPACE file INFO: Build options --copt, --fdo_instrument, and --fdo_optimize have changed, discarding analysis cache. ERROR: /root/.cache/bazel/_bazel_root/9906b1d63bb73ec34cafd40427c4e498/external/local_config_cc/BUILD:57:13: every rule of type cc_toolchain implicitly depends upon the target '@bazel_tools//tools/zip:unzip_fdo', but this target could not be found because of: no such target '@bazel_tools//tools/zip:unzip_fdo': target 'unzip_fdo' not declared in package 'tools/zip' defined by /root/.cache/bazel/_bazel_root/9906b1d63bb73ec34cafd40427c4e498/external/bazel_tools/tools/zip/BUILD ERROR: Analysis of target '//fleetbench/swissmap:hot_swissmap_benchmark' failed; build aborted: INFO: Elapsed time: 0.341s INFO: 0 processes. FAILED: Build did NOT complete successfully (1 packages loaded, 820 targets configured)

rjogrady commented 1 year ago

This is https://github.com/bazelbuild/bazel/issues/13619, the fix was part of bazel version 6.