Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 681237b

Browse files
authored
Merge pull request #8306 from systeminit/fnichol/version-stamped-services
feat: add Git-derived version stamping to services
2 parents 073dbac + 7c7cb2c commit 681237b

28 files changed

Lines changed: 90 additions & 8 deletions

File tree

‎Cargo.lock‎

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bin/bedrock/Cargo.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ publish.workspace = true
1212
bedrock-server = { path = "../../lib/bedrock-server" }
1313
clap = { workspace = true }
1414
si-service = { path = "../../lib/si-service" }
15+
16+
[build-dependencies]
17+
si-service-build = { path = "../../lib/si-service-build" }

‎bin/bedrock/build.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
si_service_build::generate_git_metadata_rust();
3+
}

‎bin/bedrock/src/args.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ use si_service::prelude::*;
1414

1515
const NAME: &str = "bedrock";
1616

17+
include!(concat!(env!("OUT_DIR"), "/git_metadata.rs"));
18+
1719
pub(crate) fn parse() -> Args {
1820
Args::parse()
1921
}
2022

2123
#[derive(Parser, Debug)]
22-
#[command(name = NAME, max_term_width = 100)]
24+
#[command(name = NAME, version = VERSION, max_term_width = 100)]
2325
pub(crate) struct Args {
2426
/// Sets the verbosity mode.
2527
///

‎bin/forklift/Cargo.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ clap = { workspace = true }
1717
forklift-server = { path = "../../lib/forklift-server" }
1818
innit-client = { path = "../../lib/innit-client" }
1919
si-service = { path = "../../lib/si-service" }
20+
21+
[build-dependencies]
22+
si-service-build = { path = "../../lib/si-service-build" }

‎bin/forklift/build.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
si_service_build::generate_git_metadata_rust();
3+
}

‎bin/forklift/src/args.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ use si_service::prelude::*;
1616

1717
pub const NAME: &str = "forklift";
1818

19+
include!(concat!(env!("OUT_DIR"), "/git_metadata.rs"));
20+
1921
/// Parse, validate, and return the CLI arguments as a typed struct.
2022
pub(crate) fn parse() -> Args {
2123
Args::parse()
2224
}
2325

2426
/// Arguments for the forklift service.
2527
#[derive(Parser, Debug)]
26-
#[command(name = NAME, max_term_width = 100)]
28+
#[command(name = NAME, version = VERSION, max_term_width = 100)]
2729
pub(crate) struct Args {
2830
/// Sets the verbosity mode.
2931
///

‎bin/luminork/Cargo.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ clap = { workspace = true }
1717
innit-client = { path = "../../lib/innit-client" }
1818
luminork-server = { path = "../../lib/luminork-server" }
1919
si-service = { path = "../../lib/si-service" }
20+
21+
[build-dependencies]
22+
si-service-build = { path = "../../lib/si-service-build" }

‎bin/luminork/build.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
si_service_build::generate_git_metadata_rust();
3+
}

‎bin/luminork/src/args.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use si_service::prelude::*;
2323

2424
pub const NAME: &str = "luminork";
2525

26+
include!(concat!(env!("OUT_DIR"), "/git_metadata.rs"));
27+
2628
/// Parse, validate, and return the CLI arguments as a typed struct.
2729
pub(crate) fn parse() -> Args {
2830
Args::parse()
@@ -33,7 +35,7 @@ pub(crate) fn parse() -> Args {
3335
/// Luminork is the external and primary API surface which allows
3436
/// integration with System Initiatve for third party systems.
3537
#[derive(Parser, Debug)]
36-
#[command(name = NAME, max_term_width = 100)]
38+
#[command(name = NAME, version = VERSION, max_term_width = 100)]
3739
pub(crate) struct Args {
3840
/// Sets the verbosity mode.
3941
///

0 commit comments

Comments
 (0)