broad-processor-92400
11/10/2022, 10:56 PM./pants check ::
runs 10x faster when there's a small change to python code), thank you! However, I noticed that there seems to be a single cache.db
file per python verison in ~/.cache/pants/named_caches/mypy_cache/
. Does that mean a single cache is used for all invocations of mypy via pants?
E.g. I've got multiple check-outs of our internal company repo (sharing a cache seems to make sense between them...), but also the pants repo, and sharing a cache between the pants and our internal one seems a bit unexpected?witty-crayon-22786
11/10/2022, 10:59 PMbitter-ability-32190
11/10/2022, 11:08 PMbitter-ability-32190
11/10/2022, 11:10 PMwitty-crayon-22786
11/10/2022, 11:10 PMYes! IIRC pants has a unique dir for these things per repo.mm, we do not
bitter-ability-32190
11/10/2022, 11:14 PMbitter-ability-32190
11/10/2022, 11:16 PMbroad-processor-92400
11/10/2022, 11:18 PM$ tree ~/.cache/pants/named_caches/mypy_cache/
/Users/huon/.cache/pants/named_caches/mypy_cache/
├── 3.7
│ └── cache.db
├── 3.8
│ └── cache.db
└── 3.9
└── cache.db
broad-processor-92400
11/10/2022, 11:19 PMfiles.path
s are all relative to source roots, rather than scoped at allwitty-crayon-22786
11/10/2022, 11:19 PMappend_only_caches
is wrong: https://github.com/pantsbuild/pants/blob/952235a048e8af742367867b5b7ca21243d020b6/src/python/pants/backend/python/typecheck/mypy/rules.py#L334witty-crayon-22786
11/10/2022, 11:19 PMmypy_cache
, but it will create it at a different place in the sandbox each time.witty-crayon-22786
11/10/2022, 11:20 PMnamed_cache_dir
and run_cache_dir
should maybe be swappedwitty-crayon-22786
11/10/2022, 11:26 PMbitter-ability-32190
11/10/2022, 11:26 PMwitty-crayon-22786
11/10/2022, 11:26 PMappend_only_caches
is definitely not the most obvious APIbitter-ability-32190
11/10/2022, 11:28 PMwitty-crayon-22786
11/10/2022, 11:30 PMappend_only_caches
from per-repo caches… global_named_caches
and repo_named_caches
…?broad-processor-92400
11/10/2022, 11:31 PMwitty-crayon-22786
11/10/2022, 11:31 PMbroad-processor-92400
11/10/2022, 11:31 PMbroad-processor-92400
11/10/2022, 11:32 PMbuild_root
is (essentially/usually) the absolute path of directory containing the ./pants
script?
Does this mean that multiple check-outs (or multiple git worktrees) of a single repo wouldn't be able to share the cache? I guess that sounds bad for concurrency...bitter-ability-32190
11/10/2022, 11:33 PMbitter-ability-32190
11/10/2022, 11:33 PM