Skip to content

Conversation

@vortigont
Copy link
Contributor

@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.

@ivankravets
Copy link
Member

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement LDF Library Dependency Finder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants