Skip to content
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

[Parallel] Display stack trace on --debug on parallel #2561

Merged
merged 4 commits into from
Jun 25, 2022

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Jun 25, 2022

Fixes rectorphp/rector#7254

Before

[file] src/Config/Loader/ConfigureCallMergingLoaderFactory.php
[rule] Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector
                                                                                                                        
 [ERROR] Could not process "src/Config/Loader/ConfigureCallMergingLoaderFactory.php" file, due to:                      
         "System error: "Look at "Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector::refactor()":111"   
         Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On 
         line: 111         

After

[file] src/Config/Loader/ConfigureCallMergingLoaderFactory.php
[rule] Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector

[ERROR] Could not process "src/Config/Loader/ConfigureCallMergingLoaderFactory.php" file, due to:                      
         "System error: "Look at "Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector::refactor()":111"   
                                                                                                                        
         Stack trace:                                                                                                   
         #0 src/Rector/AbstractRector.php(218):                                                                         
         Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector->refactor(Object(PhpParser\Node\Stmt\Class_))
         #1 vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(200):                                               
         Rector\Core\Rector\AbstractRector->enterNode(Object(PhpParser\Node\Stmt\Class_))                               
         #2 vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray(Array) 
         #3 vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223):                                               
         PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Namespace_))                                  
         #4 vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(91): PhpParser\NodeTraverser->traverseArray(Array)  
         #5 src/PhpParser/NodeTraverser/RectorNodeTraverser.php(33): PhpParser\NodeTraverser->traverse(Array)           
         #6 src/Application/FileProcessor.php(42): Rector\Core\PhpParser\NodeTraverser\RectorNodeTraverser->traverse(Array)
         #7 src/Application/FileProcessor/PhpFileProcessor.php(103):                                                    
         Rector\Core\Application\FileProcessor->refactor(Object(Rector\Core\ValueObject\Application\File),              
         Object(Rector\Core\ValueObject\Configuration))                                                                 
         #8 src/Application/FileProcessor/PhpFileProcessor.php(62):                                                     
         Rector\Core\Application\FileProcessor\PhpFileProcessor->refactorNodesWithRectors(Object(Rector\Core\ValueObject\Applica
         tion\File), Object(Rector\Core\ValueObject\Configuration))                                                     
         #9 packages/Parallel/WorkerRunner.php(92):                                                                     
         Rector\Core\Application\FileProcessor\PhpFileProcessor->process(Object(Rector\Core\ValueObject\Application\File),
         Object(Rector\Core\ValueObject\Configuration))                                                                 
         #10 vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123):                                       
         Rector\Parallel\WorkerRunner->Rector\Parallel\{closure}(Array)                                                 
         #11 vendor/clue/ndjson-react/src/Decoder.php(131): Evenement\EventEmitter->emit('data', Array)                 
         #12 vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): Clue\React\NDJson\Decoder->handleData(Array)
         #13 vendor/react/stream/src/Util.php(71): Evenement\EventEmitter->emit('data', Array)                          
         #14 vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123):                                       
         React\Stream\Util::React\Stream\{closure}('{"action":"main...')                                                
         #15 vendor/react/stream/src/DuplexResourceStream.php(196): Evenement\EventEmitter->emit('data', Array)         
         #16 vendor/react/event-loop/src/StreamSelectLoop.php(246): React\Stream\DuplexResourceStream->handleData(Resource id
         #3325)                                                                                                         
         #17 vendor/react/event-loop/src/StreamSelectLoop.php(213):                                                     
         React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)                                                  
         #18 src/Console/Command/WorkerCommand.php(66): React\EventLoop\StreamSelectLoop->run()                         
         #19 vendor/symfony/console/Command/Command.php(308):                                                           
         Rector\Core\Console\Command\WorkerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput),          
         Object(Symfony\Component\Console\Output\ConsoleOutput))                                                        
         #20 vendor/symfony/console/Application.php(998):                                                               
         Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput),              
         Object(Symfony\Component\Console\Output\ConsoleOutput))                                                        
         #21 vendor/symfony/console/Application.php(299):                                                               
         Symfony\Component\Console\Application->doRunCommand(Object(Rector\Core\Console\Command\WorkerCommand),         
         Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))     
         #22 src/Console/ConsoleApplication.php(58):                                                                    
         Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput),                
         Object(Symfony\Component\Console\Output\ConsoleOutput))                                                        
         #23 vendor/symfony/console/Application.php(171):                                                               
         Rector\Core\Console\ConsoleApplication->doRun(Object(Symfony\Component\Console\Input\ArgvInput),               
         Object(Symfony\Component\Console\Output\ConsoleOutput))                                                        
         #24 bin/rector.php(159): Symfony\Component\Console\Application->run()                                          
         #25 bin/rector(4): require_once('/Users/samsonas...')                                                          
         #26 {main}". On line: 111                                                                                      
                                                              

@samsonasik samsonasik requested a review from TomasVotruba as a code owner June 25, 2022 04:04
@samsonasik samsonasik force-pushed the parallel-show-trace branch from 231200f to 5e78356 Compare June 25, 2022 04:08
@samsonasik samsonasik force-pushed the parallel-show-trace branch from 49e79d8 to 44069ac Compare June 25, 2022 04:12
@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba
Copy link
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit 24d2250 into main Jun 25, 2022
@TomasVotruba TomasVotruba deleted the parallel-show-trace branch June 25, 2022 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--debug doesn't show stack trace on parallel
2 participants