Skip to content

Linter crashes with Xdebug 3 on without listening client #47

Closed
@jankonas

Description

@jankonas

When I have Xdebug 3 enabled (xdebug.mode=debug, xdebug.start_with_request=yes), but no listening client for it, PHP emits this message to stderr:

Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.254.254.254:9003 (through xdebug.client_host/xdebug.client_port) :-(

That causes linter to crash with following output:

$ vendor/bin/parallel-lint -e php src tests
Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.254.254.254:9003 (through xdebug.client_host/xdebug.client_port) :-(
PHP 7.3.26 | 10 parallel jobs
............................................................  60/124 (48 %)
.........................................................Error in skip-linting.php process
Error output: Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.254.254.254:9003 (through xdebug.client_host/xdebug.client_port) :-(

Investigating the issue I found this code snippet in ParallelLint.php:

if ($skipLintProcess->getErrorOutput()) {
    $message = "Error in skip-linting.php process\nError output: {$skipLintProcess->getErrorOutput()}";
    throw new \Exception($message);
}

Why is process error determined by stderr content instead of status code of the process? I am adding PR to change that, but maybe there is some reason for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions