Re: [PATCH v3] meson: Tolerate errors from git ls-files --deduplicate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 01, 2025 at 01:25:41PM +0300, Martin Storsjö wrote:
> When using the Meson build system with an old-enough Git version
> that does not yet know the `git ls-files --deduplicate` option one
> can observe the following error:
> 
>     ../meson.build:697:19: ERROR: Command `/usr/bin/git -C /home/martin/code/git ls-files --deduplicate '*.h' ':!contrib' ':!compat/inet_ntop.c' ':!compat/inet_pton.c' ':!compat/nedmalloc' ':!compat/obstack.*' ':!compat/poll' ':!compat/regex' ':!sha1collisiondetection' ':!sha1dc' ':!t/unit-tests/clar' ':!t/t[0-9][0-9][0-9][0-9]*' ':!xdiff'` failed with status 129.
> 
> The failing command is used to find all header files in our code
> base, which is required for static analysis.
> 
> Static analysis is an entirely optional feature that distributors
> typically don't care about, and we already know to skip running the
> command when we are not in a Git repository. But we do not handle
> the above failure gracefully, even though we could.
> 
> Fix this by passing `check: false` to `run_command`, which makes it
> tolerate failures. Then check `returncode()` manually to decide
> whether to inspect the output.

Thanks, this version looks good to me!

Patrick




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux