remove baobit commit command line argument

the baobit commit will be injected at final file packaging time
This commit is contained in:
bunnie 2026-02-16 18:07:01 +08:00
parent e68a61dd9a
commit 9be2cbf99e
2 changed files with 3 additions and 18 deletions

View file

@ -60,8 +60,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let do_version = env::args().filter(|x| x == "--no-timestamp").count() == 0;
let git_describe_opt = get_flag("--git-describe")?.first().cloned();
let git_rev_opt = get_flag("--git-rev")?.first().cloned();
let baobit_commit_opt = get_flag("--baobit-commit")?.first().cloned();
generate_version(do_version, git_describe_opt.clone(), baobit_commit_opt.clone());
generate_version(do_version, git_describe_opt.clone());
if let Some(desc) = git_describe_opt {
builder.set_git_describe(desc);
}

View file

@ -27,11 +27,7 @@ fn write_if_changed(path: &str, new_data: &[u8]) {
vfile.write_all(new_data).expect(&format!("couldn't write to {}", path));
}
pub(crate) fn generate_version(
add_timestamp: bool,
forced_version: Option<String>,
baobit_commit: Option<String>,
) {
pub(crate) fn generate_version(add_timestamp: bool, forced_version: Option<String>) {
let gitver = {
if let Some(ver) = forced_version {
ver.as_bytes().to_vec()
@ -77,17 +73,7 @@ pub(crate) fn generate_version(
.expect("couldn't add our semver");
new_data.extend_from_slice(&semver_code);
// Baochip versioning is just SEMVER + BAOBIT_COMMIT. Now that
// the semver_code has been added to new_data, we can extend it with the Baobit commit.
if let Some(ref commit) = baobit_commit {
writeln!(semver_code, "pub const BAOBIT_COMMIT: &'static str = \"{}\";", commit)
.expect("couldn't add baobit commit");
} else {
// For builds that aren't built in the reproducible environment, the baobit commit is unspecified
writeln!(semver_code, "pub const BAOBIT_COMMIT: &'static str = \"unspecified\";")
.expect("couldn't add baobit commit placeholder");
}
// Baochip versioning is just SEMVER
write_if_changed(version_file, &new_data);
write_if_changed(boot0_version_file, &semver_code);
write_if_changed(boot1_version_file, &semver_code);