Can I force the Arduino IDE to recompile everything?

The pre-compiling and caching is really convenient most of the time, but what can I do to force the IDE to compile everything again, including all libs, and core, and what have you?

As for libraries, just switch to a different board, compile, then switch back to the previous board and compile again.

The situation is more difficult with the core because the core is cached for each board so compiling for a different board doesn't clear the previously cached core. With the classic Arduino IDE, the core cache is deleted after you exit, so you could just restart the IDE but Arduino IDE 2.x doesn't clear the core cache and continues to use it the next time it is loaded. So I think your only option is to delete the cache. You can see the location in the verbose output.

I think I got into this trap of caching. An option to clear the complete cache is definitively something needed in the IDE!

What do you mean by that?

I made a change to some "core" values, and now they seem to be kept in the cache, and I can't change them back.

Am I mistaken, or is a change in Tools-->Core Debug Level also forcing a complete re-compile of the core?

That is a little bit easier to do?

In order to make all relevant information available to all who are interested in this subject, I'll share a link to the related discussion at:

Yes, but it doesn't clear the previous cache. So if you switch back to the previous setting then the cache for that FQBN is used.

So this workaround is limited both to boards that have custom board options that are trivial enough to select arbitrarily and also the number of such options.

My current "solution" on Ubuntu Linux is to delete everything arduino-* in directory /tmp. Inconvenient, but it is the least inconvenient.

I also ended up determining that this is the only way to clear the compilation caches.

Arduino CLI does have an arduino-cli compile --clean flag:
https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_compile/#options

--clean                        Optional, cleanup the build folder and do not use any cached build.

But that's only for Arduino CLI, not Arduino IDE as you are asking about.

Doesn't it make you wonder why other people also found it necessary to have such an option? No surprise, really, since all compilers have a "clean" option.

So, the function already exist. You are only trying to make it impossible to access this from the IDE, and force people to delete cached files from the file system. Why that? I guess it is a not so rare occurrence for any programmer that you think you have cornered yourself and want to restart with a clean plate.

Not even close to true. The “clean” option is typically added by the build system - make, cmake, ant, or whatever…. (Also the “caching” is not done by the compiler.)

The thing that makes the Arduino IDE special and valuable is its focus on providing a gentle learning curve. This is accomplished by a UI that doesn't overwhelm the new user with zillions of cryptic options they have no use for, yet don't know enough to know that they have no use for. This means that there must be a clear need or significant benefit for adding any additional UI component. You still have not made a compelling case for why this UI component is needed. If we added every UI component that anyone requested over the years, it would just be another Visual Studio by now. We already have Visual Studio, Eclipse, Keil, etc., so Arduino producing yet another would not offer anything of value to the world.

The situation is different when it comes to Arduino CLI. Arduino CLI is only intended to be used directly by advanced users (everyone else will use it via the IDEs or Arduino Web Editor). Although it is still important to provide an intuitive UI, we are much more free to add advanced options that will only be of interest to the advanced users it is intended for.

I hear the message: "Move elsewhere if you want a full IDE". Too bad.

Unfortunately that's the message I got too.