Limit esphome to compile only one binary at the time

When trying stuff with esphome a lot of times I make my HA crash(HA Yellow with 4GB of RAM)
so it’s not the hardware, but the esphome process.

What happens is that I’m working, start installing, (manual/wifi/com) and sometimes something is wrong, or the com connection breaks so I click stop.
The the background the compiling continuous, (I think). Sometimes this happens like 4 times.
then ESPHome is building the same binary for the same device 4 times and home assistant crashses.

there is nothing in the log, I checked and the last 5 minutes aren’t stored. the is because of the whole ssd wearout thing.(different issue, and not one I’m having)

now there is compile_process_limit which limits the number op cpu’s
but I’d rather have an option which checks if esphome is already compiling and if so stop the current process or just wait.

Als also the stop button should not just close the dialog. I should stop the process too.

I would have thought setting compile_process_limit to 1 would basically do what you want?

Only one can compile at a time and the others queue?

That’s my reading of the expected behaviour based on the docs anyway.

you have a point,
but while using it it looks like it’s the number of simultaneous processes per run.
meaning you are still able to have multiple runs at the same time. only once set to 1 they are single treated instead of multi treated which makes the process take longer.

I have not seen this issue, no matter how many times I press stop and then start a compile. Do you have proof?

I tried reproducing, but for somehow I couldn’t get it to reproduce.