[Build] Propagate vLLM version to Rust binaries (#52593)

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Co-authored-by: Nick Hill <nickhill123@gmail.com>
Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
Bugen Zhao
2026-08-17 23:37:37 -07:00
committed by GitHub
co-authored by Nick Hill Andreas Karatzas
parent b0e9cff5e7
commit c89d692cb5
24 changed files with 135 additions and 39 deletions
+1
View File
@@ -34,6 +34,7 @@ tokio-stream.workspace = true
tracing.workspace = true
url.workspace = true
uuid.workspace = true
vllm-build-info.workspace = true
vllm-tracing.workspace = true
[lints]
+1 -1
View File
@@ -12,7 +12,7 @@ use clap::Parser;
#[command(
name = "vllm-bench",
about = "Benchmark online serving throughput",
version
version = vllm_build_info::VERSION
)]
struct Cli {
#[command(flatten)]
+8
View File
@@ -0,0 +1,8 @@
[package]
name = "vllm-build-info"
version.workspace = true
edition.workspace = true
license.workspace = true
[lints]
workspace = true
+10
View File
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
/// The vLLM package version supplied by the build system.
///
/// Direct Cargo builds fall back to the internal crate version.
pub const VERSION: &str = match option_env!("VLLM_RS_BUILD_VERSION") {
Some(version) => version,
None => env!("CARGO_PKG_VERSION"),
};
+1
View File
@@ -28,6 +28,7 @@ tokio-util.workspace = true
tracing.workspace = true
uuid.workspace = true
vllm-bench.workspace = true
vllm-build-info.workspace = true
vllm-chat.workspace = true
vllm-engine-core-client.workspace = true
vllm-managed-engine.workspace = true
+2 -1
View File
@@ -39,7 +39,8 @@ use crate::cli::unsupported::UnsupportedArgs;
#[derive(Debug, Parser)]
#[command(
name = "vllm-rs",
about = "Rust frontend and managed-engine CLI for vLLM."
about = "Rust frontend and managed-engine CLI for vLLM.",
version = vllm_build_info::VERSION
)]
pub struct Cli {
#[command(subcommand)]
+1
View File
@@ -45,6 +45,7 @@ tracing-subscriber.workspace = true
url.workspace = true
uuid.workspace = true
validator.workspace = true
vllm-build-info.workspace = true
vllm-chat.workspace = true
vllm-engine-core-client.workspace = true
vllm-llm.workspace = true
+1 -1
View File
@@ -1746,7 +1746,7 @@ async fn version_returns_engine_vllm_version() {
json,
json!({
"version": "test-vllm-version",
"rust_frontend_version": env!("CARGO_PKG_VERSION"),
"rust_frontend_version": vllm_build_info::VERSION,
})
);
}
+1 -1
View File
@@ -21,6 +21,6 @@ pub async fn version(State(state): State<Arc<AppState>>) -> Json<VersionResponse
Json(VersionResponse {
version,
rust_frontend_version: env!("CARGO_PKG_VERSION"),
rust_frontend_version: vllm_build_info::VERSION,
})
}