From 39ff88deba68e80d79ce4b5aae76dba41f347d26 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Wed, 27 Mar 2024 10:40:24 +0100 Subject: [PATCH] Release test --- build.rs | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 782c068f2..d45a55cfa 100644 --- a/build.rs +++ b/build.rs @@ -38,6 +38,26 @@ fn main() -> Result<(), Box> { .filter_map(|s| s.strip_prefix('v')) .collect::>(); + git(&["status"]); + git(&["rev-parse", "HEAD"]); + git(&["tag", "--list"]); + git(&["show", "v0.9.0"]); + git(&["show", "-s", "v0.9.0"]); + git(&["log", "v0.9.0..HEAD", "--oneline"]); + git(&["tag", "describe"]); + git(&["tag", "describe", "HEAD"]); + git(&["tag", "describe", "master"]); + git(&["tag", "describe", "--abbrev=0"]); + git(&["tag", "describe", "--abbrev=0", "--candidates=1"]); + git(&[ + "tag", + "describe", + "--abbrev=0", + "--candidates=1", + "--match=v*", + ]); + git(&["ls-remote", "origin"]); + if tags.len() > 1 { return Err("More than one version tag found for commit {hash}: {tags:?}".into()); } @@ -90,5 +110,22 @@ fn main() -> Result<(), Box> { println!("cargo::rustc-env=GIT_COMMIT_TIME={commit_time}"); println!("cargo::rustc-env=GIT_HEAD={hash}"); - Ok(()) + return Err("aborted".into()); + + // Ok(()) +} + +fn git(args: &[&str]) { + let out = Command::new("git").args(args).output().unwrap(); + + println!("cargo::warning=command: git {:?}", args); + println!( + "cargo::warning=stdout: {}", + String::from_utf8_lossy(&out.stdout) + ); + println!( + "cargo::warning=stderr: {}", + String::from_utf8_lossy(&out.stderr) + ); + println!("cargo::warning=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); }