Skip to content

cmake: Fix missing release_header dependency for cli, benchmark, and gtest#3683

Open
poiuj wants to merge 2 commits into
valkey-io:unstablefrom
poiuj:unstable
Open

cmake: Fix missing release_header dependency for cli, benchmark, and gtest#3683
poiuj wants to merge 2 commits into
valkey-io:unstablefrom
poiuj:unstable

Conversation

@poiuj
Copy link
Copy Markdown
Contributor

@poiuj poiuj commented May 12, 2026

release.c is compiled into valkey-cli, valkey-benchmark, and the valkeylib-gtest static library, but only valkey-server declared a dependency on the release_header custom target that runs mkreleasehdr.sh to generate src/release.h. On a clean build (no stale release.h on disk) or under high parallelism, those targets could attempt to compile release.c before the header was generated and fail with "release.h: No such file or directory".

Add the missing add_dependencies(... release_header) for all three.

Summary by CodeRabbit

  • Chores
    • Improved build system dependencies to ensure proper generation order during compilation.

Review Change Stack

…gtest

release.c is compiled into valkey-cli, valkey-benchmark, and the
valkeylib-gtest static library, but only valkey-server declared a
dependency on the release_header custom target that runs
mkreleasehdr.sh to generate src/release.h. On a clean build (no stale
release.h on disk) or under high parallelism, those targets could
attempt to compile release.c before the header was generated and fail
with "release.h: No such file or directory".

Add the missing add_dependencies(... release_header) for all three.

Signed-off-by: Vadym Khoptynets <1099644+poiuj@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 61dfbea4-c00d-46fe-9403-c7582a6a13c3

📥 Commits

Reviewing files that changed from the base of the PR and between d4337d6 and 9f25ca1.

📒 Files selected for processing (2)
  • src/CMakeLists.txt
  • src/unit/CMakeLists.txt

📝 Walkthrough

Walkthrough

Three CMake build targets now explicitly depend on release_header generation to ensure proper build ordering: valkey-cli and valkey-benchmark in the main configuration, and valkeylib-gtest in the unit test configuration. No other build logic changes.

Changes

Build dependency on release_header target

Layer / File(s) Summary
CLI and benchmark tool dependencies
src/CMakeLists.txt
valkey-cli and valkey-benchmark targets are made explicitly dependent on the release_header target, ensuring header generation completes before these tools are built.
Test library dependencies
src/unit/CMakeLists.txt
valkeylib-gtest test target is made explicitly dependent on the release_header target, ensuring the header is generated before test compilation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Three targets now await the header's birth,
Release builds first, then tools spring forth with worth,
Build order fixed, no race conditions here,
Dependencies clear, the path is now sincere!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: adding missing release_header dependencies to three CMake build targets (cli, benchmark, and gtest).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@eifrah-aws
Copy link
Copy Markdown
Contributor

LGTM

@enjoy-binbin enjoy-binbin requested a review from zuiderkwast May 13, 2026 07:36
@poiuj
Copy link
Copy Markdown
Contributor Author

poiuj commented May 15, 2026

@zuiderkwast do you have time to look into this micro PR?

Copy link
Copy Markdown
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

I don't have the overview of the cmake files so I can't say if it's correct or not. But I trust @enjoy-binbin. 👍

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.

4 participants