Skip to content
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

Custom board option selection made in one window affects other windows as well #2240

Closed
3 tasks done
per1234 opened this issue Sep 27, 2023 · 0 comments · Fixed by #2241
Closed
3 tasks done

Custom board option selection made in one window affects other windows as well #2240

per1234 opened this issue Sep 27, 2023 · 0 comments · Fixed by #2241
Labels
conclusion: resolved Issue was resolved 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 Sep 27, 2023

Describe the problem

Arduino boards platform authors can define arbitrary custom board options to provide additional configurability for a given board selection. These options are presented to the Arduino IDE user as arbitrary submenus under the IDE's Tools menu.

🐛 If the user changes the setting in a custom board option menu in one menu, compilations and uploads for the board in other windows will also use that custom board option setting instead of the one the user had selected in that window.

To reproduce

  1. Select File > New Sketch from the Arduino IDE menus.
    I will refer to the IDE window that opens as "window A" from here on.
  2. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  3. Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
  4. Click the "OK" button.
  5. Select Tools > Board > Arduino AVR Boards > Arduino Nano from the Arduino IDE menus.
    This board was selected arbitrarily for the demo. The fault will occur with any board that has a custom board option.
  6. Select Tools > Processor > ATmega328P (Old bootloader) from the Arduino IDE menus.
    This setting was selected arbitrarily for the demo. The fault will occur with any custom board option setting.
  7. Select Sketch > Verify/Compile from the Arduino IDE menus.
  8. Scroll up to the top of the "Output" view.
    🙂 The FQBN shown there is as expected for the custom board option setting:
    FQBN: arduino:avr:nano:cpu=atmega328old
    
  9. Select File > New Sketch from the Arduino IDE menus.
    I will refer to the IDE window that opens as "window B" from here on.
  10. Select Tools > Processor > ATmega168 from the Arduino IDE menus.
  11. Select Sketch > Verify/Compile from the Arduino IDE menus.
  12. Scroll up to the top of the "Output" view.
    🙂 The FQBN shown there is as expected for the custom board option setting:
    FQBN: arduino:avr:nano:cpu=atmega168
    
  13. Switch back to "window A".
  14. Open the Tools > Processor menu (❗ Don't select anything; only open the menu).
    🙂 The ATmega328P (Old bootloader) setting you chose in step (6) is still selected, as expected.
  15. Select Sketch > Verify/Compile from the Arduino IDE menus.
  16. Scroll up to the top of the "Output" view.

🐛 The FQBN shown there does not match the setting of the window's Tools > Processor menu. Instead, it is the FQBN for the setting made in "window B":

FQBN: arduino:avr:nano:cpu=atmega168

Expected behavior

The board selection in each IDE window can be configured independently without any effect on the configuration of other windows.

Arduino IDE version

ed2d8ad

Operating system

Windows

Operating system version

11

Additional context

I checked for the fault in various IDE versions going all the way back to 2.0.0-beta.1 and was able to reproduce it with all of them. So it seems this is not a regression.

I looked for existing issues without finding any, but it is possible there might be some that are reports of the final symptoms of an unexpected configuration being applied to a given board (e.g., an upload failure) instead of the immediate symptom of incorrect content in the compilation output as I was able to identify and report here.

Workaround

Select the desired settings from each custom board option menu before compiling or uploading, even though the IDE's GUI shows the desired setting is already selected from the menu.

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 Sep 27, 2023
kittaakos pushed a commit that referenced this issue Sep 27, 2023
Store the board config data per sketch, and not per IDE installation.

The (Theia) default `LocalStorage` implementation is workspace-scoped
when `@theia/workspace` is part of the final application.

Closes #2240

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Sep 27, 2023
Store the board config data per sketch and not per IDE installation.

The (Theia) default `StorageService` implementation is workspace-scoped
when `@theia/workspace` is part of the final application.

Closes #2240

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Sep 27, 2023
Store the board config data per sketch and not per IDE installation.

The (Theia) default `StorageService` implementation is workspace-scoped
when `@theia/workspace` is part of the final application.

Closes #2240

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant