Closed nmisch closed 1 year ago
I continue to wonder if it's a losing battle to expect perl code to behave exactly the same on a non-POSIX system (windows) vs a POSIX system (almost everything else).
Signals have always been a complete consistency mess, especially if you stretch back to windows XP.
At this point IPC::Run has so many inconsistencies, I'm tempted to suggest that if we can break some compatibility but get to a consistent state in a short period of time, then we declare this and proceed. What do you think?
I think consistency is important enough here to justify some breakage.
I like accepting a compatibility break here to improve consistency. Given the Windows compatibility break in the last release, the time is relatively good for more breaks. Thanks for the feedback.
This affects the other
*result*
methods, too.t/result.t
fails like this on Windows:(We don't see this failure in GitHub Actions, since
GITHUB_WINDOWS_TESTING
makes the test a TODO.t/result.t
, being absent fromMANIFEST
, is not part of the distribution. Hence, we don't see this failure in cpantesters, either. Users building from git see the failure. I plan to change that.)The mismatch arises because Win32::Process::GetExitCode() codes aren't bit-shifted the way wait() status values are. The documentation doesn't settle the question of what the user should expect. For example, full_results() documentation says "Returns a list of child exit values as returned by wait". We don't use wait() on Windows. I could document the mismatch, or I could change behavior to compensate for the mismatch:
I'd certainly pick the latter in a greenfield, but it is a compatibility break. https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/test/perl/PostgreSQL/Test/Utils.pm;h=1ca2cc591708be41c79f02de542e7e64feeba9c5;hb=HEAD#l785 is an example of code compensating for the current mismatch; that would need to change. Are there other options to consider? What do you prefer?
That addresses the
exit 42
part oft/result.t
, but it doesn't address the SIGKILL part. Per https://perldoc.perl.org/perlport#kill, Perl's signal emulation makes the victim callexit(9)
. I'll just maket/result.t
recognize the platform-specific outcome. IPC::Run can't recreate a distinction that Perl signal emulation erased.