Skip to content

Commit 2dcbc44

Browse files
committed
chore: Add built crate
1 parent 6de8388 commit 2dcbc44

5 files changed

Lines changed: 19 additions & 1 deletion

File tree

Cargo.lock

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

Cargo.nix

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

rust/cert-tools/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ openssl.workspace = true
1818
snafu.workspace = true
1919
tracing.workspace = true
2020
tracing-subscriber = { workspace = true, features = ["env-filter"] }
21+
22+
[build-dependencies]
23+
built.workspace = true

rust/cert-tools/build.rs

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

rust/cert-tools/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ mod cert_ext;
1313
mod cli_args;
1414
mod parsers;
1515

16+
mod built_info {
17+
include!(concat!(env!("OUT_DIR"), "/built.rs"));
18+
}
19+
1620
#[snafu::report]
1721
pub fn main() -> Result<(), snafu::Whatever> {
1822
let cli = Cli::parse();
1923

2024
// Use `CONSOLE_LOG_LEVEL` to modify the console log level
21-
let _tracing_guard = Tracing::pre_configured("cert-tools", cli.telemetry)
25+
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, cli.telemetry)
2226
.init()
2327
.whatever_context("failed to initialize tracing")?;
2428

0 commit comments

Comments
 (0)