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
framework=espidf, arduino
isn't setting flags early enough for the Libraray Dependency Finder
#1080
Comments
As a workaround I've created a |
Hi @j4m3s thanks for reporting, I believe I've found the reason why it doesn't work. Could you please revert back your workaround with [env:esp32dev]
platform = https://github.com/platformio/platform-espressif32.git
framework = arduino, espidf
board = esp32dev
lib_ldf_mode = chain+ |
Hi @valeros! Thanks for looking at this. Sadly though, no it hasn't fixed it. It did pull down the new version of the platform/ framework too:
|
@j4m3s Mind sharing a minimal project to reproduce the issue? |
The project this is hitting is far from minimal but I'll create a small one, NP :) |
Interestingly I've yet to reproduce the issue in the simple project, but I don't understand why. Running
When
but yet library Based on my understanding of how the LDF works I would have expected it to compile successfully when |
@j4m3s I've pushed a possible fix, could you please pull the latest revision |
Nice work @valeros, you've cracked it! Works great now in both the minimal example and the big project, thank you! I have to admit that's a big relief - I had no idea where to look next to understand why the minimal project worked but the big complex one didn't :) |
In trying to write a concise title for the issue I have made an assumption based on my investigation.
TLDR:
The Library Dependency Finder creates a different dependency tree (for code in a subdir in the
lib
folder) when it's run withframework = espidf, arduino
vsframework = arduino
, where an include is conditional upon the ARDUINO build flag (usinglib_ldf_mode = chain+
and even whenlib_compat_mode = off
).So:
Given a folder structure of:
And the
libAHeader.h
file containing a conditional include as follows:The dependency tree for A includes
FastLED
, so including thelibAHeader.h
insrc/main.cpp
succeeds, when compiling withframework = arduino
.The dependency tree for A does not include
FastLED
when compiling withframework = espidf, arduino
so the compile failsI suspect this is because the
ARDUINO
flag is not set before the dependency finder runs forframework = espidf, arduino
, but it is set beforehand forframework = arduino
? It's certainly set by the time the actual compilation happens. I expect the same applies toESP32
andARDUINO_ARCH_ESP32
?The text was updated successfully, but these errors were encountered: