fix(build): drop vergen-git2 build dependency

vergen-git2 reads git metadata at build time, but the crates.io source
tarball ships no .git, so the published 1.1.0 fails on `cargo install`.
crates.io versions are immutable (no overwrite) and Chocolatey's
moderation queue blocks a fast re-push, so a clean 1.1.1 without vergen
is the only fix.
This commit is contained in:
Christian Visintin
2026-06-08 20:53:55 +02:00
parent 282f75c3f3
commit 4a9da89642
4 changed files with 5 additions and 161 deletions

128
Cargo.lock generated
View File

@@ -811,31 +811,6 @@ dependencies = [
"cipher 0.5.2",
]
[[package]]
name = "bon"
version = "3.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f47dbe92550676ee653353c310dfb9cf6ba17ee70396e1f7cf0a2020ad49b2fe"
dependencies = [
"bon-macros",
"rustversion",
]
[[package]]
name = "bon-macros"
version = "3.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "519bd3116aeeb42d5372c29d982d16d0170d3d4a5ed85fc7dd91642ffff3c67c"
dependencies = [
"darling",
"ident_case",
"prettyplease",
"proc-macro2",
"quote",
"rustversion",
"syn",
]
[[package]]
name = "bumpalo"
version = "3.20.3"
@@ -2191,18 +2166,6 @@ dependencies = [
"url",
]
[[package]]
name = "git2"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e"
dependencies = [
"bitflags 2.13.0",
"libc",
"libgit2-sys",
"log",
]
[[package]]
name = "glob"
version = "0.3.3"
@@ -3455,15 +3418,6 @@ dependencies = [
"bitflags 2.13.0",
]
[[package]]
name = "ntapi"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae"
dependencies = [
"winapi",
]
[[package]]
name = "nucleo"
version = "0.5.0"
@@ -3635,27 +3589,6 @@ dependencies = [
"objc2-core-foundation",
]
[[package]]
name = "objc2-io-kit"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15"
dependencies = [
"libc",
"objc2-core-foundation",
]
[[package]]
name = "objc2-open-directory"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb82bed227edf5201dfedf072bba4015a33d3d4a98519837295a90f0a23f676d"
dependencies = [
"objc2",
"objc2-core-foundation",
"objc2-foundation",
]
[[package]]
name = "objc2-system-configuration"
version = "0.3.2"
@@ -3988,7 +3921,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30b8c63418f1e7dfbb786268ae0927537b87d90b1211216c1ba50ce25d8d9495"
dependencies = [
"cc",
"git2 0.20.4",
"git2",
"glob",
]
@@ -6030,7 +5963,7 @@ dependencies = [
"anyhow",
"bitflags 2.13.0",
"dirs",
"git2 0.20.4",
"git2",
"glob",
"log",
"thiserror 2.0.18",
@@ -6133,21 +6066,6 @@ dependencies = [
"syn",
]
[[package]]
name = "sysinfo"
version = "0.39.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21d0d938c10fcda3e897e28aaddf4ab462375d411f4378cd63b1c945f69aba96"
dependencies = [
"libc",
"memchr",
"ntapi",
"objc2-core-foundation",
"objc2-io-kit",
"objc2-open-directory",
"windows 0.62.2",
]
[[package]]
name = "system-configuration"
version = "0.5.1"
@@ -6268,7 +6186,6 @@ dependencies = [
"tuirealm",
"unicode-width",
"uzers",
"vergen-git2",
"whoami",
"wildmatch",
"windows-native-keyring-store",
@@ -6849,47 +6766,6 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vergen"
version = "10.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7bdf18a54cf91b4d98a8e8b67f6321606539fbcdcac02536286ad1de37b53fd2"
dependencies = [
"anyhow",
"bon",
"rustc_version",
"rustversion",
"sysinfo",
"time",
"vergen-lib",
]
[[package]]
name = "vergen-git2"
version = "10.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6e1ddb3075d894c0796fa8e592b778b1a6c034cb95d254372e5c2270adbfbfe"
dependencies = [
"anyhow",
"bon",
"git2 0.21.0",
"rustversion",
"time",
"vergen",
"vergen-lib",
]
[[package]]
name = "vergen-lib"
version = "10.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "910e8471e27130bbc019e9bfa6bda16dfc4c6dd7c5d0793da70a9256caeae984"
dependencies = [
"anyhow",
"bon",
"rustversion",
]
[[package]]
name = "version_check"
version = "0.9.5"

View File

@@ -118,7 +118,6 @@ serial_test = "3"
[build-dependencies]
cfg_aliases = "0.2"
vergen-git2 = { version = "10", features = ["build", "cargo", "rustc", "si"] }
[[bin]]
name = "termscp"

View File

@@ -1,7 +1,6 @@
use cfg_aliases::cfg_aliases;
use vergen_git2::{Build, Cargo, Emitter, Git2, Rustc, Sysinfo};
fn main() -> Result<(), Box<dyn std::error::Error>> {
fn main() {
// Setup cfg aliases
cfg_aliases! {
// Platforms
@@ -14,20 +13,4 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
smb_unix: { all(unix, feature = "smb") },
smb_windows: { all(windows, feature = "smb") }
}
let build = Build::all_build();
let cargo = Cargo::all_cargo();
let git2 = Git2::all_git();
let rustc = Rustc::all_rustc();
let si = Sysinfo::all_sysinfo();
Emitter::default()
.add_instructions(&build)?
.add_instructions(&cargo)?
.add_instructions(&git2)?
.add_instructions(&rustc)?
.add_instructions(&si)?
.emit()?;
Ok(())
}

View File

@@ -31,19 +31,11 @@ use self::cli::{Args, ArgsSubcommands, RemoteArgs, RunOpts, Task};
use self::system::logging::{self, LogLevel};
const APP_NAME: &str = env!("CARGO_PKG_NAME");
const APP_BUILD_DATE: &str = env!("VERGEN_BUILD_TIMESTAMP");
const APP_GIT_BRANCH: &str = env!("VERGEN_GIT_BRANCH");
const APP_GIT_HASH: &str = env!("VERGEN_GIT_SHA");
const TERMSCP_VERSION: &str = env!("CARGO_PKG_VERSION");
const TERMSCP_AUTHORS: &str = env!("CARGO_PKG_AUTHORS");
type MainResult<T> = std::result::Result<T, Box<dyn std::error::Error>>;
#[inline]
fn git_hash() -> &'static str {
APP_GIT_HASH[0..8].as_ref()
}
fn main() -> MainResult<()> {
let args: Args = argh::from_env();
// Parse args
@@ -58,10 +50,7 @@ fn main() -> MainResult<()> {
if let Err(err) = logging::init(run_opts.log_level) {
eprintln!("Failed to initialize logging: {err}");
}
info!(
"{APP_NAME} v{TERMSCP_VERSION} ({APP_GIT_BRANCH}, {git_hash}, {APP_BUILD_DATE}) - Developed by {TERMSCP_AUTHORS}",
git_hash = git_hash()
);
info!("{APP_NAME} v{TERMSCP_VERSION} - Developed by {TERMSCP_AUTHORS}");
// Run
info!("Starting activity manager...");
run(run_opts)
@@ -142,10 +131,7 @@ fn run(run_opts: RunOpts) -> MainResult<()> {
}
fn print_version() -> MainResult<()> {
println!(
"{APP_NAME} v{TERMSCP_VERSION} ({APP_GIT_BRANCH}, {git_hash}, {APP_BUILD_DATE}) - Developed by {TERMSCP_AUTHORS}",
git_hash = git_hash()
);
println!("{APP_NAME} v{TERMSCP_VERSION} - Developed by {TERMSCP_AUTHORS}");
Ok(())
}