Opening Serial Monitor runs PIO extra_tasks

OK tying the pre hook to a file is folly.

Works okay if I clean before every build, but that is just wasting a whole bunch of time, which is super frustrating.

@maxgerhardt I note that in your solution for the following thread - How do I run a script before compiling a project? - #6 by maxgerhardt

Ah okay. But if the file release_page.h is only needed in webserver.c, then why not hook its pre-action with env.AddPreAction("${BUILD_DIR}/esp-idf/main/webserver.c.o", before_build)? Building shouldn’t continue then until the script function has finished executing.

It appears to imply that the hook is tied to the file mentioned.

However the file is called multiple times in the project so this solution does not work for me as the multithreaded nature means that one of the other files continues compilation and then crashes out.

The suggestion of changing to a singlethread again is not a viable solution as…

Any solution that creates a different problem is not a solution

What am I missing.

What hook can I used to achieve my goal? (bearing in mind that this is still trying to hack preventing the serial monitor from running extra_scripts).

Would really appreciate some input here.

Kinda feel like I’m pissing into the wind

/DM