with the new `run_goal_use_sandbox` is there a way...
# general
g
with the new
run_goal_use_sandbox
is there a way to make
restartable
usable too? atm it only works on
pex_binary
but thats slowing down the dev iterations massively.
b
It'd need to be added, but I don't see why not 🤔
File an issue
h
@gentle-sugar-52379 what is causing the slowdown?
creating the sandbox?
b
(Our most-run command has a 2-second overhead from end-to-end from Pants perspective (with the
main
swapped with
pass
and all imports not executed). I'd love to whittle that down)
h
When run in-source-tree or in-sandbox?
b
well, in-source-tree still uses a sandbox, so yes 🙂
g
maybe im doaing something wrong. if i change a source file the whole pex gets recreated. in my case this leeds to a 1min waiting phase even after the slightest change. it's possible my mind is tricking me but i think this was not the case with 2.13.0. now im running 2.14r.0rc1
h
Are you running
./pants run path/to:main_target
or ./pants run
path/to/main.py
?
The former is equivalent to rebuilding the pex and then running it. The latter should be fast.
🙏 1
g
you are absolutely right! i was doing the first thing... another layer 8 error fixed 😄
🙌 1
b
@gentle-sugar-52379 sorry for the headache. The long arc here of this change was to make things more intuitive and simple ("just run my file"), however that meant a bit of turning things on its head. The good news is once you're cozy, you can actually remove all the pex_binary targets solely for running a script (don't need to be packaged)
Also if you need the binary targets, you might consider an alternative layout, zipapp has the penalty of needing to be zipped