Description
I'm encountering several library compatibility issues lately. I believe these are due in part to the library manager and that if you update a library via the lib manager (the Servo library for example) that is also included by 3rd party boards (via the board manager or 3rd party installers such as the Teensy installer) the library installed by the lib manager will take priority.
A couple of specific examples:
Arduino Zero required a newer Servo library than was included in the latest Arduino release. This could be resolved by using the library manager to install Servo v1.1.0. However this version of Servo was incompatible with non SAMD architectures (although this appears to have been resolved in Servo v1.1.1). However 3rd party boards such as Teensy include their own version of the Servo library. Updating Servo via lib manager however will now include that version rather than the version of the lib included with the 3rd party board. Same problem with Intel Galileo and Servo library.
I've noticed the same incompatibility issues across boards with the Ethernet and SPI libraries as well (I believe it's related to this issue: #3961).
So there are actually 2 issues here:
- lib manager overrides core libraries included with 3rd party and board manager installed boards
- core libraries are not compatible across all official arduino boards (when they should be) - due to issues in core library support for new boards (is anyone testing this before release?)
Some possible solutions:
- Give priority to core libraries included with 3rd party boards (installed by means other than the boards manager) and by boards installed and updated via the boards manager. Include those libraries instead of core libraries updated via the library manager. Maybe there would be a clever way to override on a case-by case basis (for example I wouldn't want the Teensy version of Firmata included when the latest Firmata version supports all Teensy boards).
- Consider including core libraries in all architecture variants. For example include Servo in samd instead of trying to maintain a all in one version for all avr, sam and samd, especially when new boards are available before they are fully compatible with the core software.
- Consider a way for the library manager to be architecture aware. This would enable updating a library for only certain architectures.