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

IDE UI does not reflect changed "Sketchbook location" preference #796

Closed
3 tasks done
per1234 opened this issue Feb 2, 2022 · 0 comments · Fixed by #1774
Closed
3 tasks done

IDE UI does not reflect changed "Sketchbook location" preference #796

per1234 opened this issue Feb 2, 2022 · 0 comments · Fixed by #1774
Assignees
Labels
conclusion: resolved Issue was resolved criticality: medium Of moderate 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 Feb 2, 2022

Describe the problem

User sketches and global library installations are stored in the libraries subfolder of the Arduino sketchbook folder. Several UI elements of the Arduino IDE reflect the contents of this folder and the build system also does library discovery from it.

The user may change the location of this sketchbook folder using the Sketchbook location preference of the Arduino IDE.

🐛 After the user changes the sketchbook location preference, the IDE's UI elements do not reflect the change to sketchbook sketches and available libraries.

To reproduce

  1. Select File > New from the Arduino IDE menus.
  2. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
    This is done to avoid variation in results that could be caused by platform bundled libraries of an arbitrary board selection.
  3. Open the "Sketchbook" view.
  4. Take note of the sketches listed there.
  5. Select File > Sketchbook from the Arduino IDE menus.
  6. Take note of the sketches listed there.
  7. Select File > Examples from the Arduino IDE menus.
  8. Take note of the libraries listed there.
    ⚠️ There is a separate issue Complete list of examples are not always shown #262 which intermittently causes this menu to be incomplete. If you don't see the libraries you have installed listed in the menu (e.g., "Ethernet", "Firmata", "Keyboard"), then try selecting File > New to give the IDE another chance to populate the menu correctly.
  9. Select Sketch > Include Library from the Arduino IDE menus.
  10. Take note of the libraries listed there.
  11. Select File > Preferences... from the Arduino IDE menus.
  12. Change the Sketchbook location preference to some other folder on your computer which already exists, and which contains different sketches and libraries (none at all is fine) from the current sketchbook folder.
    The bug occurs regardless of whether you set the new sketchbook path directly via the Sketchbook location field or using the dialog accessed by clicking the Browse button.
  13. Click the OK button.
  14. Open the "Sketchbook" view.
    🐛 The view shows the contents of the previous sketchbook location.
  15. Select File > Sketchbook from the Arduino IDE menus.
    🐛 The menu shows the sketches located in the previous sketchbook location.
    🐛 The menu does not show the sketches located in the current sketchbook location.
  16. Select File > Examples from the Arduino IDE menus.
    🐛 The menu shows the examples of the libraries from the previous sketchbook location.
    🐛 The menu does not show the examples of the libraries from the current sketchbook location.
  17. Select Sketch > Include Library from the Arduino IDE menus.
    🐛 The menu shows the libraries from the previous sketchbook location.
    🐛 The menu does not show the libraries from the current sketchbook location.
  18. Select one of the unexpected libraries from the menu.
    #include directive(s) for the library are added to the sketch.
  19. Select Sketch > Verify/Compile from the Arduino IDE menus.
    🐛 The compilation fails with a "No such file or directory" error, since the library is not in one of the libraries paths.
  20. Search for the library in Library Manager.
    🐛 Library Manager shows the library as installed.
    UPDATE: This specific part was resolved by #637, #906: Update package index on 3rd party URLs change. #1132. However, that resolution is unexpected since the index update (which triggers the reinitialization of Arduino CLI that updates the library installation status) should only be triggered on "Additional Boards Manager URLs" preference change. So the fact that the index update is currently (fc9107c at the time this is being written) being triggered on "Sketchbook location" preference change is a bug.
  21. Install a library via Library Manager.
    🐛 The library is installed to the libraries subfolder of the old sketchbook location.
    UPDATE: This specific part has been resolved since the time of the report (though perhaps as a side effect of a bug, as described in the note regarding the Library Manager installation status).
  22. Install a library via Sketch > Include Library > Add .ZIP Library...
    🐛 The library is installed to the libraries subfolder of the old sketchbook location.
    UPDATE: This specific part has been resolved since the time of the report (though perhaps as a side effect of a bug, as described in the note regarding the Library Manager installation status).

Expected behavior

All IDE data on sketchbook contents (sketches, libraries, manually installed boards platforms) is updated after changing the sketchbook location preference.

Arduino IDE version

Original report

2.0.0-rc3-snapshot.759b410

Last verified with

2.0.0-snapshot-42f6f43

Operating system

Windows

Operating system version

10

Additional context

In addition to the use case of the Sketchbook location preference for occasional long term change of the sketchbook location according to user whims, some advanced users dedicate a separate sketchbook to each project in order to provide it with a dedicated dependencies environment, which may include manually installed boards platforms in addition to libraries. These users frequently switch from one sketchbook to another and so are especially dependent on the IDE immediately recognizing that change.


The issue also applies to boards platforms manually installed to the hardware subfolder of the sketchbook.

UPDATE: This specific part has been resolved since the time of the report (though perhaps as a side effect of a bug, as described in the note regarding the Library Manager installation status).


Possibly related to arduino/arduino-cli#1802

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@per1234 per1234 added criticality: medium Of moderate impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Feb 2, 2022
@per1234 per1234 assigned AlbyIanna and fstasi and unassigned fstasi Feb 2, 2022
@kittaakos kittaakos assigned kittaakos and unassigned AlbyIanna Dec 15, 2022
@kittaakos kittaakos added status: in progress Work is in progress on this and removed status: in progress Work is in progress on this labels Dec 15, 2022
kittaakos pushed a commit that referenced this issue Dec 21, 2022
Closes #1764
Closes #796
Closes #569
Closes #655

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Dec 21, 2022
Closes #1764
Closes #796
Closes #569
Closes #655

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Dec 21, 2022
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: medium Of moderate impact 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.

4 participants