[php-src] PR #15378: Fix run-tests.php to propagate status code on Windows
| From: | cmb69 | Date: | Tue, 13 Aug 2024 11:43:46 +0000 |
| Subject: | [php-src] PR #15378: Fix run-tests.php to propagate status code on Windows | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-27907@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15378
Author: cmb69
There is now a workaround in
system_with_timeout() to avoid issues with quotes and
spaces in the filenames of the executable by using start[1]. However, calling
start will not propagate the process status of the actual process. Thus, calling
proc_get_status() is pretty meaningless, and especially Microsoft errors cannot be
detected (typically, access violations etc.), and as such no "Termsig" message is output.
We fix this by executing exit after the started command has finished.
[1] <https://github.com/php/php-src/blob/a6d7d5234b05582d3a333c0f2646fdeae44b4728/run-tests.php#L1157-L1162>
---
Given the proc_open() escaping fixes that have been done in the meantime, it may also
be possible to drop the start workaround on Windows altogether; a quick test worked as
expected, but I haven't done extensive testing.