[PATCH v2] nptl: Skip pretty-printer tests without python3 [BZ #34507]

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Sep 7 13:36:44 GMT 2026



On 07/09/26 05:59, Hemanth.KumarMD@windriver.com wrote:
> From: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>
> 
> The tests-printers-out rule in Rules wraps $(PYTHON) through
> $(test-wrapper-env).  Unlike ordinary tests, which wrap a freshly built
> target binary, this wraps python3, a build-host tool.  When cross-testing
> with test-wrapper set (e.g. via scripts/cross-test-ssh.sh) the whole
> command is forwarded to the target; if the target lacks python3 the shell
> returns 127 and evaluate-test.sh reports the six nptl pretty-printer
> tests as FAIL instead of UNSUPPORTED.
> 
> scripts/test_printers_common.py already exits UNSUPPORTED (77) when its
> dependencies are missing, but that is unreachable when python3 itself is
> absent.
> 
> Guard the invocation with a "command -v" check so the recipe exits 77
> (UNSUPPORTED) when python3 is not found.  Native builds are unaffected,
> as configure requires python3.
> 
> Signed-off-by: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>
> Suggested-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
> ---
> v2: Use $(firstword $(PYTHON)) for the "command -v" existence check so
>     it receives a single operand (the interpreter), since $(PYTHON)
>     expands to "python3 -B".  The exec still uses the full $(PYTHON).
>     Suggested by Adhemerval Zanella Netto.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> 
>  Rules | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Rules b/Rules
> index 71495028fb..cfdbb459c8 100644
> --- a/Rules
> +++ b/Rules
> @@ -467,8 +467,9 @@ py-env := PYTHONPATH=$(py-const-dir):$(..)scripts:$${PYTHONPATH}
>  # The pretty printer files and test_common_printers.py must be present for all.
>  $(tests-printers-out): $(objpfx)%.out: $(objpfx)% %.py %.c $(pretty-printers) \
>  		       $(..)scripts/test_printers_common.py
> -	$(test-wrapper-env) $(py-env) \
> -	    $(PYTHON) $*.py $*.c $(objpfx)$* $(pretty-printers) > $@; \
> +	$(test-wrapper-env) $(py-env) sh -c \
> +	    'command -v $(firstword $(PYTHON)) > /dev/null 2>&1 || exit 77; \
> +	     exec $(PYTHON) $*.py $*.c $(objpfx)$* $(pretty-printers)' > $@; \
>  	$(evaluate-test)
>  endif
>  



More information about the Libc-alpha mailing list