-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Only show programmers for current board #9900
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
Only show programmers for current board #9900
Conversation
Previously, the programmers menu always showed *all* programmers of *all* platforms. This made it hard to find the programmer you need. When selecting a programmer from another platform, it would typically not work, since the tool definitions rely on specific variables to be defined by the board, or files available in the variant directory, which are typically platform-dependent. Also, some programmers might be defined in multiple platforms, but there is currently no way to tell which one is for the current platform an will work, and which is for another platform and will break. This commit changes the programmer menu to only show programmers from the platforms that define the board and the core used. The latter is only used when boar definition refers a core in another platform, in which case the core and variant already have a strong coupling (the variant must offer the right variables for the core to work), so that would also apply to the programmer, so programmers from the referenced core's platform can be expected to work. When a board is selected, the menu of available programmers is refreshed, but the currently selected programmer preference is untouched. This might mean that a programmer is selected that is invalid for the current board and will not actually work. This could be fixed by clearing the current programmer when it becomes invalid, but that would mean that changing to another platform and back would always require reselecting the programmer to use, which seems counter-productive. An alternative fix would be to check the programmer against the board and throw an error, but that would require duplicating some code, which did not seem worthwile (ideally, all this code will be moved to arduino-cli anyway in the future). This fixes arduino#9373.
✅ Build completed. Please test this code using one of the following: ⬇️ https://downloads.arduino.cc/javaide/pull_requests/arduino-PR-9900-BUILD-934-linux32.tar.xz ℹ️ The |
Previously, the programmers menu always showed all programmers of
all platforms. This made it hard to find the programmer you need.
When selecting a programmer from another platform, it would typically
not work, since the tool definitions rely on specific variables to be
defined by the board, or files available in the variant directory, which
are typically platform-dependent. Also, some programmers might be
defined in multiple platforms, but there is currently no way to tell
which one is for the current platform an will work, and which is for
another platform and will break.
This commit changes the programmer menu to only show programmers from
the platforms that define the board and the core used. The latter is
only used when boar definition refers a core in another platform, in
which case the core and variant already have a strong coupling (the
variant must offer the right variables for the core to work), so that
would also apply to the programmer, so programmers from the referenced
core's platform can be expected to work.
When a board is selected, the menu of available programmers is
refreshed, but the currently selected programmer preference is
untouched. This might mean that a programmer is selected that is invalid
for the current board and will not actually work. This could be fixed by
clearing the current programmer when it becomes invalid, but that would
mean that changing to another platform and back would always require
reselecting the programmer to use, which seems counter-productive. An
alternative fix would be to check the programmer against the board and
throw an error, but that would require duplicating some code, which did
not seem worthwile (ideally, all this code will be moved to arduino-cli
anyway in the future).
This fixes #9373.