Skip to content

Commit

Permalink
build: bump vergen (Myriad-Dreamin#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin authored Jan 15, 2025
1 parent cff6de2 commit fb28ad6
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 21 deletions.
39 changes: 33 additions & 6 deletions Cargo.lock

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

9 changes: 2 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ env_logger = "0.11"
log = "0.4.25"

# misc
vergen = { version = "8.2.5", features = [
"build",
"cargo",
"git",
"gitcl",
"rustc",
] }
vergen = { version = "9.0.4", features = ["build", "cargo", "rustc"] }
vergen-gitcl = { version = "1.0.1" }
include_dir = "0.7.3"
pathdiff = "0.2.1"

Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pathdiff.workspace = true
[build-dependencies]
anyhow.workspace = true
vergen.workspace = true
vergen-gitcl.workspace = true

[features]
embedded-fonts = ["typst-assets/fonts"]
Expand Down
31 changes: 23 additions & 8 deletions cli/build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
use anyhow::Result;
use vergen::EmitBuilder;
use vergen::{BuildBuilder, CargoBuilder, Emitter, RustcBuilder};
use vergen_gitcl::GitclBuilder;

fn main() -> Result<()> {
let build = BuildBuilder::default().build_timestamp(true).build()?;
let cargo = CargoBuilder::all_cargo()?;
let rustc = RustcBuilder::default()
.commit_hash(true)
.semver(true)
.host_triple(true)
.channel(true)
.llvm_version(true)
.build()?;
let gitcl = GitclBuilder::default()
.sha(false)
.describe(true, true, None)
.build()?;

// Emit the instructions
EmitBuilder::builder()
.all_cargo()
.build_timestamp()
.git_sha(false)
.git_describe(true, true, None)
.all_rustc()
.emit()
Emitter::default()
.add_instructions(&build)?
.add_instructions(&cargo)?
.add_instructions(&rustc)?
.add_instructions(&gitcl)?
.emit()?;
Ok(())
}

0 comments on commit fb28ad6

Please sign in to comment.