# Feature request: "clean build" option

**URL:** <https://forum.arduino.cc/t/feature-request-clean-build-option/1291789>\
**Category:** IDE 2.x\
**Created:** [August 14, 2024, 3:25pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789 "2024-08-14T15:25:21Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![fseaman\_js](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/fseaman_js/32/977700_2.png) [@fseaman\_js](https://forum.arduino.cc/u/fseaman_js)\
**Post date:** [August 14, 2024, 3:25pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/1 "2024-08-14T15:25:21Z")

</div>

Most build/make/compile/upload systems have an option to "clean" previously compiled libraries.

I can not find such an option in the IDE

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [August 14, 2024, 3:28pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/2 "2024-08-14T15:28:30Z")

</div>

What would be the benefit?

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [August 14, 2024, 3:56pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/3 "2024-08-14T15:56:22Z")

</div>

Sounds good to me. If not all changes to dependencies are detected which could render a cached copy stale, then a fresh start, at least as a trouble shooting measure, is a good idea.  
In Sloeber, the Eclipse version of the IDE, there is such an option for a clean build.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [August 14, 2024, 4:33pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/4 "2024-08-14T16:33:36Z")

</div>

> [@J-M-L](#):
>
> What would be the benefit?

So you can clear the cache if that is necessary so you're sure that it compiles the correct files from scratch. I'm reasonably sure that I've advised in the past to delete the cache directory to solve problems.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [August 14, 2024, 4:40pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/5 "2024-08-14T16:40:25Z")

</div>

Been programming for over 50 years, never encountered that. Libraries are not yours in any case.

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [August 14, 2024, 4:42pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/6 "2024-08-14T16:42:00Z")

</div>

I used in the past make clean o get rid of all the binary files etc and have lighter directory to transport or send (at the time storage space or bandwidth was an issue), I must say it has been long since I had to do it.

It would not hurt, but is it a priority ?

---

<div class="post-metadata">

**Author:** ![fseaman\_js](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/fseaman_js/32/977700_2.png) [@fseaman\_js](https://forum.arduino.cc/u/fseaman_js)\
**Post date:** [August 14, 2024, 11:46pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/7 "2024-08-14T23:46:30Z")

</div>

I been programming over 50 years. "C" programming since 1982. Used it all the time.

I write libraries. I write device drivers. I write applications. When using someone else's library, I had say because I was the project lead. Many times I was the designer.

For these SBC/SOC/Dev boards libraries are "mine". They are compiled on my machine. If I want to trigger a recompile, I want to trigger a recompile. Period.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [August 14, 2024, 11:58pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/8 "2024-08-14T23:58:27Z")

</div>

Hi @fseaman_js. Thanks for taking the time to submit a feature request.

There is, and never will be, such an option because no such option is needed. Arduino IDE is designed to be friendly to beginners and this is done by not cluttering up the UI with unnecessary components.

It is unnecessary Arduino IDE is smart enough to automatically recompile when necessary. It is true that there are some rarely encountered bugs that cause it to not do that, but it would be silly to add an option as a workaround for a bug. The development resources would be better spent on fixing the bug.

* * *

If you need this type of advanced functionality, I recommend using **Arduino CLI** :

[https://arduino.github.io/arduino-cli/](https://arduino.github.io/arduino-cli/)

You can add the [`--clean` flag](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_compile/#options) to the [`arduino-cli compile` command]([Redirecting](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_compile) if you want to clear the cache.

---

<div class="post-metadata">

**Author:** ![fseaman\_js](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/fseaman_js/32/977700_2.png) [@fseaman\_js](https://forum.arduino.cc/u/fseaman_js)\
**Post date:** [August 15, 2024, 3:35am UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/9 "2024-08-15T03:35:55Z")

</div>

Dear Arduino Team member(s),

Thank you for your reply, that makes sense.

I did not know of Arduino CLI.

From Arduino CLI documentation "The compile step is skipped if the .o and .d files exist and have timestamps newer than the source and all the dependent files. If the source or any dependent file has been modified, or any error occurs verifying the files"

I wanted it for chasing warnings that do not reappear if the .o/.d file exists and is newer than source. I don't like warnings. Make/build logic standardized on "if .o/.d is newer than source, do not compile" long ago. It's fine for normal situations. Sometimes for us "advanced and experienced" long time coders using someone else's library requires chasing these warnings.

I will try the CLI but may find it easier to either "touch" the source or delete the .o/.d

I rescind my request.

Thank you again.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [August 15, 2024, 3:39am UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/10 "2024-08-15T03:39:33Z")

</div>

> [@fseaman\_js](#):
>
> I wanted it for chasing warnings that do not reappear if the .o/.d file exists and is newer than source.

Yes, this is a very good point. The Arduino CLI developers are tracking the need to display the warnings that were produced by the compilation of the cached objects here:

> <https://github.com/arduino/arduino-cli/issues/1008>
>
> \### Describe the problem
> 
> Compiler warnings for code from non-\`.ino\` source fi…les are not shown on subsequent sketch compilations.
> 
> \### To reproduce
> 
> When someone writes code like this (see below) he will correctly get two identical warnings: 
> \*\*\`"warning: deprecated conversion from string constant to 'char\*' \[-Wwrite-strings\]"\`\*\*
> 
> When one compiles it again the warnings will all \*\*disappear\*\* so the user (me) thinks he is perfectly fine and writing clean code. 
> 
> \*\*FunFact:\*\* This will \*\*not\*\* happen if all code is written to the main (.ino) file.
> 
> File \`DummyClass.h\`:
> 
> \`\`\` C++
> class DummyClass
> {
> public:
> char\* getString();
> 
> char\* getSecondString();
> };
> \`\`\`
> 
> File \`DummyClass.cpp\`:
> 
> \`\`\` C++
> char\* DummyClass::getString()
> {
> return "Some String";
> }
> 
> char\* DummyClass::getSecondString()
> {
> return "Some other string";
> }
> \`\`\`
> 
> File \`test.ino\`:
> 
> \`\`\` C++
> \#include "DummyClass.h"
> DummyClass dummy;
> 
> void setup()
> {
> Serial.begin(115200);
> }
> void loop()
> {
> Serial.println(dummy.getString());
> delay(1000);
> }
> \`\`\`
> 
> \### Expected behavior
> 
> Compiler warnings are shown every time the sketch is compiled if the code would produce a warning.
> 
> \### Arduino CLI version
> 
> 60a8aa96c725d0ebce9bbe4586013908669f14ff
> 
> \### Operating system
> 
> All
> 
> \### Operating system version
> 
> Any
> 
> \### Additional context
> 
> \#### Additional reports
> 
> \- https://forum.arduino.cc/t/arduino-ide-2-0-3-duplicate-tab-page/1084561/5
> \- https://forum.arduino.cc/t/warning-disappears-after-second-compilation/1139615
> \- https://forum.arduino.cc/t/bad-behaviour-using-keypad/1231737/9
> 
> \#### Related
> 
> \- https://github.com/arduino/arduino-cli/issues/2204
> 
> \### Issue checklist
> 
> \- \[X\] I searched for previous reports in \[the issue tracker\](https://github.com/arduino/arduino-cli/issues?q=)
> \- \[X\] I verified the problem still occurs when using the \[nightly build\](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)
> \- \[X\] My report contains all necessary details

(Arduino CLI is used under the hood by Arduino IDE to compile sketches, so any such fix implemented in Arduino CLI will also apply to Arduino IDE)

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [August 15, 2024, 8:58am UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/11 "2024-08-15T08:58:19Z")

</div>

> [@fseaman\_js](#):
>
> I wanted it for chasing warnings that do not reappear if the .o/.d file exists and is newer than source

That's a Fair requirement.

This is often an issue with open source libraries that are poorly coded (or coded in the past when compiler's options were not as stringent and that went unnoticed at the time).

I usually fix them on my system if the warning is important enough and sometimes would report to GitHub if it's a library I use often so the the author fixes it for everyone.

---

<div class="post-metadata">

**Author:** ![fseaman\_js](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/fseaman_js/32/977700_2.png) [@fseaman\_js](https://forum.arduino.cc/u/fseaman_js)\
**Post date:** [August 16, 2024, 6:50pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/12 "2024-08-16T18:50:16Z")

</div>

Yup. Same here. I have the current issue of having to switch between 2.0.14, 2.0.17 and current 3.0.4 under the ESP32 board definitions. With that, library fixes for more stringent rules are "difficult" as fixing for one breaks other.

I try to contribute back to the master but sometimes the CO (Code Originator) is no longer available. Then what?

I could branch the library after fixing it but how to get the news to the community that there is a new branch with a maintainer actively working it?

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [August 16, 2024, 9:37pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/13 "2024-08-16T21:37:40Z")

</div>

Some sort of "clean" command is "nice to have" when you are uncertain whether all of the dependencies are getting calculated correctly.

I'm pretty sure I've run into situations where this has been the case. Not in the course of "ordinary" Arduino usage, but perhaps when doing edge stuff like modifying compiler flags in platform.txt. It doesn't help that the cached versions are so hard to find, and persist over occurrences that used to remove them (like restarting the IDE.)

And I don't really want Arduino to make the IDE (or Arduino-cli) so complex that it can actually detect every possible dependencies in every questionably-written 3rd party package or implementation. A "Make clean" equivalent may be a crude hammer, but it would be ... sufficient.

---

<div class="post-metadata">

**Author:** ![eknovack](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/eknovack/32/1183315_2.png) [@eknovack](https://forum.arduino.cc/u/eknovack)\
**Post date:** [January 24, 2025, 3:51pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/14 "2025-01-24T15:51:24Z")

</div>

I just ran into this issue myself. I was compiling the LVGL demo, and made a change to the configuration file. This change was never noticed by the Arduino compilation system, so I was constantly getting compile errors.

The only fix was to manually clear the cache, which really should be an option on the IDE.

To say it is not required is a sign of the problem. You could easily add this option to the advanced menu options. Not having this option continues to cause pain and suffering and even confusion to people without the experience using your product.

I have also been a software engineer since the mid 1980's and really liked your system to bring embedded programing to the masses. It's just frustrating to have to manually fix a the issue, after first spending the time to find out what the darn problem is.

A basic full clean option should be added to your IDE.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 23, 2025, 3:51pm UTC](https://forum.arduino.cc/t/feature-request-clean-build-option/1291789/15 "2025-07-23T15:51:36Z")

</div>

Closed on July 23, 2025, 3:51pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
