Skip to content

Commit

Permalink
build: stop using vergen
Browse files Browse the repository at this point in the history
We remove the `vergen` build dependency from all crates in the
workspace, in order to speed up local builds, and slightly improve CI
cache performance. The only downside to this change is that version
strings are now hardcoded, based on the version specified in
`Cargo.toml`,  e.g. `v0.63.2`.

Refs #3436.
  • Loading branch information
conorsch committed Nov 29, 2023
1 parent 6691c3a commit de27d89
Show file tree
Hide file tree
Showing 30 changed files with 12 additions and 208 deletions.
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
!Cargo.toml
!Cargo.lock
!.cargo/
# git directory for vergen. unfortunately, breaks cache
# on every commit.
!.git/

# testnets for 'pd testnet generate' defaults
!testnets/
Expand Down
110 changes: 0 additions & 110 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions crates/bin/pcli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ ndarray = "0.15.6"
dialoguer = "0.10.4"
# ndarray-linalg = { version = "0.16.0", features = ["openblas-static"] }

[build-dependencies]
vergen = "5"
anyhow = "1"

[dev-dependencies]
assert_cmd = "2.0"
predicates = "2.1"
Expand Down
5 changes: 0 additions & 5 deletions crates/bin/pcli/build.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/bin/pcli/src/command/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl DebugInfo {
}
/// Return the version for `pcli` baked in at compile time.
fn get_pcli_version() -> String {
env!("VERGEN_GIT_SEMVER").to_string()
env!("CARGO_PKG_VERSION").to_string()
}
/// Attempt to find `pd` on PATH, and return its version number. Depending on deployment,
/// `pd` may not be on the path; it may in a container context elsewhere.
Expand Down
6 changes: 1 addition & 5 deletions crates/bin/pcli/src/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ use penumbra_view::ViewService;
use tracing_subscriber::EnvFilter;

#[derive(Debug, Parser)]
#[clap(
name = "pcli",
about = "The Penumbra command-line interface.",
version = env!("VERGEN_GIT_SEMVER"),
)]
#[clap(name = "pcli", about = "The Penumbra command-line interface.", version)]
pub struct Opt {
#[clap(subcommand)]
pub cmd: Command,
Expand Down
3 changes: 0 additions & 3 deletions crates/bin/pclientd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,3 @@ penumbra-proof-params = { path = "../../crypto/proof-params", features = [
"bundled-proving-keys",
"download-proving-keys",
] }

[build-dependencies]
vergen = "5"
5 changes: 0 additions & 5 deletions crates/bin/pclientd/build.rs

This file was deleted.

7 changes: 1 addition & 6 deletions crates/bin/pclientd/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::env;
use std::net::SocketAddr;
use std::path::Path;

Expand Down Expand Up @@ -71,11 +70,7 @@ fn default_home() -> Utf8PathBuf {
}

#[derive(Debug, Parser)]
#[clap(
name = "pclientd",
about = "The Penumbra view daemon.",
version = env!("VERGEN_GIT_SEMVER"),
)]
#[clap(name = "pclientd", about = "The Penumbra view daemon.", version)]
pub struct Opt {
/// Command to run.
#[clap(subcommand)]
Expand Down
1 change: 0 additions & 1 deletion crates/bin/pd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ penumbra-proof-params = { path = "../../crypto/proof-params", features = [
] }

[build-dependencies]
vergen = "5"
anyhow = "1"

[package.metadata.dist]
Expand Down
2 changes: 0 additions & 2 deletions crates/bin/pd/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::path::Path;

use anyhow::Context;
use vergen::{vergen, Config};

fn main() -> anyhow::Result<()> {
vergen(Config::default()).unwrap();
setup_testnet_config()?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bin/pd/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use tracing::Instrument;

use penumbra_tower_trace::v037::RequestExt;

const ABCI_INFO_VERSION: &str = env!("VERGEN_GIT_SEMVER");
const ABCI_INFO_VERSION: &str = env!("CARGO_PKG_VERSION");

/// Implements service traits for Tonic gRPC services.
///
Expand Down
6 changes: 1 addition & 5 deletions crates/bin/pd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ use penumbra_tower_trace::v037::RequestExt;
use tendermint::v0_37::abci::{ConsensusRequest, MempoolRequest};

#[derive(Debug, Parser)]
#[clap(
name = "pd",
about = "The Penumbra daemon.",
version = env!("VERGEN_GIT_SEMVER"),
)]
#[clap(name = "pd", about = "The Penumbra daemon.", version)]
struct Opt {
/// Enable Tokio Console support.
#[clap(long)]
Expand Down
3 changes: 0 additions & 3 deletions crates/core/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ rand_core = "0.6"
rand_chacha = "0.3"
tracing-subscriber = "0.3"

[build-dependencies]
vergen = "5"

[features]
default = ["std"]
std = ["ark-ff/std", "ibc-types/std"]
3 changes: 0 additions & 3 deletions crates/core/component/stake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,3 @@ ed25519-consensus = "2"
rand_chacha = "0.3"
tracing-subscriber = "0.3"
proptest = "1"

[build-dependencies]
vergen = "5"
3 changes: 0 additions & 3 deletions crates/custody/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ rand_core = "0.6"
ed25519-consensus = "2.1"
base64 = "0.20"

[build-dependencies]
vergen = "5"

[dev-dependencies]
toml = "0.5"
5 changes: 0 additions & 5 deletions crates/custody/build.rs

This file was deleted.

3 changes: 0 additions & 3 deletions crates/misc/measure/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ reqwest = { version = "0.11", features = ["json"] }
serde_json = "1"
bytesize = "1.2"

[build-dependencies]
vergen = "5"

[[bin]]
name = "measure"
path = "src/main.rs"
Expand Down
Loading

0 comments on commit de27d89

Please sign in to comment.