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

Subsequent calls to cache:clear delete warmed up files #50474

Closed
Okhoshi opened this issue May 30, 2023 · 0 comments
Closed

Subsequent calls to cache:clear delete warmed up files #50474

Okhoshi opened this issue May 30, 2023 · 0 comments

Comments

@Okhoshi
Copy link
Contributor

Okhoshi commented May 30, 2023

Symfony version(s) affected

5.4.24,6.2.11

Description

#50253 forces the cache:clear to always run in the cache_dir, even when both build_dir and cache_dir are the same directory.

This leads to some files being deleted if the container cache is not fresh (which is always the case if the cache_dir directory was already existing and warmed up).

Since the optional CacheWarmers are run in the cache_dir, their artefacts are lost once the cache_dir is replaced with the warmup directory.

How to reproduce

s new --dir symfony_cache_dir_problem
cd ./symfony_cache_dir_problem
composer install -q
# See that router cache is warmed up
composer install -q
# See that router cache is missing

Possible Solution

No response

Additional Context

No response

@Okhoshi Okhoshi added the Bug label May 30, 2023
nicolas-grekas added a commit that referenced this issue Jul 7, 2023
…ubsequent runs (Okhoshi)

This PR was merged into the 5.4 branch.

Discussion
----------

[FrameworkBundle] Prevent `cache:clear` to lose files on subsequent runs

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #50474
| License       | MIT
| Doc PR        | N/A

See #50474 for the details and reproduction information.

Commits
-------

61bdd80 [FrameworkBundle] Prevent `cache:clear` to lose files on subsequent runs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants