I tried running `./pants run ::` but my BUILD file...
# general
g
I tried running
./pants run ::
but my BUILD file was misconfigured (I missed a field). But instead of spitting me back out to my prompt I got stuck in an infinite loop of trying to kill pantsd...
Copy code
^C09:13:11.71 [INFO] Sending SIGINT to pantsd with pid 23078, waiting up to 5.0 seconds before sending SIGKILL...
^C09:13:11.74 [INFO] Sending SIGINT to pantsd with pid 23078, waiting up to 5.0 seconds before sending SIGKILL...
^C09:13:20.06 [INFO] Sending SIGINT to pantsd with pid 23078, waiting up to 5.0 seconds before sending SIGKILL...
^C09:13:26.43 [INFO] Sending SIGINT to pantsd with pid 23078, waiting up to 5.0 seconds before sending SIGKILL...
^C09:13:44.45 [INFO] Sending SIGINT to pantsd with pid 23078, waiting up to 5.0 seconds before sending SIGKILL...
^C09:14:43.03 [INFO] Sending SIGINT to pantsd with pid 23078, waiting up to 5.0 seconds before sending SIGKILL...
And now the only way to escape pants-hell is to forcefully kill my terminal session entirely.
👍 1
A fix would be appreciated, but otherwise please consider this a bug ticket. I'll happily try to reproduce this bug with better logging if needed.
h
Thanks Meerkat! Indeed a bug. Stu will be back tomorrow and may ask for additional info, but sounds fairly easy to reproduce. In the meantime, you can open a new tab and use
kill -9 <pid>
, using the pid from that log message
g
Yep, I also had to go in and delete all the .* pants files. Can I just go onto github and file the bug myself?
h
Please do!
g
I'm now Tory, instead of Meerkat, my hacker alias.
💯 1
Since this is more professional forum.
👖 1
👍 1
Pants 2 is all rust, right?
h
About 30% rust, 70% python. The execution engine is written in rust, but all build logic is written in typed Python 3. You model things like “run a subprocess with these args” in python, and it gets sent to Rust through FFI for performance reasons
g
Awesome. Maybe I'll try to fix this bug myself. Rust and fully typed python are the two best languages in existence.
💯 1
❤️ 2
h
I’m not super familiar with the pantsd part of the codebase, but Stu and/or Greg would love to help you with that if interested, like some starter instructions (Although warning pantsd code is some of our oldest. We’re rewriting it to Rust slowly, in part for better correctness)
g
I'd say I'm an expert at typed python, but I'm looking for an excuse to learn Rust (to move away from C). This might be a good starter ticket.
💯 2
h
I’ve been learning Rust too thanks to Pants :) folks are very helpful If you don’t yet have it, The Rust Book is a great place to start with learning Rust as well. https://www.amazon.com/dp/1718500440/ref=cm_sw_r_cp_api_i_-dTNFbZ11HQCM free ebook version https://doc.rust-lang.org/book/
h
@gorgeous-eve-12553 unfortunately the code around pantsd signal-handling is rather messy. that log message comes from https://github.com/pantsbuild/pants/blob/master/src/python/pants/bin/remote_pants_runner.py#L62 , which is a SIGINT signal-handler in the client code that should be forwarding that signal to pantsd to make it exit. not sure why that's not working
in the long term we'd like to replace a lot of this code with a better rust abstraction that doesn't rely on forwarding signals to pantsd
@witty-crayon-22786 fyi