-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Labels
A-binArea: binary relatedArea: binary relatedA-builderArea: builder cratesArea: builder cratesK-cleanupKind: general cleanupKind: general cleanupM-good-first-issueMeta: Good for newcomersMeta: Good for newcomers
Milestone
Description
Summary
Warning
This work is blocked by #374.
Extract VersionInfo and version-related constants from the metrics module and relocate them to the op-rbuilder binary after #374 moves the op-rbuilder binary into the top-level bin/ directory.
Motivation
Version information is not inherently metrics-related. Moving it to the binary improves code organization and separation of concerns.
Current Location
Version info currently lives in crates/builder/op-rbuilder/src/metrics.rs:
// Lines 14-51: Version constants
pub const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
pub const VERGEN_GIT_SHA: &str = env!("VERGEN_GIT_SHA_SHORT");
pub const VERGEN_BUILD_TIMESTAMP: &str = env!("VERGEN_BUILD_TIMESTAMP");
pub const VERGEN_CARGO_TARGET_TRIPLE: &str = env!("VERGEN_CARGO_TARGET_TRIPLE");
pub const VERGEN_CARGO_FEATURES: &str = env!("VERGEN_CARGO_FEATURES");
pub const VERGEN_GIT_AUTHOR: &str = env!("VERGEN_GIT_COMMIT_AUTHOR");
pub const VERGEN_GIT_COMMIT_MESSAGE: &str = env!("VERGEN_GIT_COMMIT_MESSAGE");
pub const BUILD_PROFILE_NAME: &str = env!("OP_RBUILDER_BUILD_PROFILE");
pub const SHORT_VERSION: &str = env!("OP_RBUILDER_SHORT_VERSION");
pub const LONG_VERSION: &str = concat!(...);// Lines 273-291: VersionInfo struct
pub struct VersionInfo {
pub version: &'static str,
pub build_timestamp: &'static str,
pub cargo_features: &'static str,
pub git_sha: &'static str,
pub target_triple: &'static str,
pub build_profile: &'static str,
pub commit_author: &'static str,
pub commit_message: &'static str,
}Target Location
Move to a new version.rs module in bin/op-rbuilder/.
Tasks
- Create
version.rsin the binary directory - Move
VersionInfostruct and constants - Update imports in metrics module to reference new location
- Update
register_version_metrics()to use importedVersionInfo
Metadata
Metadata
Assignees
Labels
A-binArea: binary relatedArea: binary relatedA-builderArea: builder cratesArea: builder cratesK-cleanupKind: general cleanupKind: general cleanupM-good-first-issueMeta: Good for newcomersMeta: Good for newcomers