wide-energy-11069
02/27/2020, 12:28 AM./pants fmt2
vs running black
directly on CLI for adhoc files? If yes, does the pants invocation pick up additional config?hundreds-father-404
02/27/2020, 12:29 AMaloof-angle-91616
02/27/2020, 12:29 AMhundreds-father-404
02/27/2020, 12:30 AMhundreds-father-404
02/27/2020, 12:31 AMaloof-angle-91616
02/27/2020, 12:31 AMaloof-angle-91616
02/27/2020, 12:32 AMwide-energy-11069
02/27/2020, 12:32 AMhundreds-father-404
02/27/2020, 12:34 AMwhy aren’t we using the black cache?Possibly, we will want to use the Black cache one day. Although, I think Pierre found that it has system-specific information like what OS you ran, which means that it would not be safe for remote execution For now, we’re focused on improving performance for all 6 Python linters rather than focusing on specifically the 1 tool that already has a cache
hundreds-father-404
02/27/2020, 12:35 AMaloof-angle-91616
02/27/2020, 12:36 AMhundreds-father-404
02/27/2020, 12:39 AMi wasn’t thinking we’d use the black cache with remote executionPossibly, we don’t in the future. But that would involve a whole new layer of infrastructure for the engine to say “I want to be able to run this with RBE, but don’t capture the cache output files iff it’s RBE”. Certainly possible, but not where Toolchain plans to invest it’s time for now. For now, the focus is https://docs.google.com/document/d/1Tdof6jx9aVaOGeIQeI9Gn-8x7nd6LfjnJ0QrbLFBbgc/edit#heading=h.oyst624c2sph
aloof-angle-91616
02/27/2020, 12:41 AMCertainly possible, but not where Toolchain plans to invest it’s time for now.if black and mypy are significantly faster with it, then it's not clear what focusing on 100% remote execution gets us. twitter had to shutter a large project last year because of the desire to make everything work 100% with remote execution and refusing to listen to the facts on the ground. just a warning.
happy-kitchen-89482
02/27/2020, 1:02 AMaloof-angle-91616
02/27/2020, 1:03 AMhundreds-father-404
02/27/2020, 1:06 AMi think the black and mypy caches could be incorporated as well as the normal process execution caching to improve performance over remotingVery likely, yes. We’re only saying that it’s not Toolchain’s current focus to leverage their pre-existing caches but it is very plausibly a good future optimization. And +1 to Benjy’s point about the importance of performance for local execution
aloof-angle-91616
02/27/2020, 2:16 AMfancy-motherboard-24956
02/27/2020, 11:31 AMHi, on a high level, is there any difference between runningOne thought here, in addition to all that’s been said: I don’t think there should be a stigma for running black manually: if you happen to have the tool installed and you’re comfy runningvs running./pants fmt2
directly on CLI for adhoc files?black
./black my-directory
, that’s totally OK too. It will do the exact same thing as ./pants fmt2
since we don’t pick extra configs.
In particular, I think that setting up the black plugin from your favourite text editor and enabling format on save without any hackery to make your editor aware of pants is a great usecase for “raw black usage” 🙂hundreds-father-404
02/27/2020, 2:12 PMwhat performance goal are you aiming to achieve?Not any particular number. Right now, running
./pants fmt2 ::
on a cold cache is 5-30x slower than the tools directly. We want to get that number closer to 1-2x slower (for now)
With the medium term proposal in that doc, we’re okay with slightly slower on a completely cold cache but want it to be faster to use Pants than the direct tools when the cache is even only a little warm,