This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 0c90264437 GH-46367: [C++] Prevent Meson from using git info if built
as subproject (#46368)
0c90264437 is described below
commit 0c902644376138e8c9f117541a58177aaf98dcde
Author: William Ayd <[email protected]>
AuthorDate: Fri May 9 17:08:09 2025 -0400
GH-46367: [C++] Prevent Meson from using git info if built as subproject
(#46368)
### Rationale for this change
When used as a subproject, the Arrow Meson configuration may end up pulling
git version information from the main project
### What changes are included in this PR?
This prevents Meson from gathering git information when Arrow is built as a
subproject
### Are these changes tested?
Yes
### Are there any user-facing changes?
No
* GitHub Issue: #46367
Authored-by: Will Ayd <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpp/meson.build b/cpp/meson.build
index 0a11662636..f4d006d31f 100644
--- a/cpp/meson.build
+++ b/cpp/meson.build
@@ -47,12 +47,12 @@ cpp_args =
cpp_compiler.get_supported_arguments(project_args)
add_project_arguments(cpp_args, language: 'cpp')
git_id = get_option('git_id')
-if git_id == ''
+if git_id == '' and not meson.is_subproject()
git_id = run_command('git', 'log', '-n1', '--format=%H', check:
false).stdout().strip()
endif
git_description = get_option('git_description')
-if git_description == ''
+if git_description == '' and not meson.is_subproject()
git_description = run_command('git', 'describe', '--tags', check:
false).stdout().strip()
endif