<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>&gt;4.0.3</td>
</tr>
</tbody>
</table>
<p dir="auto">After update Symfony to version 4.0.3 (4.0.4 -the same)  cache:clear command (with implicit cache warming) warms up cache incorrectly. As i can compare with 4.0.2 cache folder some dependencies is not warmed.</p>
<p dir="auto"><strong>4.0.3</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="root@bacac0721dd9:/var/www/symfony# bin/console ca:cl -e=prod
root@bacac0721dd9:/var/www/symfony# ls -1 var/cache/prod/
ContainerM4N54hq
annotations.map
srcProdProjectContainer.php
srcProdProjectContainer.php.meta
srcProdProjectContainerUrlGenerator.php
srcProdProjectContainerUrlGenerator.php.meta
srcProdProjectContainerUrlMatcher.php
srcProdProjectContainerUrlMatcher.php.meta
templates.php"><pre class="notranslate">root@bacac0721dd9:/var/www/symfony# bin/console ca:cl -e=prod
root@bacac0721dd9:/var/www/symfony# ls -1 var/cache/prod/
ContainerM4N54hq
annotations.map
srcProdProjectContainer.php
srcProdProjectContainer.php.meta
srcProdProjectContainerUrlGenerator.php
srcProdProjectContainerUrlGenerator.php.meta
srcProdProjectContainerUrlMatcher.php
srcProdProjectContainerUrlMatcher.php.meta
templates.php</pre></div>
<p dir="auto"><strong>4.0.2</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="root@bacac0721dd9:/var/www/symfony# bin/console ca:cl -e=prod
root@bacac0721dd9:/var/www/symfony# ls -1 var/cache/prod/
ContainerW99Fklq
annotations.map
annotations.php
doctrine
easy_admin
pools
serialization.php
srcProdProjectContainer.php
srcProdProjectContainer.php.meta
srcProdProjectContainerUrlGenerator.php
srcProdProjectContainerUrlGenerator.php.meta
srcProdProjectContainerUrlMatcher.php
srcProdProjectContainerUrlMatcher.php.meta
templates.php
translations
twig
validation.php"><pre class="notranslate">root@bacac0721dd9:/var/www/symfony# bin/console ca:cl -e=prod
root@bacac0721dd9:/var/www/symfony# ls -1 var/cache/prod/
ContainerW99Fklq
annotations.map
annotations.php
doctrine
easy_admin
pools
serialization.php
srcProdProjectContainer.php
srcProdProjectContainer.php.meta
srcProdProjectContainerUrlGenerator.php
srcProdProjectContainerUrlGenerator.php.meta
srcProdProjectContainerUrlMatcher.php
srcProdProjectContainerUrlMatcher.php.meta
templates.php
translations
twig
validation.php</pre></div>
<p dir="auto">For develop env it isn't critical, but for production it is.<br>
ps As workaround i used <code class="notranslate">bin/console cache:warmup -e=prod</code> after</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.4</td>
</tr>
</tbody>
</table>
<p dir="auto">There seems to be a BC break in Symfony 3.4 when clearing/warming the cache.</p>
<p dir="auto">Until a couple of days ago, it was possible to write to <code class="notranslate">%kernel.cache_dir%</code> during cache warming and the contents would persist. Now they are deleted when the cache directory is moved from <code class="notranslate">de_</code> to <code class="notranslate">dev</code>. However, when using the <code class="notranslate">$cacheDir</code> parameter provided to the <code class="notranslate">warmUp</code> method, the files are kept.</p>
<p dir="auto">I realize that using the path provided to <code class="notranslate">warmUp</code> is preferred, but we have different places in our code base where the path is injected to cache warming services through the service configuration. This way, we can configure a common path for shared cache objects and use a common cache service.</p>
<p dir="auto">Example:</p>
<p dir="auto"><a href="https://gist.github.com/lxg/de91dad64059a63c3ffed0e4179aa057">https://gist.github.com/lxg/de91dad64059a63c3ffed0e4179aa057</a><br>
<a href="https://gist.github.com/lxg/05299c118bba0db197327cb1b07ca091">https://gist.github.com/lxg/05299c118bba0db197327cb1b07ca091</a></p>
<p dir="auto">I agree that this could be solved differently. However, this change breaks the previous behaviour which has been there since several years.</p>