Skip to content

Commit

Permalink
fix: vergen (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso authored Oct 7, 2024
1 parent 79c31c2 commit e5d5069
Show file tree
Hide file tree
Showing 4 changed files with 257 additions and 3 deletions.
222 changes: 222 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ serial_test = "^3"

[build-dependencies]
cfg_aliases = "0.2"
vergen-git2 = { version = "1", features = ["build", "cargo", "rustc", "si"] }


[features]
default = ["smb", "with-keyring"]
Expand Down
19 changes: 18 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use cfg_aliases::cfg_aliases;
use vergen_git2::{BuildBuilder, CargoBuilder, Emitter, Git2Builder, RustcBuilder, SysinfoBuilder};

fn main() {
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Setup cfg aliases
cfg_aliases! {
// Platforms
Expand All @@ -13,4 +14,20 @@ fn main() {
smb_unix: { all(unix, feature = "smb", not(macos)) },
smb_windows: { all(windows, feature = "smb") }
}

let build = BuildBuilder::all_build()?;
let cargo = CargoBuilder::all_cargo()?;
let git2 = Git2Builder::all_git()?;
let rustc = RustcBuilder::all_rustc()?;
let si = SysinfoBuilder::all_sysinfo()?;

Emitter::default()
.add_instructions(&build)?
.add_instructions(&cargo)?
.add_instructions(&git2)?
.add_instructions(&rustc)?
.add_instructions(&si)?
.emit()?;

Ok(())
}
Loading

0 comments on commit e5d5069

Please sign in to comment.