[Bug nptl/34507] New: Pretty-printer tests FAIL instead of UNSUPPORTED when cross-testing without python3 on target
"Hemanth.KumarMD at windriver dot com via Glibc-bugs" <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://sourceware.org/bugzilla/show_bug.cgi?id=34507
Bug ID: 34507
Summary: Pretty-printer tests FAIL instead of UNSUPPORTED when
cross-testing without python3 on target
Product: glibc
Version: 2.44
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: nptl
Assignee: unassigned at sourceware dot org
Reporter: Hemanth.KumarMD at windriver dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
When running make check with test-wrapper set for cross-testing (as documented
in INSTALL), the 6 nptl pretty-printer tests report FAIL if python3 is not
available on the target:
FAIL: nptl/test-cond-printers
FAIL: nptl/test-condattr-printers
FAIL: nptl/test-mutex-printers
FAIL: nptl/test-mutexattr-printers
FAIL: nptl/test-rwlock-printers
FAIL: nptl/test-rwlockattr-printers
The tests-printers rule in Rules:470 passes $(PYTHON) through
$(test-wrapper-env):
$(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) > $@; \
$(evaluate-test)
Unlike regular tests which wrap a compiled test binary via
$(host-test-program-cmd), this rule wraps python3 — a build-host tool. When
cross-testing via cross-test-ssh.sh (or any equivalent), the entire
command including python3 is forwarded to the target. If the target lacks
python3, the shell returns 127, which evaluate-test.sh reports as FAIL.
scripts/test_printers_common.py already handles missing dependencies
gracefully:
try:
import pexpect
except ImportError:
exit(UNSUPPORTED) # exit(77)
if not pexpect.which(gdb_bin):
exit(UNSUPPORTED) # exit(77)
But these checks are unreachable when python3 itself is absent.
The INSTALL documentation says test-wrapper is for running "newly built
binaries" — python3 is not a newly built binary.
Proposed fix: check for python3 availability before invoking it, so the test
reports UNSUPPORTED (exit 77) when python3 is not found:
$(tests-printers-out): $(objpfx)%.out: $(objpfx)% %.py %.c $(pretty-printers)
\
$(..)scripts/test_printers_common.py
$(test-wrapper-env) $(py-env) sh -c \
'command -v $(PYTHON) > /dev/null 2>&1 || exit 77; \
exec $(PYTHON) $*.py $*.c $(objpfx)$* $(pretty-printers)' > $@; \
$(evaluate-test)
This has no effect on native builds (where python3 is always present, since
configure requires it), and makes the tests degrade gracefully in cross-testing
setups where the target doesn't have python3.
--
You are receiving this mail because:
You are on the CC list for the bug.