https://pantsbuild.org/ logo
#general
Title
# general
s

stocky-helmet-22655

04/12/2023, 3:23 PM
What is the appropriate way to run a pants
repl
within a
docker_environment
? If I start a docker container and try to run pants in it I run into the m1/m2 issues. I setup a
docker_environment
and it manages tests great, but if I run
pants repl
it runs on mac not in docker and I don't see a flag in the docs to tell it to do otherwise. I tried making a
pex_binary
and running that in docker, which appears to do what I want but it takes ~45s to start, which is way worse than running
pants repl
which takes ~4s.
r

refined-addition-53644

04/12/2023, 3:40 PM
s

stocky-helmet-22655

04/12/2023, 4:17 PM
Thanks for the suggestion - I just tried doing it the way Josh posted and it looks smart - it does cache and run super fast if I change nothing. If I tweak anything though (adding a print line for example) it takes a full minute to re-build the pex and run again
whereas
pants repl
runs within a second or two even if I make a change - the only issue being it's not in docker