Library Dependency Finder includes commented out libraries
See original GitHub issueConfiguration
Operating system: Windows 10 x64
PlatformIO Version : PlatformIO, version 4.3.4 + VS Code 1.46.0
Description of problem
I’ve found what I think is a bug. If I comment out an #include
with library in one-line block comment (e.g. /*#include <EEPROM.h>*/
), the library gets removed from Dependecy graph. This is correct behavior.
However, if I comment the #include
with a multiline block comment like this:
/*
#include <EEPROM.h>
*/
then the library still ends up in dependency graph, gets compiled etc.
Steps to Reproduce
- Create a simple project. I used an Arduino framework for Arduino Uno board. Leave all settings as default.
- Try the following code in main.cpp:
#include <Arduino.h>
/* #include <EEPROM.h> */
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
- Build. The output includes lines
Scanning dependencies...
No dependencies
- Now try another code (only 2 newlines added):
#include <Arduino.h>
/*
#include <EEPROM.h>
*/
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
- Build. This time the library gets included in build:
Scanning dependencies...
Dependency Graph
|-- <EEPROM> 2.0
Expected Results
In both cases the library should not be included in build.
Additional info
I’m using PIO from VS Code and installed all stuff via VS Code.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Library Dependency Finder (LDF) - Platformio Docs
[DEFAULT] Parses ALL C/C++ source files of the project and follows only by nested includes ( #include ... , chain...) from the libraries....
Read more >How to find out where a Maven dependency comes from
Need to know exactly which libraries and dependencies your Java project is using? Maven knows that. Here's how find out.
Read more >Check if Library is used in Android app - Stack Overflow
Comment out all dependencies and check what fails (see below) ... Finding libraries and resources used in an Android app comes up in...
Read more >Find usages of classes from maven dependency
Hi, Is there a way I can find usages of classes from a maven dependency? I could comment out a dependency and launch...
Read more >4.1. Quickstart — Cabal 3.4.0.0 User's Guide
One of the important questions is whether the package contains a library and/or an executable. Libraries are collections of Haskell modules that can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just for reference: docs.platformio.org - ldf-mode
I will try to use the chain+ mode. But in the past I have also looked into this and then the chain+ mode (or the deep(+) mode) had some issues. Sadly I don’t remember what those were.
@TD-er not sure if this help, but I created a quick test and I’ve added
lib_ldf_mode = chain+
to platform.ini.main.cpp:
platform.ini file:
result:
platform.ini:
I hope this helps 🙂