Do we support conditional targets in a BUILD file?...
# development
w
Do we support conditional targets in a BUILD file? As in - inject this only if the backend is loaded? Could this be provided as part of a macro?
Or alternatively, use a macro to shim a target - with the real one conditionally replacing it?
This commit is the difference of about 20ish seconds per ANYTHING on my machine, to around 6 seconds: https://github.com/pantsbuild/pants/compare/main...sureshjoshi:pants:fewer-backends JVM being the primary contributor. If I could get JS/TS out (we seem to be using them for some reason in the repo), I think we could shave another 2 seconds off
b
one could hack something up with
if env("..."): ...
or similar, but setting the env vars automatically would require some magic (e.g. have
.pants.bootstrap
check
pants.toml
or something)
f
This commit is the difference of about 20ish seconds per ANYTHING on my machine, to around 6 seconds:
Is this for the first command (so pantsd must start) or even after that? cold boot pantsd performance has been something I've noticed on our builds but haven't really investigated yet
w
one could hack something up with
if env("..."): ...
or similar, but setting the env vars automatically would require some magic (e.g. have
.pants.bootstrap
check
pants.toml
or something)
Oof, yeah, just hacks all the way down
Is this for the first command (so pantsd must start) or even after that? cold boot pantsd performance has been something I've noticed on our builds but haven't really investigated yet
This is specifically in the pants main repo, because there is so much stuff that needs to be churned through on every change. Outside of the repo, I haven't had that much of an issue. Noticeable, but in the order of a second or two-ish
There's a safe bet that the rule solver is taking up a bunch of time - but none of the quick hacks will reduce that. That's a longer process, which is tediously ongoing
f
Interesting, what I've seen on our macs is ~10s till first rule can run, but in our CI (linux, in docker) we're at ~27s to first rule, so its considerable.
w
🤮
Lots of backends? Lots of targets?
f
I think our external plugin (hosted on an internal pypi feed, but its already downloaded in these timings) is the main cause, thats the only "obvious" thing I see in the debug logs. We have a good number of rules, but I don't think its that many
w
That seems like a lot of time 🤷 You can vendor it directly into your repo, and it should be pretty quick - unless it runs on startup