[Bugfix] Fix wrong vLLM version reported by pip install (proto-v* tag collision) (#57295)

Signed-off-by: RyanMa29 <ziyang.ma@intel.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com> Co-authored-by: Bugen Zhao <i@bugenzhao.com> Co-authored-by: Codex <noreply@openai.com>

Ziyang Ma committed Sep 17, 2026 at 23:50 UTC d7e755c23080988f7450f107466d6f6a74b042ff
3 files changed +37 -4
.buildkite/scripts/ci-bake-rocm.sh
+1 -1
@@ -418,7 +418,7 @@ validate_ci_build_context_source() {
418
419 describe_ci_revision() {
420 git -C "$1" describe --tags --long --abbrev=10 \
421 - --match '*[0-9]*' "$2" 2>/dev/null
421 + --match 'v[0-9]*' "$2" 2>/dev/null
422 }
423
424 write_ci_git_archival_metadata() {
setup.py
+20 -2
@@ -22,6 +22,18 @@ from setuptools_rust.build import build_rust
22 from setuptools_scm import get_version
23 from torch.utils.cpp_extension import CUDA_HOME, ROCM_HOME
24
25 +# Select vLLM release tags, excluding crate tags such as "proto-v0.3.0".
26 +VLLM_GIT_DESCRIBE_COMMAND = [
27 + "git",
28 + "describe",
29 + "--dirty",
30 + "--tags",
31 + "--long",
32 + "--abbrev=40",
33 + "--match",
34 + "v[0-9]*",
35 +]
36 +
37
38 def load_module_from_path(module_name, path):
39 spec = importlib.util.spec_from_file_location(module_name, path)
@@ -1249,9 +1261,15 @@ def get_vllm_version() -> str:
1261 if env_version := os.getenv("VLLM_VERSION_OVERRIDE"):
1262 print(f"Overriding VLLM version with {env_version} from VLLM_VERSION_OVERRIDE")
1263 os.environ["SETUPTOOLS_SCM_PRETEND_VERSION"] = env_version
1252 - return get_version(write_to="vllm/_version.py")
1264 + return get_version(
1265 + write_to="vllm/_version.py",
1266 + git_describe_command=VLLM_GIT_DESCRIBE_COMMAND,
1267 + )
1268
1254 - version = get_version(write_to="vllm/_version.py")
1269 + version = get_version(
1270 + write_to="vllm/_version.py",
1271 + git_describe_command=VLLM_GIT_DESCRIBE_COMMAND,
1272 + )
1273 sep = "+" if "+" not in version else "." # dev versions might contain +
1274
1275 if not envs.VLLM_SKIP_VERSION_SUFFIX:
tools/build_rust.py
+16 -1
@@ -16,13 +16,28 @@ from setuptools_scm import get_version
16 ROOT_DIR = Path(__file__).resolve().parents[1]
17 VLLM_RS_BUILD_VERSION = "VLLM_RS_BUILD_VERSION"
18
19 +# Select vLLM release tags, excluding crate tags such as "proto-v0.3.0".
20 +VLLM_GIT_DESCRIBE_COMMAND = [
21 + "git",
22 + "describe",
23 + "--dirty",
24 + "--tags",
25 + "--long",
26 + "--abbrev=40",
27 + "--match",
28 + "v[0-9]*",
29 +]
30 +
31
32 def prepare_build_environment() -> str | None:
33 """Set the device-independent vLLM source version for Rust artifacts."""
34 version = os.getenv(VLLM_RS_BUILD_VERSION) or None
35 if version is None:
36 try:
25 - version = get_version(root=ROOT_DIR)
37 + version = get_version(
38 + root=ROOT_DIR,
39 + git_describe_command=VLLM_GIT_DESCRIBE_COMMAND,
40 + )
41 except LookupError:
42 return None
43