Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to clean project (like have in Eclipse and Platformio) #8680

Closed
JoaoLopesF opened this issue Mar 19, 2019 · 4 comments
Closed

Option to clean project (like have in Eclipse and Platformio) #8680

JoaoLopesF opened this issue Mar 19, 2019 · 4 comments
Labels
feature request A request to make an enhancement (not a bug fix) Waiting for feedback More information must be provided before we can proceed

Comments

@JoaoLopesF
Copy link

JoaoLopesF commented Mar 19, 2019

Hi, I am be a Arduino Libraries author too,

And I have some options (#defines) to the programmer,
can change, e.g. disable all debug, to affect behaviors on library.

But it not affect the compiled binary, sometimes,
due Arduino IDE used cached compiled files of libraries.
E.g.:
Compiling library "RemoteDebug" Using previously compiled file: /var/folders/6g/c30wh2nx7t15v_6cl5txwdyw0000gp/T/arduino_build_88941/libraries/RemoteDebug/RemoteDebugWS.cpp.o Using previously compiled file: /var/folders/6g/c30wh2nx7t15v_6cl5txwdyw0000gp/T/arduino_build_88941/libraries/RemoteDebug/RemoteDebug.cpp.o Using previously compiled file: /var/folders/6g/c30wh2nx7t15v_6cl5txwdyw0000gp/T/arduino_build_88941/libraries/RemoteDebug/utility/WebSocketsClient.cpp.o Using previously compiled file: /var/folders/6g/c30wh2nx7t15v_6cl5txwdyw0000gp/T/arduino_build_88941/libraries/RemoteDebug/utility/WebSockets.cpp.o Using previously compiled file: /var/folders/6g/c30wh2nx7t15v_6cl5txwdyw0000gp/T/arduino_build_88941/libraries/RemoteDebug/utility/WebSocketsServer.cpp.o Using previously compiled file: /var/folders/6g/c30wh2nx7t15v_6cl5txwdyw0000gp/T/arduino_build_88941/libraries/RemoteDebug/utility/libb64/cencode.c.o Using previously compiled file: /var/folders/6g/c30wh2nx7t15v_6cl5txwdyw0000gp/T/arduino_build_88941/libraries/RemoteDebug/utility/libb64/cdecode.c.o Using previously compiled file: /var/folders/6g/c30wh2nx7t15v_6cl5txwdyw0000gp/T/arduino_build_88941/libraries/RemoteDebug/utility/libsha1/libsha1.c.o
In arduino one way I knowed to do it is changing board options in Tool menu.
Or hard way, rm -rf in build directory and reload the Arduino

Please add this clean in menu "Tools"

Regards

@JoaoLopesF JoaoLopesF changed the title Option to clean project (like have in Eclipse and Plataformio Option to clean project (like have in Eclipse and Platformio) Mar 19, 2019
@facchinm
Copy link
Member

Hi @JoaoLopesF ,
we take care of dependencies in arduino-builder and just rebuild the files that are affected by other files' changes. To do this, all .d files produced by gcc are parsed and decide if the chache can be used based on the timestamp of the last modification.
If you have a working example of this mechanism failing, please let us know 🙂

@facchinm facchinm added the Waiting for feedback More information must be provided before we can proceed label Mar 20, 2019
@JoaoLopesF
Copy link
Author

JoaoLopesF commented Mar 20, 2019

Hi @facchinm,
I knowed that is made to compile more fast.
But all modern IDE, as Eclipse and VSCode as a "clean project option"

This is important to force a new compilation.

Example:

in ino file:

#define MEMORY_SAVER true // low features to save memory

in cpp library file:
`
#ifndef MEMORY_SAVER

// do a lot of things

#endif
`
In C/C++ only way to determine that will be compiled or not,
is with a preprocessor diretives (#if,#ifdef,#define, etc).
I know that the Arduino not recomend use this,
but to advanced libraries it is very important

Regards

@per1234
Copy link
Collaborator

per1234 commented Mar 21, 2019

@JoaoLopesF the .ino file and the .cpp file are separate translation units so a #define in the .ino file will not have any effect on the .cpp file. The exception would be if you were to add an #include directive for the .cpp file in the .ino file after the #define, but I've never seen a case where it made sense to #include a .cpp file.

Please provide a Minimal, Complete, and Verifiable Example that demonstrates the issue you have found, along with a complete set of steps we can use to reproduce the issue.

But all modern IDE, as Eclipse and VSCode as a "clean project option"

The difference between those and the Arduino IDE is that the Arduino IDE's main focus is to be beginner friendly. For this reason, we have to be careful to keep the UI as simple as possible, while still trying to provide a IDE that is capable of doing advanced things. It would be better to fix any issues that would make a clean build necessary instead of adding another UI element as a "band-aid".

The only outstanding issue that has made me resort to forcing a full recompile via the board change workaround you described is that compiler warnings are not displayed for files which are not compiled due to having been cached in the prior compilation. However, there is already a proposed fix for that: arduino/arduino-builder#302.

@per1234 per1234 added the feature request A request to make an enhancement (not a bug fix) label Apr 2, 2019
@per1234
Copy link
Collaborator

per1234 commented Sep 16, 2019

Closing due to lack of response. @JoaoLopesF if you ever feel like providing the requested information, reply here with it and I'll be happy to re-open the issue.

@per1234 per1234 closed this as completed Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A request to make an enhancement (not a bug fix) Waiting for feedback More information must be provided before we can proceed
Projects
None yet
Development

No branches or pull requests

3 participants