jimmystewpot opened a new pull request, #3764:
URL: https://github.com/apache/brpc/pull/3764

   ### What problem does this PR solve?
   
   Issue Number: #3763
   
   Problem Summary:
   
   In commit `9d23af8e9` (#2670, *add bzlmod support*), 
`@bazel_tools//tools/osx:darwin` was replaced with 
`@bazel_tools//tools/osx:darwin_x86_64` across four `select(...)` blocks: three 
in the root `BUILD.bazel` and one in `test/BUILD.bazel` (`TEST_BUTIL_SOURCES` 
at line 134).
   
   Later, commit `418abca25` (#2846, *Fix build on macos with apple M1 chip*) 
updated the three occurrences in the root `BUILD.bazel` (lines 93, 284, and 
398) to `@bazel_tools//src/conditions:darwin` so both Intel (`darwin_x86_64`) 
and Apple Silicon (`darwin_arm64`) macOS match, **but the fourth occurrence in 
`test/BUILD.bazel:134` was missed**. As a result, running `bazel test 
//test:butil_unittests` on Apple Silicon (`darwin_arm64`) falls through to 
`"//conditions:default"` and attempts to compile the Linux-only unit test 
sources (`test_file_util_linux.cc` and `proc_maps_linux_unittest.cc`).
   
   Additionally, `//bazel/config:darwin` in `bazel/config/BUILD.bazel` (lines 
101–105) still used the legacy Bazel 4 `values = {"cpu": "darwin"}` selector 
rather than `constraint_values = ["@platforms//os:macos"]`.
   
   ### What is changed and the side effects?
   
   Changed:
   - **`test/BUILD.bazel`:** Updated `TEST_BUTIL_SOURCES` (line 134) from 
`"@bazel_tools//tools/osx:darwin_x86_64": []` to 
`"@bazel_tools//src/conditions:darwin": []` (consistent with the root 
`BUILD.bazel`) so Linux-only `butil` unit test files are excluded on both 
`darwin_x86_64` and `darwin_arm64`.
   - **`bazel/config/BUILD.bazel`:** Updated `//bazel/config:darwin` (line 103) 
from `values = {"cpu": "darwin"}` to `constraint_values = 
["@platforms//os:macos"]` (consistent with 
`bazel/third_party/openssl/openssl.BUILD`).
   
   Side effects:
   - Performance effects: None.
   - Breaking backward compatibility: No. Both `darwin_x86_64` and 
`darwin_arm64` macOS targets now resolve consistently across `BUILD.bazel`, 
`test/BUILD.bazel`, and `bazel/config/BUILD.bazel`.
   
   ---
   ### Check List:
   - Please make sure your changes are compilable.
   - When providing us with a new feature, it is best to add related tests.
   - Please follow [Contributor Covenant Code of 
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to