Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build, Update dependencies #214

Merged
merged 4 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,953 changes: 1,665 additions & 288 deletions Cargo.lock

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,21 @@ required-features = ["build-man"]
build-man = ["man"]

[build-dependencies]
vergen = "7.4.4"
anyhow = "1.0.95"
vergen-gix = { version = "1.0.0", features = ["build", "cargo", "rustc", "si"] }

[dependencies]
dialoguer = "0.10.2"
env_logger = "0.10.0"
git2 = "0.15.0"
log = "0.4.17"
paw = "1.0.0"
clap = { version = "4.0.27", features = ["derive"] }
anyhow = "1.0.66"
rayon = "1.6.0"
thiserror = "1.0.37"
crossbeam-channel = "0.5.6"
textwrap = { version = "0.16.0", features = ["terminal_size"] }

anyhow = "1.0.95"
clap = { version = "4.5.23", features = ["derive"] }
crossbeam-channel = "0.5.14"
dialoguer = "0.11.0"
env_logger = "0.11.6"
git2 = "0.19.0"
log = "0.4.22"
man = { version = "0.3.0", optional = true }
rayon = "1.10.0"
textwrap = { version = "0.16.1", features = ["terminal_size"] }
thiserror = "2.0.9"

[dev-dependencies]
tempfile = "3.3.0"
15 changes: 9 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use vergen::{vergen, Config};
use vergen_gix::{BuildBuilder, CargoBuilder, Emitter, GixBuilder, RustcBuilder, SysinfoBuilder};

fn main() {
// Generate the 'cargo:' key output
let mut config = Config::default();
*config.git_mut().skip_if_error_mut() = true;
vergen(config).expect("Unable to generate the cargo keys!");
fn main() -> anyhow::Result<()> {
Emitter::default()
.add_instructions(&BuildBuilder::all_build()?)?
.add_instructions(&CargoBuilder::all_cargo()?)?
.add_instructions(&GixBuilder::all_git()?)?
.add_instructions(&RustcBuilder::all_rustc()?)?
.add_instructions(&SysinfoBuilder::all_sysinfo()?)?
.emit()
}
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl<'a, T> ConfigBuilder<'a, T> {
}
}

impl<'a, T> ConfigBuilder<'a, T>
impl<T> ConfigBuilder<'_, T>
where
T: ConfigValues,
{
Expand All @@ -226,7 +226,7 @@ where
}
}

impl<'a, T> ConfigBuilder<'a, T> {
impl<T> ConfigBuilder<'_, T> {
fn parses_and_collect<U>(self) -> Result<ConfigValue<U>>
where
T: IntoIterator,
Expand Down
6 changes: 3 additions & 3 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ pub struct TrackingBranchClassificationRequest<'a> {
pub upstream: Option<&'a RemoteTrackingBranch>,
}

impl<'a> ClassificationRequest for TrackingBranchClassificationRequest<'a> {
impl ClassificationRequest for TrackingBranchClassificationRequest<'_> {
fn classify(
&self,
git: ForceSendSync<&Git>,
Expand Down Expand Up @@ -751,7 +751,7 @@ pub struct NonTrackingBranchClassificationRequest<'a> {
pub local: &'a LocalBranch,
}

impl<'a> ClassificationRequest for NonTrackingBranchClassificationRequest<'a> {
impl ClassificationRequest for NonTrackingBranchClassificationRequest<'_> {
fn classify(
&self,
git: ForceSendSync<&Git>,
Expand Down Expand Up @@ -779,7 +779,7 @@ pub struct NonUpstreamBranchClassificationRequest<'a> {
pub remote: &'a RemoteTrackingBranch,
}

impl<'a> ClassificationRequest for NonUpstreamBranchClassificationRequest<'a> {
impl ClassificationRequest for NonUpstreamBranchClassificationRequest<'_> {
fn classify(
&self,
git: ForceSendSync<&Git>,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub(crate) enum BaseSpec<'a> {
},
}

impl<'a> BaseSpec<'a> {
impl BaseSpec<'_> {
fn is_local(&self, branch: &LocalBranch) -> bool {
matches!(self, BaseSpec::Local { local, .. } if local == branch)
}
Expand Down
14 changes: 8 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ fn main() -> Result<()> {
let args = Args::parse();

env_logger::init();
info!("SEMVER: {}", env!("VERGEN_BUILD_SEMVER"));
info!("SHA: {:?}", option_env!("VERGEN_GIT_SHA"));
info!(
"COMMIT_DATE: {:?}",
option_env!("VERGEN_GIT_COMMIT_TIMESTAMP")
);
if let Some(version) = option_env!("VERGEN_GIT_DESCRIBE") {
info!("VERSION: {version}");
} else {
info!("VERSION: {}", env!("CARGO_PKG_VERSION"));
}
if let Some(commit_date) = option_env!("VERGEN_GIT_COMMIT_TIMESTAMP") {
info!("COMMIT_DATE: {commit_date}");
}
info!("TARGET_TRIPLE: {}", env!("VERGEN_CARGO_TARGET_TRIPLE"));

let git = Git::try_from(Repository::open_from_env()?)?;
Expand Down
5 changes: 5 additions & 0 deletions tests/fixture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ pub fn rc() -> Fixture {
alias upstream='within upstream'
alias origin='within origin'
alias local='within local'

# TODO: Temporarily fix to pass tests on macOS
git() {
command git -c init.defaultBranch=master "$@"
}
"#,
)
.append_epilogue(
Expand Down
Loading