Copilot commented on code in PR #3428:
URL: https://github.com/apache/brpc/pull/3428#discussion_r3958358536


##########
BUILD.bazel:
##########
@@ -547,12 +561,20 @@ cc_library(
         "src/brpc/policy/thrift_protocol.cpp",
         "src/brpc/event_dispatcher_epoll.cpp",
         "src/brpc/event_dispatcher_kqueue.cpp",
+        "src/brpc/urma/*.cpp",
+        "src/brpc/urma/**/*.cpp",
     ]) + select({
         "//bazel/config:brpc_with_thrift": glob([
             "src/brpc/thrift*.cpp",
             "src/brpc/**/thrift*.cpp",
         ]),
         "//conditions:default": [],
+    }) + select({
+        "//bazel/config:brpc_with_urma_use_real": URMA_SRCS,
+        "//bazel/config:brpc_with_urma": URMA_SRCS + [
+            "src/brpc/urma/mock_urma.cpp",
+        ],
+        "//conditions:default": [],
     }),

Review Comment:
   URMA sources are included unconditionally via the base `glob([... 
'src/brpc/urma/*.cpp', 'src/brpc/urma/**/*.cpp', ...])` and then included again 
via the URMA `select(...)`, which can cause duplicate-source errors and also 
defeats the intent to include `mock_urma.cpp` only in mock builds (and exclude 
it when linking the real `-lurma`). Remove URMA globs from the base `glob(...)` 
and rely solely on the `select(...)` (or exclude the URMA paths from the base 
glob) so URMA sources (and especially `mock_urma.cpp`) are only compiled in the 
intended configurations.



-- 
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