rector icon indicating copy to clipboard operation
rector copied to clipboard

[DX] --xdebug should not be paralleled by default.

Open oleg-andreyev opened this issue 1 year ago • 3 comments
trafficstars

Bug Report

Subject Details
Rector version 0.19.8

Today was trying to debug something in rector, looking at documentation I see to allow xdebug by adding --xdebug but because code is executed in parallel only main process is debugged.

Expected Behaviour

IMO if --xdebug is passed then rector should not be executed in parallel or need notify about it

oleg-andreyev avatar Mar 11 '24 18:03 oleg-andreyev

@staabm could you verify it? thank you.

samsonasik avatar Mar 11 '24 20:03 samsonasik

I agree with @oleg-andreyev. PHPStan behave the same behaves when debugging is used, it disables parallel. The reason is that parallel adds more extra complexity, that nobody wants to deal with. And usually people debug when they already struggle :)

I'd be for applying same logic as PHPStan - if debug/xdebug is enabled, disable parallel and make debugging easier.

TomasVotruba avatar Mar 12 '24 12:03 TomasVotruba

Phpstan has a separate --debug switch for enabling/disabling parallel (and an additional --xdebug switch to attach xdebug. They do work independently

staabm avatar Mar 12 '24 12:03 staabm

Thanks @staabm , makes sense to keep these separated.

Closing then :+1:


The --debug now behaves the same way as PHPStan and disables the parallel: https://phpstan.org/user-guide/command-line-usage#--debug

Ref: https://github.com/rectorphp/rector-src/pull/5904

TomasVotruba avatar May 20 '24 05:05 TomasVotruba