Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit cb5ffa1

Browse files
committed
meson: fix warning about unexpected return code checking for run_command
Recent versions of Meson warn you that the default is to not check the return code, which is a bad default and may eventually change. To suppress this warning, an explicit `check: ` value must be set. Considering the code in play here: - check if git exists - if so, always assume this is running from a git checkout - embed either '()' or '(git describe version)' it seems likely the intention is indeed to have it be `check: false`, but there's some missing error checking here to ensure it. Check the returncode. If git fails, it is surely because there is no git repository and the build is being run from a tarball. In that case, behave as though git wasn't found in the first place, and use the fallback value.
1 parent f92e900 commit cb5ffa1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/meson.build

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ config_file = configure_file(
2020
output : 'config.h',
2121
configuration : config_cfg)
2222

23+
intel_driver_git_version = intel_vaapi_driver_version
2324
if git.found()
2425
git_version = run_command(
2526
git, '--git-dir', join_paths(meson.source_root(), '.git'),
26-
'describe', '--tags')
27-
intel_driver_git_version = git_version.stdout().strip()
28-
else
29-
intel_driver_git_version = intel_vaapi_driver_version
27+
'describe', '--tags', check: false)
28+
if git_version.returncode() == 0
29+
intel_driver_git_version = git_version.stdout().strip()
30+
endif
3031
endif
3132

3233
version_cfg = configuration_data()

0 commit comments

Comments
 (0)