diff --git a/Cargo.lock b/Cargo.lock index 70f31b25..73d16b22 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2102,7 +2102,7 @@ dependencies = [ [[package]] name = "gopher64" -version = "1.1.17" +version = "1.1.16" dependencies = [ "bindgen", "cc", diff --git a/Cargo.toml b/Cargo.toml index b55e3298..456c6722 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gopher64" -version = "1.1.17" +version = "1.1.16" edition = "2024" rust-version = "1.95.0" diff --git a/build.rs b/build.rs index 557a3711..bf7ebb7b 100644 --- a/build.rs +++ b/build.rs @@ -277,12 +277,24 @@ fn main() { .compile("simd"); } - let git_output = std::process::Command::new("git") - .args(["describe", "--always", "--dirty"]) - .output() - .unwrap(); + let mut git_output = std::process::Command::new("git"); + git_output.args(["describe", "--dirty"]); - let git_describe = String::from_utf8(git_output.stdout).unwrap(); + let git_describe = if let Ok(git_output) = git_output.output() + && git_output.status.success() + { + String::from_utf8(git_output.stdout).unwrap() + } else if let Ok(git_output) = git_output.args(["--always"]).output() + && git_output.status.success() + { + format!( + "v{}-{}", + env!("CARGO_PKG_VERSION"), + String::from_utf8(git_output.stdout).unwrap() + ) + } else { + panic!("Failed to get git describe"); + }; println!("cargo:rustc-env=GIT_DESCRIBE={git_describe}"); println!("cargo:rerun-if-env-changed=NETPLAY_ID");