Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDO build failing due to missing bazel_tools #9

Closed
iqbalIntel opened this issue Feb 15, 2023 · 1 comment
Closed

FDO build failing due to missing bazel_tools #9

iqbalIntel opened this issue Feb 15, 2023 · 1 comment

Comments

@iqbalIntel
Copy link

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
Copy link
Contributor

This is bazelbuild/bazel#13619, the fix was part of bazel version 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants