Indicate board compatibility in **File > Examples** menu #817
Labels
criticality: medium
Of moderate impact
topic: code
Related to content of the project itself
type: enhancement
Proposed improvement
Describe the current behavior
Some Arduino libraries are compatible only with specific architectures. The library author can indicate this in the library's metadata.
By comparing that metadata against the architecture of the currently selected board, the IDE can determine whether the library is intended to be compatible with the board and communicate that information to the user.
One of the ways Arduino IDE 1.x communicates this information to the user is by putting the examples of incompatible libraries under the File > Examples > INCOMPATIBLE menu:
🙁 Arduino IDE 2.x does not do this. Instead, it presents examples of incompatible libraries directly under the File > Examples menu, with nothing to differentiate them from the compatible library examples.
To reproduce
This library is compatible only with the
sam
architecture.This is a board of the
avr
architecture.🙁 The menu contains a "USBHost" item at the first level:
Describe the request
Put examples of incompatible libraries under the File > Examples > INCOMPATIBLE menu.
Desktop
Date: 2022-02-01T13:36:29.975Z
CLI Version: nightly-20220205 [10107d2]
Additional context
The IDE does have another method of communicating library compatibility to the user, which is a warning shown in the compilation output:
However, that warning is not always shown and not always noticed by users even when it is shown in the midst of some more cryptic errors.
The File > Examples > INCOMPATIBLE mechanism is much more visible to the user and also gives them the advance warning that they are doing something inadvisable rather than having to discover that after something breaks.
The question might be posed: "if the library is incompatible, why show the examples at all?".
It is possible that a library is compatible with a board even though its architecture is not specified in the library metadata. The "allow list" approach used to specify architecture compatibility in library metadata means that it is not always possible for the library author to completely specify compatibility with the ever growing number of possible architectures (e.g.,
mbed
->mbed_nano
).Even when truly incompatible, hiding them might only lead to the user attempting to use the library directly.
It looks like Arduino CLI does provide this information:
https://arduino.github.io/arduino-cli/dev/rpc/commands/#:~:text=source%20root%20directory.-,compatible_with,-Library.CompatibleWithEntry
The text was updated successfully, but these errors were encountered: