Skip to content

Platform installation prompt only made for boards listed in oldest release #979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
per1234 opened this issue May 6, 2022 · 1 comment · Fixed by #1131
Closed
3 tasks done

Platform installation prompt only made for boards listed in oldest release #979

per1234 opened this issue May 6, 2022 · 1 comment · Fixed by #1131
Assignees
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

Comments

@per1234
Copy link
Contributor

per1234 commented May 6, 2022

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:

  • Boards definitions contained in the installed Arduino boards platforms
  • Boards listed in the definition of the newest release of each of the non-installed platforms available from the package indexes

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

  1. If the "Arduino megaAVR Boards" platform is already installed, use the Arduino IDE "Boards Manager to uninstall it.
    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.
  2. Open the "Board Selector" menu.
  3. Click on "Select other board and port...".
  4. Select "Arduino Nano Every" from the "BOARDS" menu in the "Select Board" dialog.
    This board was selected because it is not present in the oldest platform release definition.
  5. Select any port.
    This step is required as a workaround for Platform installation only offered if port is selected #854
  6. Click the OK button.
    🐛 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.
  7. Open the "Board Selector" menu.
  8. Click on "Select other board and port...".
  9. Select "Arduino Uno WiFi Rev2" from the "BOARDS" menu.
    This board is present in the oldest platform release definition.
  10. Click the OK button.
    🙂 The expected platform installation prompt appears:
    image

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:

packages.set(id, toPackage(platform));

The platform releases in groupedById are sorted in the following order:

  1. Installed release, if the platform is installed
  2. Non-installed releases in ascending 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:

  • If platform is installed: installed release
  • If platform is not installed: newest release

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 the arduino:[email protected] release used to populate the "BOARDS" menu

{
  "name": "Arduino Uno WiFi Rev2"
},
{
  "name": "Arduino Nano Every"
}

The packages[*].platforms[*].boards[] value in the arduino:[email protected] release used by BoardsAutoInstaller:

{
  "name": "Arduino Uno WiFi Rev2"
}

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

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels May 6, 2022
@ubidefeo ubidefeo added the criticality: high Of high impact label Jun 14, 2022
@kittaakos
Copy link
Contributor

But it is not clear to me whether there is a specific reason for the current ascending sort order.

dd10436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
5 participants