I want to confirm something, I cannot find the doc...
# general
a
I want to confirm something, I cannot find the docs now but, is pants supposed to build the pex for a
pex_binary
in two steps, one with the external requirements, one with the first party source files?
b
Not in the default configuration of
pex_binary
, no. What’s the background for the question?
a
The background is that, ignoring the time people spend on their own computers running pants fmt, lint, or check, only to wait 1-2 minutes to get the external deps installed, this also happens on the CI, accounting for something like 50% if not more of the time.
b
Hm. Are you using resolves and lockfiles?
a
That wouldn't help, but we can't, because having interpreter constraints parametrised doesn't work with lockfiles.
I mean, the decision to force us into this, when it's clearly dysfunctional currently is a story for another time, but I'm 99% sure I saw this somewhere in the docs/a blog post. And, sometimes, it does actually work, just not always.
b
Hm. I suspect it's going to be an uphill battle to get to great performance without a lockfile (which, AIUI, caches the resolution results and avoids having to run that full procedure on every execution). I think https://github.com/pantsbuild/pants/issues/18292 is a relevant issue, and the discussion there touches on a possible work-around: using a loop to generate targets that pair ICs and resolves: https://github.com/pantsbuild/pants/issues/18292#issuecomment-1522868435 I guess you might also need https://www.pantsbuild.org/docs/reference-python#resolves_to_interpreter_constraints