Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

How to handle persistant inclusions of not wanted libraries. #1295

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

Closed
HiroP0 opened this issue Feb 5, 2021 · 6 comments
Closed

How to handle persistant inclusions of not wanted libraries. #1295

HiroP0 opened this issue Feb 5, 2021 · 6 comments
Labels
domain: documentation Something is wrong with the documentation Hot issue

Comments

@HiroP0
Copy link

HiroP0 commented Feb 5, 2021

Description
espressif ESP32 (Board: Dev Module or M5Stack) provides logging by macros reacting to the "Core Debug Level" board setting.
(https://dl.espressif.com/dl/package_esp32_index.json, v1.0.7)

Once a log level is set FreeRTOS library gets included, but the builds fail due to an unresolved dependency to <avr/io.h>. Setting log level back to none and detaching FreeRTOS library enables successful builds again. Arduino IDE builds successfully. (Issue persits with Sloeber independently from whether Arduino IDE is installed or not).
So ESP32 default logging does not work.

To Reproduce

Source ino:

#include "Arduino.h"
void setup() {
log_e("Baaad.");
}
void loop() {}

  1. Create ESP32 project, "Core Debug Level" None
  2. Use full source ino from above
  3. Build --> successful
  4. Set Project>Preferences>Ardunio: "Core Debug Level": "Error"
  5. Build -->FreeRTOS gets included
  6. See error:

....
\eclipse\arduinoPlugin\libraries\FreeRTOS\10.4.3-8\src" -MMD -MP -MF"libraries\FreeRTOS\src\croutine.c.d" -MT"libraries\FreeRTOS\src\croutine.c.o" -D__IN_ECLIPSE__=1 "E:\dev\eclipse\arduinoPlugin\libraries\FreeRTOS\10.4.3-8\src\croutine.c" -o "libraries\FreeRTOS\src\croutine.c.o"
In file included from E:\dev\eclipse\arduinoPlugin\libraries\FreeRTOS\10.4.3-8\src\Arduino_FreeRTOS.h:57:0,
from E:\dev\eclipse\arduinoPlugin\libraries\FreeRTOS\10.4.3-8\src\croutine.c:27:
E:\dev\eclipse\arduinoPlugin\libraries\FreeRTOS\10.4.3-8\src\FreeRTOSConfig.h:30:20: fatal error: avr/io.h: No such file or directory
compilation terminated.
libraries\FreeRTOS\src\subdir.mk:49: recipe for target 'libraries\FreeRTOS\src\croutine.c.o' failed
make: *** [libraries\FreeRTOS\src\croutine.c.o] Error 1
"E:/dev/eclipse/arduinoPlugin/tools/make/make all" terminated with exit code 2. Build might be incomplete.

18:15:39 Build Failed. 3 errors, 0 warnings. (took 1s.266ms)

Expected behavior
Successful build & logging.

ProjectSettings

@jantje
Copy link
Member

jantje commented Feb 5, 2021

If I understand correctly the freeRtos library is included but you do not need/use it.
In other words I assume Sloeber falsely identifies freeRtos as a library your project needs and the solution is to stop Sloeber doing so.

First of all: you can tell Sloeber to add libraries automatically or not. Disabling the automatically addition of libraries is a guaranteed solution but due to the fact this is a workspace setting .... tedious when creating new projects.

Check in windows->preferences

afbeelding

So sometimes Sloeber add libraries that are not needed. Sloeber searches for libraries (when the option is turned on) based on "unresolved includes" provided by the CDT indexer.
Falsely identified "unresolved includes" can be caused by a confused indexer, a wrongly configured indexer or by something in the code that makes the indexer think there are unresolved includes (I know there is 1 board that always fails the build test due to this issue).
It is possible the confusion is already fixed and then simply deleting the libraries from the libraries folder solves that problem.

afbeelding

If the libraries are automatically reattached you can force the indexer to rebuild.

afbeelding

Then delete the libraries.
If they are still reattached I exclude the library from the build using the resource configuration.

afbeelding
afbeelding
The visualisation of the folder changes showing it is excluded
afbeelding

@HiroP0
Copy link
Author

HiroP0 commented Feb 6, 2021

Workaround (not including libraries automatically) helps and is acceptable.
Thanks and Cheers!

@Brolensky
Copy link

Brolensky commented Feb 13, 2021

Hello,
I have got a problem with ESP32 with basic projet.
Here is my all in one view:
image

The problem is
If i "clean project", "index freshen, rebuild" and put libraries and "build all" or "build project", it will be ok or no.
When it is good it is only few time, after Sloeber.ino.h got the libraries include and the problems appears.
Even i erease the includes it still non working!

I have have configure the enable parrallel built to 8.
If have made the git ESP32 external project import and inclusion like in the vidéo 5 times and now step by step.
(The only difference are the use versions, i reproduce the new project before get procedure and the project doesnt create at this step (invisible), i erase and made a new after get procedure)
I am trying to adding a reference to
"${workspace_loc:/Toto4/core/variant}"
"${workspace_loc:/Toto4/core/core}"
"${C:\Users\cabrol\git\arduino-esp32\libraries}"
the problem is with or without last line

So what is my mystake?
Thank for your Help
Cedric

@Brolensky
Copy link

Brolensky commented Feb 13, 2021

Even i comment the includes, sloeber.ino.cpp ask to put a new version with the includes...
If i exclude sloeber.ino.cpp from built i have got error form setup and loop.
when i re-include, even the #include "SD.h" is comment, the comment is underline with the error for library
Refresh doesnt do anything

Here is the complete console output message (with out any visible reference to SD & WiFi):
log.txt

@Brolensky
Copy link

Brolensky commented Feb 13, 2021

Here is the out console message for a working project Toto5, the same then Toto4 before including anything
the whitespace problem seems to have not importance.

log.txt

@Brolensky
Copy link

Brolensky commented Feb 13, 2021

A) Effect of direct build
Adding an #include "SD.h" in .ino and direct build
kill the project

B) Multi step
1 ) Creating project with 8 parrallel built, OK.
2) Adding an #include "SD.h" in .ino underligne the #include "SD.h"
3) Searching unresolved inclusions says everithing is OK
4) Build project says OK, but SD.h is undertligned SD begin is wrong too & searching unresolved is OK???

C) Reality verification (Living or dead?)

  1. Searching unresolved before a build says OK, but it is underligned and the
    void loop(){
    SD.begin(),
    Serial.println("Hey");
    }
    Print:...
    ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
    Connect to serial port COM11 at 115200
    ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

So it is really not include...

D) Stopping the artificial life:
and if i dont search unresolved, before the last Build, inclusion error appear, and compiling is refused...
and includes are unremovables...

@jantje jantje added the domain: documentation Something is wrong with the documentation label Feb 13, 2021
@jantje jantje changed the title Build dependency issue with ESP32 and debug level How to handle inclusion of not wanted libraries. Feb 20, 2021
@jantje jantje changed the title How to handle inclusion of not wanted libraries. How to handle persistant inclusions of not wanted libraries. Feb 20, 2021
@Sloeber Sloeber locked and limited conversation to collaborators Feb 20, 2024
@jantje jantje converted this issue into discussion #1634 Feb 20, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
domain: documentation Something is wrong with the documentation Hot issue
Projects
None yet
Development

No branches or pull requests

3 participants