Platform installation prompt only made for boards listed in oldest release #979
Labels
conclusion: resolved
Issue was resolved
criticality: high
Of high impact
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
The "Select Board" dialog provides a searchable list of all available boards for selection by the user.
This list is populated from two distinct sources:
The selected board can not be used if its platform is not installed so the IDE must prompt the user to install the necessary platform if a board from the latter source is selected. This is done via a notification which communicates the requirement to the user and offers to install the platform.
🐛 The platform installation prompt is not shown if a selected non-installed board is not listed in the oldest platform release definition.
To reproduce
ⓘ This platform was chosen arbitrarily for the sake of the demo. The bug will occur with any platform with a board listed in the newest platform release definition which is not present in the oldest.
ⓘ This board was selected because it is not present in the oldest platform release definition.
ⓘ This step is required as a workaround for Platform installation only offered if port is selected #854
🐛 The platform installation prompt does not appear. If the user attempts to compile, they will get a cryptic "Missing FQBN" error message. If they try to upload, nothing at all will happen.
ⓘ This board is present in the oldest platform release definition.
🙂 The expected platform installation prompt appears:
Expected behavior
Platform installation prompt always appears after selecting a non-installed board from the "Select Board" dialog.
Arduino IDE version
2.0.0-rc6-snapshot-289f9d7
Operating system
Windows
Operating system version
10
Additional context
The origin of the mismatch between the data used to populate the "BOARDS" menu in the "Select Board" dialog and the data used to determine which platform should be installed for that board is here:
arduino-ide/arduino-ide-extension/src/node/boards-service-impl.ts
Line 383 in 289f9d7
The platform releases in
groupedById
are sorted in the following order:This means that the "package" data set by
toPackage
is based on the oldest release when the platform is not installed.The obvious fix would be to sort the non-installed platform releases in descending order, which would result in the "package" data being based on:
But it is not clear to me whether there is a specific reason for the current ascending sort order.
The
packages[*].platforms[*].boards[]
contents in thearduino:[email protected]
release used to populate the "BOARDS" menuThe
packages[*].platforms[*].boards[]
value in thearduino:[email protected]
release used byBoardsAutoInstaller
:I don't expect to find this quantity of code that is not directly related to the GUI in the Arduino IDE code base. I recommend evaluating whether it can be provided by Arduino CLI instead.
Issue checklist
The text was updated successfully, but these errors were encountered: