Skip to content

fix: address URMA transport review feedback and build support - #10

Closed
cw20050111-prog wants to merge 17 commits into
LinQuickDev:urma_transportfrom
cw20050111-prog:3428
Closed

fix: address URMA transport review feedback and build support#10
cw20050111-prog wants to merge 17 commits into
LinQuickDev:urma_transportfrom
cw20050111-prog:3428

Conversation

@cw20050111-prog

Copy link
Copy Markdown

Summary

This PR addresses reviewer feedback for URMA transport support and completes the related Bazel, CMake, CI, and example build updates.

Changes

  • Rename review-noted URMA symbols and tests for clearer URMA terminology.
  • Derive IOBuf block sizing from sizeof(butil::IOBuf::Block) instead of relying on a hard-coded header size.
  • Pin the UMDK dependency to an immutable commit.
  • Add Bazel build documentation for URMA and document current limitations.
  • Add the missing Bazel package marker for the UMDK third-party build file.
  • Strip upstream UMDK src/urma/BUILD.bazel during Bazel fetch so the local umdk_headers glob works correctly.
  • Require explicit opt-in for the URMA link-time mock.
  • Improve CMake and example linking logic for liburma.
  • Add Linux CI coverage for WITH_URMA=ON.
  • Fix mock_urma.cpp compatibility for C++14 builds by using std::shared_timed_mutex.

Validation

  • Passed existing CI on the corresponding branch.

cw20050111-prog and others added 17 commits August 20, 2026 14:22
- Rename ack_bit_is_rdma_ok to ack_bit_is_urma_ok.
- Replace hard-coded IOBuf block header size with sizeof(butil::IOBuf::Block).
- Pin UMDK dependency to a specific commit instead of a mutable tag.
Reviewer noted docs/cn/urma.md only covered the CMake build and that
DOWNLOAD_URMA_HEADERS has no Bazel equivalent. Document the Bazel
build command and clarify that Bazel always fetches UMDK headers from
the pinned git_repository commit and always links the mock backend
(no real-liburma detection yet), and that urma_performance has no
Bazel target.
bazel/third_party/umdk only contained umdk.BUILD, unlike every other
bazel/third_party/<dep> directory which pairs its <dep>.BUILD with an
empty BUILD.bazel marking the directory as a package. Without it,
resolving the git_repository(build_file = "//bazel/third_party/umdk:umdk.BUILD")
label fails once the umdk repo is actually fetched:

  Error in read: Unable to load package for //bazel/third_party/umdk:umdk.BUILD:
  BUILD file not found ...

This broke `bazel build --define=BRPC_WITH_URMA=true //:brpc` on both
x86_64 and arm64 (confirmed via GitHub Actions CI on ubuntu-22.04 and
ubuntu-24.04-arm).
…works

The umdk repo ships its own src/urma/BUILD.bazel, which makes Bazel
treat src/urma/ as a separate package. glob() in our umdk.BUILD
(rooted at the umdk repo root) can't cross that boundary, so
hdrs = glob(["src/urma/lib/urma/**/include/*.h"]) silently resolved to
an empty list. The cc_library then exported no header inputs, so
compiling anything that #includes urma_api.h failed with "No such
file or directory" even though the -isystem path was correct and the
file existed on disk.

Confirmed via GitHub Actions on both ubuntu-22.04 (x86_64) and
ubuntu-24.04-arm (arm64): `bazel build --define=BRPC_WITH_URMA=true //:brpc`
failed identically on both before this patch_cmds fix.
Reviewer dwh110 pointed out that src/brpc/urma/mock_urma.cpp had no
independent feature switch: whenever liburma wasn't found, CMake/Make
silently linked the mock, which can produce a binary that looks
URMA-capable but can't reach real hardware.

Add WITH_URMA_MOCK (CMake) / --with-urma-mock (config_brpc.sh),
default OFF. When WITH_URMA is enabled and liburma isn't found, the
build now fails with a clear message unless the mock is explicitly
requested, instead of substituting it implicitly. Document the new
flag in docs/en/urma.md and docs/cn/urma.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add conditional linking for URMA library based on availability.
Added a comment regarding linking with liburma based on brpc build options.
Added logic to find the URMA library and handle its absence.
Removed conditional check for URMA library and related messages.
Update logic for linking liburma based on header presence.
- ci-linux.yml: new compile-and-test-with-urma job builds with
  -DWITH_URMA=ON against the openEuler-mirror UMDK headers on GitHub
  (avoids the atomgit.com dependency) and runs brpc_urma_unittest with
  the link-time mock, since no URMA hardware is available on runners.
- mock_urma.cpp: add urma_user_ctl(), referenced by SetBondingMode()
  whenever urma_ubagg.h is available; without it, WITH_URMA=ON fails
  to link against the mock.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JX6CCou3VWh8ZxRR4x6zvY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant