Skip to content

Commit e1098df

Browse files
committed
ci: fix macOS lanes broken by the re-MINIT harness test
The 043 harness links with GNU ld's --unresolved-symbols=ignore-all; macOS ld64 rejects the flag, the harness fails to compile, and the test failed on every macOS lane. The technique is ELF-only (ld64's -undefined dynamic_lookup binds eagerly under chained fixups), so the test now skips on non-Linux. The failure also exposed a diagnostics hole in the workflow: under bash -e, the RESULT=$(php run-tests.php ...) capture aborts the step on run-tests' non-zero exit before echo "$RESULT" runs, so failing lanes logged nothing about which test failed. The capture no longer aborts, and a missing summary line (run-tests crashed) now counts as failure instead of slipping past the numeric check. 043 verified still passing, not skipped, on Linux.
1 parent db4788d commit e1098df

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ jobs:
7575
export TEST_PHP_EXECUTABLE=$(which php)
7676
export TEST_PHP_ARGS="-d extension=$(pwd)/modules/mdparser.so"
7777
export NO_INTERACTION=1
78-
RESULT=$(php run-tests.php --show-diff -g FAIL,BORK,LEAK,XLEAK tests/ 2>&1)
78+
RESULT=$(php run-tests.php --show-diff -g FAIL,BORK,LEAK,XLEAK tests/ 2>&1) || true
7979
echo "$RESULT"
8080
FAILED=$(printf '%s\n' "$RESULT" | awk '/Tests failed/ { print $4; exit }')
81-
if [ "$FAILED" -gt 0 ]; then
81+
if [ "${FAILED:-1}" -gt 0 ]; then
8282
echo "::error::$FAILED test(s) failed"
8383
exit 1
8484
fi
@@ -114,10 +114,10 @@ jobs:
114114
export TEST_PHP_EXECUTABLE=$(which php)
115115
export TEST_PHP_ARGS="-d extension=$(pwd)/modules/mdparser.so"
116116
export NO_INTERACTION=1
117-
RESULT=$(php run-tests.php --show-diff -g FAIL,BORK,LEAK,XLEAK tests/ 2>&1)
117+
RESULT=$(php run-tests.php --show-diff -g FAIL,BORK,LEAK,XLEAK tests/ 2>&1) || true
118118
echo "$RESULT"
119119
FAILED=$(printf '%s\n' "$RESULT" | awk '/Tests failed/ { print $4; exit }')
120-
if [ "$FAILED" -gt 0 ]; then
120+
if [ "${FAILED:-1}" -gt 0 ]; then
121121
echo "::error::$FAILED test(s) failed under ZTS"
122122
exit 1
123123
fi
@@ -150,10 +150,10 @@ jobs:
150150
export TEST_PHP_EXECUTABLE=$(which php)
151151
export TEST_PHP_ARGS="-d extension=$(pwd)/modules/mdparser.so"
152152
export NO_INTERACTION=1
153-
RESULT=$(php run-tests.php --show-diff -g FAIL,BORK,LEAK,XLEAK tests/ 2>&1)
153+
RESULT=$(php run-tests.php --show-diff -g FAIL,BORK,LEAK,XLEAK tests/ 2>&1) || true
154154
echo "$RESULT"
155155
FAILED=$(printf '%s\n' "$RESULT" | awk '/Tests failed/ { print $4; exit }')
156-
if [ "$FAILED" -gt 0 ]; then
156+
if [ "${FAILED:-1}" -gt 0 ]; then
157157
echo "::error::$FAILED test(s) failed"
158158
exit 1
159159
fi

tests/043_mshutdown_reminit_registry.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ MSHUTDOWN then re-MINIT must leave the cmark extension registry usable
44
mdparser
55
--SKIPIF--
66
<?php
7-
if (substr(PHP_OS, 0, 3) === 'WIN') die('skip needs cc + build-tree objects');
7+
/* The harness link relies on GNU ld's --unresolved-symbols=ignore-all;
8+
* macOS ld64 rejects the flag and its -undefined dynamic_lookup
9+
* equivalent binds eagerly under chained fixups, so the technique is
10+
* ELF/GNU-ld only. */
11+
if (PHP_OS !== 'Linux') die('skip GNU ld + build-tree objects required');
812
if (!is_file(dirname(__DIR__) . '/.libs/mdparser.o')) die('skip build-tree .libs objects not present');
913
$cc = trim((string)shell_exec('command -v cc 2>/dev/null'));
1014
if ($cc === '') die('skip no cc in PATH');

0 commit comments

Comments
 (0)