aboutsummaryrefslogtreecommitdiff
path: root/src/util/build.rs
diff options
context:
space:
mode:
authorJonathan Davies <jpds@protonmail.com>2023-03-10 11:40:58 +0000
committerJonathan Davies <jpds@protonmail.com>2023-03-10 14:46:44 +0000
commit25f2a46fc3e50c882cd518244bb49d44d01ca442 (patch)
tree7842b8880eb26171e2abeb98ed8111814708e141 /src/util/build.rs
parent9e061d5a70f35db7c62c79089567ef4dc226e413 (diff)
downloadgarage-25f2a46fc3e50c882cd518244bb49d44d01ca442.tar.gz
garage-25f2a46fc3e50c882cd518244bb49d44d01ca442.zip
rpc/system_metrics.rs: Added rustversion label to garage_build_info metric.
Diffstat (limited to 'src/util/build.rs')
-rw-r--r--src/util/build.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/build.rs b/src/util/build.rs
new file mode 100644
index 00000000..a4e955b8
--- /dev/null
+++ b/src/util/build.rs
@@ -0,0 +1,8 @@
+use rustc_version::version;
+
+fn main() {
+ // Acquire the version of Rust used to compile, this is added as a label to
+ // the garage_build_info metric.
+ let v = version().unwrap();
+ println!("cargo:rustc-env=RUSTC_VERSION={v}");
+}