<#19888 After clearing the `mypy` `named_cache`, i...
# github-notifications
c
#19888 After clearing the `mypy` `named_cache`, it is not recreated Issue created by stuhood Describe the bug After
rm -Rf ~/.cache/pants/named_caches/mypy_cache/
and restarting
pantsd
, the
mypy
named cache is (silently) never recreated. Pants version
main
at
eecd07908868af3e3e0d97a91852de2785b7b16c
. Additional info The following patch resolve the issue on `main`:
Copy code
diff --git a/src/python/pants/backend/python/typecheck/mypy/rules.py b/src/python/pants/backend/python/typecheck/mypy/rules.py
index c210836014..dc7ff89d37 100644
--- a/src/python/pants/backend/python/typecheck/mypy/rules.py
+++ b/src/python/pants/backend/python/typecheck/mypy/rules.py
@@ -294,7 +294,7 @@ async def mypy_typecheck_partition(
                             SANDBOX_CACHE_DIR="{run_cache_dir}/{py_version}"
                             SANDBOX_CACHE_DB="$SANDBOX_CACHE_DIR/cache.db"
 
-                            {mkdir.path} -p "$SANDBOX_CACHE_DIR" > /dev/null 2>&1
+                            {mkdir.path} -p "$SANDBOX_CACHE_DIR" "$NAMED_CACHE_DIR" > /dev/null 2>&1
                             {cp.path} "$NAMED_CACHE_DB" "$SANDBOX_CACHE_DB" > /dev/null 2>&1
 
                             {' '.join((shell_quote(arg) for arg in argv))}
... but bisecting on changes to
src/python/pants/backend/python/typecheck/mypy/rules.py
might show that this is only necessary when hardlinking. pantsbuild/pants