Skip to content

Commit b0319af

Browse files
authored
In bazel mode, always use "." as the cache prefix. (python#6122)
Without this, the files in the cache map aren't found, and the build becomes O(N^2).
1 parent 17da113 commit b0319af

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy/build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,9 @@ def _load_json_file(file: str, manager: BuildManager,
802802

803803
def _cache_dir_prefix(manager: BuildManager) -> str:
804804
"""Get current cache directory (or file if id is given)."""
805+
if manager.options.bazel:
806+
# This is needed so the cache map works.
807+
return os.curdir
805808
cache_dir = manager.options.cache_dir
806809
pyversion = manager.options.python_version
807810
base = os.path.join(cache_dir, '%d.%d' % pyversion)

0 commit comments

Comments
 (0)