fix: mooncake_master -version prints release version and git commit hash#2110
fix: mooncake_master -version prints release version and git commit hash#2110Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/kvcache-ai/Mooncake/sessions/2e9fe843-fa89-427f-8850-07d348a68aa7 Co-authored-by: stmatengss <11641725+stmatengss@users.noreply.github.com>
|
Thanks @stmatengss — this unblocks the immediate --version issue cleanly. One observation that might be worth a follow-up: MOONCAKE_STORE_VERSION has been pinned at "2.0.0" since it was introduced in #1061 back in Nov 2025. The wheel has shipped 0.3.10, 0.3.10.post1, and 0.3.10.post2, so after this PR --version will keep returning 2.0.0 regardless of which release the user is on. If useful, I have a small follow-up prepared locally that:
|
@copilot According to the review, fix issues. |
Agent-Logs-Url: https://github.com/kvcache-ai/Mooncake/sessions/5f13fddf-469a-42f5-b4a1-43ee2c2d88dd Co-authored-by: stmatengss <11641725+stmatengss@users.noreply.github.com>
Done in commit
|
mooncake_master -versionprintedmooncake_master(the program name) instead of a meaningful version string, becausegflags::SetVersionString()was never called.Description
This fix sources the display version from
mooncake-wheel/pyproject.tomland appends the short git commit hash, while leavingMOONCAKE_STORE_VERSION(used for RPC handshake) unchanged.Changes:
mooncake-store/CMakeLists.txtmooncake-wheel/pyproject.tomlat CMake configure timegit rev-parse --short HEADMOONCAKE_DISPLAY_VERSION(e.g."0.3.10.post2 (git: abc1234)")MOONCAKE_STORE_VERSIONwith a warning ifpyproject.tomlis missing or unreadablemooncake-store/include/version.h.inMOONCAKE_DISPLAY_VERSIONconstant alongside the existingMOONCAKE_STORE_VERSIONmooncake-store/src/master.cppversion.hgflags::SetVersionString(mooncake::MOONCAKE_DISPLAY_VERSION)beforeParseCommandLineFlags()After this change:
MOONCAKE_STORE_VERSIONremains"2.0.0"and is unaffected.Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-pg)mooncake-rl)Type of Change
How Has This Been Tested?
Verified that
gflags::SetVersionStringis called withMOONCAKE_DISPLAY_VERSIONbeforeParseCommandLineFlags, which causes gflags to print the version string and exit when-versionis passed. Confirmed that the CMake regex correctly extracts0.3.10.post2frompyproject.tomland thatgit rev-parse --short HEADproduces a valid short hash.Checklist
./scripts/code_format.shbefore submitting.