Skip to content

librocksdb_sys: link liburing when RocksDB enables io_uring#849

Open
MeteorSkyOne wants to merge 2 commits intotikv:masterfrom
MeteorSkyOne:fixuring
Open

librocksdb_sys: link liburing when RocksDB enables io_uring#849
MeteorSkyOne wants to merge 2 commits intotikv:masterfrom
MeteorSkyOne:fixuring

Conversation

@MeteorSkyOne
Copy link
Copy Markdown

@MeteorSkyOne MeteorSkyOne commented Mar 25, 2026

Fix missing liburing linkage in librocksdb_sys.

When RocksDB is built with WITH_LIBURING=ON, CMake enables io_uring support, but build.rs does not forward liburing to Cargo's final link step. This causes Linux builds to fail with undefined io_uring_* symbols.

Summary by CodeRabbit

  • Chores
    • Build now optionally detects and links liburing if present on the system, automatically choosing static or dynamic linking as appropriate.
    • If liburing is not detected or parsing fails, the build proceeds without emitting any liburing link settings (graceful fallback).

@ti-chi-bot ti-chi-bot Bot added needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. dco-signoff: no Indicates the PR's author has not signed dco. contribution This PR is from a community contributor. labels Mar 25, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Mar 25, 2026

Hi @MeteorSkyOne. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot Bot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Mar 25, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Mar 25, 2026

Welcome @MeteorSkyOne!

It looks like this is your first PR to tikv/rust-rocksdb 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to tikv/rust-rocksdb. 😃

@ti-chi-bot ti-chi-bot Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 25, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 25, 2026

Warning

Rate limit exceeded

@MeteorSkyOne has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 4 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aa0e4420-16ed-43ab-894e-870e92849439

📥 Commits

Reviewing files that changed from the base of the PR and between 9f9e062 and 2850f47.

📒 Files selected for processing (1)
  • librocksdb_sys/build.rs
📝 Walkthrough

Walkthrough

Adds a non-public helper to the build script that parses CMakeCache.txt for an uring_LIBRARIES entry and conditionally emits Cargo link directives for liburing (static if .a, otherwise dynamic); integrated into build_rocksdb() and skips quietly on parse/read failures. (46 words)

Changes

Cohort / File(s) Summary
liburing Optional Linking
librocksdb_sys/build.rs
Added link_optional_uring(build_dir: &str) to read ${build_dir}/CMakeCache.txt, extract uring_LIBRARIES:FILEPATH=..., derive library name, and emit cargo:rustc-link-search plus `cargo:rustc-link-lib=static

Sequence Diagram(s)

sequenceDiagram
    participant BuildRs as build.rs
    participant CMake as CMakeCache.txt
    participant Cargo as Cargo (rustc)

    BuildRs->>CMake: read CMakeCache.txt
    alt found uring_LIBRARIES entry
        BuildRs->>BuildRs: parse filepath, derive libname
        BuildRs->>Cargo: emit cargo:rustc-link-search=native=<parent>
        alt filename ends with .a
            BuildRs->>Cargo: emit cargo:rustc-link-lib=static=<libname>
        else
            BuildRs->>Cargo: emit cargo:rustc-link-lib=dylib=<libname>
        end
    else
        BuildRs-->>BuildRs: return without uring directives
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

lgtm

Poem

I’m a rabbit in the build-day sun,
I peek in CMake where the caches run,
If uring’s there I link it right,
Static or dynamic — snug and tight,
Hopping builds along, oh what fun! 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding liburing linkage when RocksDB enables io_uring support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: MeteroSky <meteorskymail@gmail.com>
@ti-chi-bot ti-chi-bot Bot added dco-signoff: yes Indicates the PR's author has signed the dco. and removed dco-signoff: no Indicates the PR's author has not signed dco. labels Mar 25, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@librocksdb_sys/build.rs`:
- Line 174: The call to link_optional_uring(&build_dir) is emitted before the
rocksdb/titan cargo:rustc-link-lib directives which reverses the required link
order; move the link_optional_uring(&build_dir) invocation so it runs after the
code that prints the rocksdb and titan link directives (i.e., after the section
that emits those cargo:rustc-link-lib lines for rocksdb/titan) so liburing's
cargo:rustc-link-lib lines are printed last and preserve correct dependency
ordering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 850795e2-fb95-448c-82a8-e163c2f14ed6

📥 Commits

Reviewing files that changed from the base of the PR and between fefe37a and 342cb75.

📒 Files selected for processing (1)
  • librocksdb_sys/build.rs

Comment thread librocksdb_sys/build.rs Outdated
@ti-chi-bot ti-chi-bot Bot added dco-signoff: no Indicates the PR's author has not signed dco. and removed dco-signoff: yes Indicates the PR's author has signed the dco. labels Mar 25, 2026
Signed-off-by: MeteroSky <meteorskymail@gmail.com>
@ti-chi-bot ti-chi-bot Bot added dco-signoff: yes Indicates the PR's author has signed the dco. and removed dco-signoff: no Indicates the PR's author has not signed dco. labels Mar 25, 2026
Copy link
Copy Markdown
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot Bot added the lgtm label Mar 25, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Mar 25, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Connor1996

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Mar 25, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-03-25 20:38:20.982125558 +0000 UTC m=+387097.018195818: ☑️ agreed by Connor1996.

@ti-chi-bot ti-chi-bot Bot added the approved label Mar 25, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Mar 25, 2026

@MeteorSkyOne: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-rust-rocksdb-test-arm 2850f47 link true /test pull-rust-rocksdb-test-arm
pull-rust-rocksdb-test-x86 2850f47 link true /test pull-rust-rocksdb-test-x86

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@MeteorSkyOne
Copy link
Copy Markdown
Author

@MeteorSkyOne: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-rust-rocksdb-test-arm 2850f47 link true /test pull-rust-rocksdb-test-arm
pull-rust-rocksdb-test-x86 2850f47 link true /test pull-rust-rocksdb-test-x86
Full PR test history. Your PR dashboard.

Details
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@Connor1996 it looks like the openssl-devel version in this CI is too old?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved contribution This PR is from a community contributor. dco-signoff: yes Indicates the PR's author has signed the dco. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. lgtm needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants