fix(bazel): test/BUILD.bazel uses darwin_x86_64 instead of darwin condition, breaking //test:butil_unittests on Apple Silicon (darwin_arm64)

Đang mở Phù hợp với người mới
#3,763 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
build-system, testing

Hướng nghiên cứu

Đọc test/BUILD.bazel quanh dòng 133–139 và so sánh điều kiện Darwin với các ví dụ trong BUILD.bazel ở thư mục gốc. Chạy bazel test //test:butil_unittests trên Apple Silicon để tái hiện lỗi biên dịch các tệp nguồn chỉ dành cho Linux. Hoàn tất khi điều kiện Darwin loại trừ các tệp nguồn đó trên cả macOS dùng Intel lẫn Apple Silicon.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
17.6k
Fork
4.2k
Merge trung bình
3 ngày 17 giờ
Pull request đã merge (30 ngày)
72

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/brpc

Tất cả issue của apache/brpc

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.