Skip to content

Commit

Permalink
Revert "add build profile to version info (paradigmxyz#3652)"
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst committed Jul 7, 2023
1 parent 15bd88c commit 9e9e2b2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ hex = "0.4"
thiserror = { workspace = true }
pretty_assertions = "1.3.0"
humantime = "2.1.0"
const-str = "0.5.6"

[features]
jemalloc = ["dep:jemallocator", "dep:jemalloc-ctl"]
Expand Down
13 changes: 2 additions & 11 deletions bin/reth/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(crate) const SHORT_VERSION: &str =
/// Build Timestamp: 2023-05-19T01:47:19.815651705Z
/// Build Features: jemalloc
/// ```
pub(crate) const LONG_VERSION: &str = const_str::concat!(
pub(crate) const LONG_VERSION: &str = concat!(
"Version: ",
env!("CARGO_PKG_VERSION"),
"\n",
Expand All @@ -39,10 +39,7 @@ pub(crate) const LONG_VERSION: &str = const_str::concat!(
env!("VERGEN_BUILD_TIMESTAMP"),
"\n",
"Build Features: ",
env!("VERGEN_CARGO_FEATURES"),
"\n",
"Build Profile: ",
build_profile_name()
env!("VERGEN_CARGO_FEATURES")
);

/// The version information for reth formatted for P2P (devp2p).
Expand Down Expand Up @@ -79,12 +76,6 @@ pub fn default_extradata() -> String {
format!("reth/v{}/{}", env!("CARGO_PKG_VERSION"), std::env::consts::OS)
}

const fn build_profile_name() -> &'static str {
// Nice hack from https://stackoverflow.com/questions/73595435/how-to-get-profile-from-cargo-toml-in-build-rs-or-at-runtime
let out_dir_path = const_str::split!(env!("OUT_DIR"), std::path::MAIN_SEPARATOR_STR);
out_dir_path[out_dir_path.len() - 4]
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 9e9e2b2

Please sign in to comment.