Hi, this is more of a learner’s question - as in t...
# general
a
Hi, this is more of a learner’s question - as in to understand how Pants work: when do the venvs under
~/.cache/pants/named_caches/pex_root/venvs
get created? I see a bunch of them in my linux Docker container where I run Pants, why is that so? Why can’t there be only one venv? Moreover, how are the directories under
venvs/
named? After some SHA256 (of what)? And then sub-directories under them which eventually have pex installed? For example, the last two directories in this path:
~/.cache/pants/named_caches/pex_root/venvs/f61cf2fb294c1349fb246a9500aef689076f209a/319fabea91de21f4b9853622585d1be26b57025e/
w
Pants builds each target using only its dependencies
this results in smaller cache keys, so you can hit caches in more cases
and it means that each of your
pex_binary
targets (for example) contain only what you actually need to ship them.
a
Ok, so these venvs gets built for every target that I
package
,
publish
, or
test
? And let’s say I am
packaging
the same target the second time without any changes in code or BUILD files, Pants would use the same venv from its cache and the keys are probably the name of the directories?
👍 1
w
that’s correct
👍 1
a
I am looking at this code and trying to understand if the SHA256 mentioned on lines from 13 to 16 are the ones for binaries hosted on URL: https://binaries.pantsbuild.org/bin/grpc_python_plugin/{version}/{platform}/grpc_python_plugin? Should these SHA256 match for a given platform if I build grpc version 1.32.0 from its source and then check shasum of grpc_python_plugin file?
w
That is probably a different question: would you mind asking it in a new thread?
(it's a different use of hashing)
a
Oh, I am so sorry. I thought I was sending it in general channel.
Thanks for the response but I posted it again there as I have some follow up questions as well.