Fix loading platforms with malformed boards.txt #1326
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)Makes the CLI more resilient by avoiding loading boards not respecting the specification.
Boards that specify a custom option like this:
are always loaded, even if the option
menu.cpu
is not defined anywhere else inboards.txt
file.This may cause issues and crashes for other commands that expect this
menu.cpu
property to exist like the specification states.From https://arduino.github.io/arduino-cli/dev/platform-specification/#custom-board-options
This is an example of the problems the missing option definition may cause:
The
SparkFun:samd:samd51_thing_plus
board in this case defines the following options:But
menu.cache
is not defined anywhere in theboards.txt
.Boards that define a custom option like stated above won't be loaded anymore if the related
menu.MENU_ID=Text
is not defined anywhere in theboards.txt
.A warning will be displayed to the user reminding them that the boards are not loaded. The platform will still be loaded correctly.
titled accordingly?
Nope.
As of now this mainly affects the
SparkFun:samd
platform, there is an open PR that fixes this issue: sparkfun/Arduino_Boards#73.Am not sure if there are other platforms that will be affected.
See how to contribute