Skip to content

Fix Bazel build on Bazel 6.0.0 #1094

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

Merged
merged 1 commit into from
Dec 28, 2022
Merged

Conversation

wjuni
Copy link
Contributor

@wjuni wjuni commented Dec 28, 2022

While trying to build the sort example (https://github.com/google/highway/tree/master/hwy/contrib/sort), it seems that the Bazel build fails with the following error:

ERROR: /home/wjuni/.cache/bazel/_bazel_wjuni/672b509305a448efd90e51f59e30c6de/external/bazel_tools/platforms/BUILD:89:6: in alias rule @bazel_tools//platforms:windows: Constraints from @bazel_tools//platforms have been removed. Please use constraints from @platforms repository embedded in Bazel, or preferably declare dependency on https://github.com/bazelbuild/platforms. See https://github.com/bazelbuild/bazel/issues/8622 for details.
ERROR: /home/wjuni/.cache/bazel/_bazel_wjuni/672b509305a448efd90e51f59e30c6de/external/bazel_tools/platforms/BUILD:89:6: Analysis of target '@bazel_tools//platforms:windows' failed
ERROR: /home/wjuni/.cache/bazel/_bazel_wjuni/672b509305a448efd90e51f59e30c6de/external/com_google_googletest/BUILD.bazel:116:11: errors encountered resolving select() keys for @com_google_googletest//:gtest_main
ERROR: Analysis of target '//hwy/contrib/sort:bench_sort' failed; build aborted: 
INFO: Elapsed time: 1.247s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 0 targets configured)

As shown in the error message, this is due to the breaking change in Bazel 6 introduced at bazelbuild/bazel#8622 .

It seems that highway includes GoogleTest as its dependency, and there is an issue on the GoogleTest version being used here (google/googletest@6092810). GoogleTest fixes this issue with the new Bazel at google/googletest@5c08f92 .

I suggest bumping up the version of GoogleTest to 1.11.0 (google/googletest@e2239ee) which is the minimum release version that fixes this issue.

@google-cla
Copy link

google-cla bot commented Dec 28, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jan-wassenberg
Copy link
Member

Than you @wjuni , sounds good!

@copybara-service copybara-service bot merged commit 78c4690 into google:master Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants