From 9e0a4fe374031287a00dd4806dd1abe956433b73 Mon Sep 17 00:00:00 2001 From: Jacob Rothbauer Date: Tue, 26 Aug 2025 10:05:40 -0500 Subject: [PATCH] build: only add git describe for git checkouts Some tools, such as Buildroot, will use packed tarballs of cloned git repositories and trigger builds for the sources. This results in flashrom grabbing incorrect git information. The best option is to solely rely on the VERSION file. Change-Id: Iac60ae253263eab42361b0f73a9c9c95cd547eb5 Signed-off-by: Jacob Rothbauer Reviewed-on: https://review.coreboot.org/c/flashrom/+/88967 Tested-by: build bot (Jenkins) Reviewed-by: Vincent Fazio Reviewed-by: Anastasia Klimchuk --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 35feb33b8..dda636fc4 100644 --- a/meson.build +++ b/meson.build @@ -29,7 +29,7 @@ lt_version = '@0@.@1@.@2@'.format(lt_current, lt_age, lt_revision) flashrom_version = meson.project_version() git = find_program('git', native : true, required : false) -if git.found() +if git.found() and fs.is_dir(meson.project_source_root()/'.git') version_git = run_command('git', 'describe', check : false) if version_git.returncode() == 0 flashrom_version += ' (git:@0@)'.format(version_git.stdout().strip())