New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPC::Run::full_results() Windows behavior does not match non-Windows #161
Comments
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 |
For all platforms, a child calling exit(N) will now cause result() to return N and full_result() to return N << 8. Programs having workarounds for the former Windows-specific semantics may need to condition those workarounds on IPC::Run versions before the next. Fixes cpan-authors#161
This affects the other
*result*
methods, too.t/result.t
fails like this onWindows:
(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 partof 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 theSIGKILL part. Per https://perldoc.perl.org/perlport#kill, Perl's signal
emulation makes the victim call
exit(9)
. I'll just maket/result.t
recognize the platform-specific outcome. IPC::Run can't recreate a distinction
that Perl signal emulation erased.
The text was updated successfully, but these errors were encountered: