sipeed / Maixduino

Arduino port on Maix board ( k210 )
https://maixduino.sipeed.com
Other
216 stars 96 forks source link

Use optimal bundled library names #116

Closed per1234 closed 3 years ago

per1234 commented 3 years ago

When multiple libraries contain files matching an #include directive in the program, the Arduino build system must pick one to use for compilation. Multiple factors are used in order to make an intelligent determination of which library is best, as documented here.

In order to enhance this determination, the closeness of match between the library.properties name value and the filename in the #include directive is being added as one of those factors. This new factor is referred to as "Library Name Priority". This change has been made in Arduino CLI (though not yet released): https://github.com/arduino/arduino-cli/pull/1300. It will propagate from there to the classic Arduino IDE, Arduino IDE 2.x, and Arduino Web Editor after the next release of Arduino CLI.

Unfortunately, this change can result in platform bundled libraries which had previously been correctly correctly chosen no longer being given priority over their equivalent standalone libraries, which may be incompatible or not optimized for the platform's boards.

This priority inversion only occurs when all the following conditions are true:

The fix is to simply give the platform bundled library a perfect "Library Name Priority", as provided by the change in this PR.

Some platform bundled libraries were given a modified name as a workaround to a bug in the Arduino IDE's Library Manager which caused Library Manager to always show the library as updatable under specific circumstances. That bug was fixed in Arduino IDE 1.8.6, ~3 years ago.

For more information or discussion regarding this change, please see https://github.com/arduino/arduino-cli/issues/1292