fix(bazel): test/BUILD.bazel uses darwin_x86_64 instead of darwin condition, breaking //test:butil_unittests on Apple Silicon (darwin_arm64)
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- build-system, testing
Research direction
Read test/BUILD.bazel around lines 133–139 and compare the Darwin condition with the examples in the root BUILD.bazel. Run bazel test //test:butil_unittests on Apple Silicon to reproduce the Linux-only source compilation failure. Done when the Darwin condition excludes those sources on both Intel and Apple Silicon macOS.
Written by the indexing model from the issue text.
Description
Describe the bug
In test/BUILD.bazel (lines 133–139), TEST_BUTIL_SOURCES excludes the Linux-only unit test sources (test_file_util_linux.cc and proc_maps_linux_unittest.cc) using @bazel_tools//tools/osx:darwin_x86_64:
] + select({
"@bazel_tools//tools/osx:darwin_x86_64": [],
"//conditions:default": [
"test_file_util_linux.cc",
"proc_maps_linux_unittest.cc",
],
})
Unlike the root BUILD.bazel (which uses @bazel_tools//src/conditions:darwin at lines 93, 284, and 398 to match both Intel and Apple Silicon macOS), @bazel_tools//tools/osx:darwin_x86_64 only matches Intel macOS (x86_64).
On Apple Silicon (darwin_arm64), running bazel test //test:butil_unittests falls through to "//conditions:default" and attempts to compile test_file_util_linux.cc and proc_maps_linux_unittest.cc (failing on Linux-only headers such as <sys/vfs.h>).
Expected behaviour
test/BUILD.bazel should use @bazel_tools//src/conditions:darwin (consistent with the root BUILD.bazel) so bazel test //test:butil_unittests excludes the Linux-only source files on both darwin_x86_64 and darwin_arm64.
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.2k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 72
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/brpc
-
endpoint2hostname() prints a byte-swapped port for IPv6 endpointsPossibly taken @0z5a claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
perf(butil): ARM64 (aarch64) performance and modernisation improvements across atomics, CRC32C, spin-wait hints, and fast timersPossibly taken @jimmystewpot claimed this 1 day ago. Open
Difficulty 5/5 Over a week Newbie friendliness 12/100
Maintainers usually reply within 2 days
-
file:// naming service takes a comment after the address as the tagPossibly taken @0z5a claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 2 days
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
apache/brpc#3707 · 3 comments ·
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
protocolbuffers/protobuf#31768 ·
Maintainers usually reply within 1 day
-
Needs: Triage :mag: Platform: Android
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react/react-native#60167 ·
Maintainers usually reply within 2 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
-
tests: ofx_render_test doesn't compile against FFmpeg 4.x (const AVCodec* to av_find_best_stream)Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NatronGitHub/openfx-io#221 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
subsurface/subsurface#5145 ·
Maintainers usually reply within 2 days