-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add build metadata to
--version
(#495)
This is intended to help with debugging non-release versions. Metadata includes git SHA and branch, rust version and architecture.
- Loading branch information
1 parent
0cd2228
commit 790751c
Showing
11 changed files
with
455 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
use std::str::FromStr; | ||
|
||
fn main() -> std::io::Result<()> { | ||
/// Embeds static faucet website files and generates build metadata for --version. | ||
fn main() { | ||
// The location of our static faucet website files. | ||
let static_dir = std::path::PathBuf::from_str(std::env!("CARGO_MANIFEST_DIR")) | ||
.unwrap() | ||
.join("src") | ||
.join("static"); | ||
println!("cargo::rerun-if-changed={}", static_dir.to_str().expect("Valid utf-8")); | ||
// This makes the static files available as an embedded resource. | ||
static_files::resource_dir(static_dir).build() | ||
static_files::resource_dir(static_dir).build().expect("Resources should build"); | ||
|
||
// Configures environment variables for build metadata intended for extended version | ||
// information. | ||
if let Err(e) = miden_node_utils::version::vergen() { | ||
// Don't let an error here bring down the build. Build metadata will be empty which isn't a | ||
// critical failure. | ||
println!("cargo:warning=Failed to embed build metadata: {e:?}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
fn main() { | ||
// Configures environment variables for build metadata intended for extended version | ||
// information. | ||
if let Err(e) = miden_node_utils::version::vergen() { | ||
// Don't let an error here bring down the build. Build metadata will be empty which isn't a | ||
// critical failure. | ||
println!("cargo:warning=Failed to embed build metadata: {e:?}"); | ||
} | ||
} |
Oops, something went wrong.