Closed
Description
Symfony version(s) affected: 5.2.x
Description
Clearing the cache with latest symfony breaks on api-platform/core
How to reproduce
git clone [email protected]:api-platform/core
cd core
# If you have moreutils, or just add the minimum-stability dev to the composer.json
jq '. + {"minimum-stability": "dev"}' composer.json | sponge composer.json
composer install
php tests/Fixtures/app/console cache:warmup -vv
This will lead to an out of memory error (be sure you don't use memory_limit=-1
)
Possible Solution
Revert the code changed in PhpDumper (see https://github.com/symfony/symfony/pull/38980/files#diff-82d7ebdd6477cecb404b0d3f100a9026e950529edb9a665460ae0330dfad7080L454)
foreach ($edges as $edge) {
$node = $edge->getDestNode();
$id = $node->getId();
+ if (!$node->getValue() instanceof Definition || $sourceId === $id || $edge->isLazy() || $edge->isWeak()) {
- if (!$node->getValue() instanceof Definition || $sourceId === $id || $edge->isWeak()) {
continue;
}
If you reproduced and want to try the fix, just rm -rf tests/Fixtures/app/var/cache/
and use the command again.
ref: #38980