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

LDF: refresh lib dependency after recursive search #4941

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vortigont
Copy link

@vortigont vortigont commented Jun 21, 2024

LDF might mistakenly remove recursive dependency libs from a graph, usually platform bundled ones

Full description of and issue is in #4940

What I have found is that ConfigureProjectLibBuilder::_correct_found_libs method could exclude lib dependencies that it found during lb.search_deps_recursive run.

With some debugging added it looks like this:

D _correct_found_libs: run recursive search for <class 'piolib.ArduinoLibBuilder'>('/home/emil/.platformio/packages/framework-arduinoespressif32@src-7a0fa5660
2e1dbc46e5a5afd550c2d71/libraries/Wire')                                                                                                                      
D _correct_found_libs: run remover                                                                                                                            
D _correct_found_libs: REMOVE <class 'piolib.ArduinoLibBuilder'>('/home/emil/.platformio/packages/framework-arduinoespressif32@src-7a0fa56602e1dbc46e5a5afd550
c2d71/libraries/Ticker')                                                                                                                                      
D _correct_found_libs: REMOVE <class 'piolib.ArduinoLibBuilder'>('/home/emil/.platformio/packages/framework-arduinoespressif32@src-7a0fa56602e1dbc46e5a5afd550
c2d71/libraries/WebServer')                                                                                                                                   
D _correct_found_libs: REMOVE <class 'piolib.ArduinoLibBuilder'>('/home/emil/.platformio/packages/framework-arduinoespressif32@src-7a0fa56602e1dbc46e5a5afd550
c2d71/libraries/Update')

then resulting dependency graph looks like this

|   |-- esp32-flashz @ 1.1.4+sha.cd8dd29
|   |   |-- ESP Async WebServer @ 2.10.8
|   |   |   |-- Async TCP @ 3.1.4
|   |   |   |-- ArduinoJson @ 7.0.4
|   |   |   |-- FS @ 2.0.0
|   |   |   |-- WiFi @ 2.0.0
|   |   |-- WiFi @ 2.0.0

it misses valid bundled libs from platfrom libraries/Update' and libraries/Ticker and build process fails

with this PR applied it looks differently

|   |-- esp32-flashz @ 1.1.4+sha.cd8dd29                                                                                                                      
|   |   |-- ESP Async WebServer @ 2.10.8                                                                                                                      
|   |   |   |-- Async TCP @ 3.1.4                                                                                                                             
|   |   |   |-- ArduinoJson @ 7.0.4                                                                                                                           
|   |   |   |-- FS @ 2.0.0                                                                                                                                    
|   |   |   |-- WiFi @ 2.0.0                                                                                                                                  
|   |   |-- Ticker @ 2.0.0                                                                                                                                    
|   |   |-- WebServer @ 2.0.0                                                                                                                                 
|   |   |   |-- WiFi @ 2.0.0                                                                                                                                  
|   |   |   |-- FS @ 2.0.0                                                                                                                                    
|   |   |-- WiFi @ 2.0.0                                                                                                                                      
|   |   |-- Update @ 2.0.0

and it builds fine.

I'm not sure that this the right way to do, I only narrowed it down to this place. Hope this will help to understand the issue better.

Thanks!

LDF might mistakenly remove recursive dependency libs from a graph
usually platform bundled ones

Closes platformio#4940
@CLAassistant
Copy link

CLAassistant commented Jun 21, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ldf Library Dependency Finder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants