Bundled libraries of other platforms are discoverable #1740
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
The Arduino boards platform system supports bundling of libraries. These libraries are typically specific to the platform's architecture, often variants of fundamental libraries which are standardized infrastructure of each plaform (e.g., "SPI", "Wire").
For this reason, these libraries must only be discoverable when compiling for a board of that platform or its core dependents.
🐛 Bundled libraries of all installed platforms are discoverable during compilation for any board.
To reproduce
🐛 The "SAMD_BootloaderUpdater" library of the
arduino:samd
platform was discovered while compiling for a board of thearduino:avr
platform.Expected behavior
Platform bundled libraries are discoverable only when compiling for a board of that platform or of a platform which references its core.
In the contrived demo above, the compilation was expected to fail, but with a different error:
Arduino CLI version
f0245bc
Operating system
Windows
Operating system version
10
Additional context
I bisected the bug to f0245bc (it does not occur at the previous commit 7e9e4ca)
The more significant (but less suitable for a simple demo) manifestations of the bug result from compiling a sketch that is valid for the target platform which uses one of the common platform bundled libraries such as "Wire". In this case the bug may manifest, at best, as a compilation error cryptic to the target user, at worst, as a subtle runtime fault or degradation.
Issue checklist
The text was updated successfully, but these errors were encountered: