Check cpu features more portably in test_libs.sh#758
Merged
Conversation
The previous commands to get cpu features on Windows failed on GitHub Windows-2022 runners. It seems the underlying commands used by the script changed. The new approach in this commit uses the Python `py-cpuinfo` package, which works on Windows and has the bonus of working on Mac and Linux too, allowing us to simply the test_libs.sh further.
f6e8388 to
8cba9aa
Compare
sergeisakov
approved these changes
Jun 13, 2025
mhucka
added a commit
that referenced
this pull request
Jun 18, 2025
The documented way that `bazel build`, `bazel test`, and similar commands behave without options like `--config=avx` is that the AVX, SSE, and other optimization options are not applied. However, this was not what was happening: the default ended up applying them. The previous changes to `.bazelrc` and `dev_tools/test_libs.sh` that I did in PR #758 and other recent PRs not fully address this. The changes here invert the way `--build_tag_filters` and `--test_tag_filters` are used: they are set to filter out things tagged with `avx` and `sse` by default in `.bazelrc`, and options like `--config=sse` add the things back. To make this work, `dev_tools/test_libs.sh` has to be updated as well.
mhucka
added a commit
that referenced
this pull request
Jun 18, 2025
The documented way that `bazel build`, `bazel test`, and similar commands behave without options like `--config=avx` is that the AVX, SSE, and other optimization options are not applied. However, this was not what was happening: the default ended up applying them. The previous changes to `.bazelrc` and `dev_tools/test_libs.sh` that I did in PR #758 and other recent PRs not fully address this. The changes here invert the way `--build_tag_filters` and `--test_tag_filters` are used: they are set to filter out things tagged with `avx` and `sse` by default in `.bazelrc`, and options like `--config=sse` add the things back. To make this work, `dev_tools/test_libs.sh` has to be updated as well.
mhucka
added a commit
that referenced
this pull request
Jun 18, 2025
The documented way that `bazel build`, `bazel test`, and similar commands behave without options like `--config=avx` is that the AVX, SSE, and other optimization options are not applied. However, this was not what was happening: the default ended up applying them. The previous changes to `.bazelrc` and `dev_tools/test_libs.sh` that I did in PR #758 and other recent PRs not fully address this. The changes here invert the way `--build_tag_filters` and `--test_tag_filters` are used: they are set to filter out things tagged with `avx` and `sse` by default in `.bazelrc`, and options like `--config=sse` add the things back. To make this work, `dev_tools/test_libs.sh` has to be updated as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous commands to get cpu features on Windows failed on GitHub Windows-2022 runners. It seems the underlying commands used by the script changed. The new approach in this commit uses the Python
py-cpuinfopackage, which works on Windows and has the bonus of working on Mac and Linux too, allowing us to simply the test_libs.sh further.