fix: add release_header dependency to valkey-cli and valkey-benchmark [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #4540
Conversation
The valkey-cli and valkey-benchmark targets compile release.c, which #includes the generated release.h, but neither declares a dependency on the release_header custom target. Under parallel make (-jN) the compilation of release.c can start before mkreleasehdr.sh produces release.h, causing intermittent 'fatal error: release.h file not found'. Only valkey-server declared the release_header dependency. Add it for valkey-cli and valkey-benchmark as well, matching the dependency pattern already applied on the unstable branch. Closes valkey-io#4538 Signed-off-by: waterWang <waterWang@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
| valkey_build_and_install_bin(valkey-cli "${VALKEY_CLI_SRCS}" "${VALKEY_SERVER_LDFLAGS}" "${CLI_LIBS}" "redis-cli") | ||
| add_dependencies(valkey-cli generate_commands_def) | ||
| add_dependencies(valkey-cli generate_fmtargs_h) | ||
| add_dependencies(valkey-cli release_header) |
There was a problem hiding this comment.
Since all Valkey binary targets are defined using the macro: valkey_build_and_install_bin (which itself is defined in cmake/Modules/ValkeySetup.cmake) - it makes sense to add the dependency in that macro (we will also need to move that macro after the declaration of the custom target release_header). WDYT?
Fixes #4538.
The valkey-cli and valkey-benchmark targets both compile release.c, which #includes the generated release.h, but neither declares a dependency on the
release_headercustom target that generates it. Only valkey-server declares that dependency in src/CMakeLists.txt.Under parallel make (
make -jN, N > 1), compilation of release.c for the cli and benchmark targets can start before mkreleasehdr.sh produces release.h, causing intermittentfatal error: 'release.h' file not found.This adds
add_dependencies(valkey-cli release_header)andadd_dependencies(valkey-benchmark release_header), matching the dependency pattern already applied on theunstablebranch.