Arduino IDE 2.0.3 Duplicate TAB page

As I mentioned in my previous reply, clearing the "user data" folder also causes Arduino IDE to try the "first run" installations. So this explains why it is attempting to install the arduino:avr ("Arduino AVR Boards") platform and "Arduino_BuiltIn" library. But it does not explain why the installation of "Arduino_BuiltIn" failed with this "not found" error.

I also have experienced this fault. My finding was that it always happens when I have the ridiculous collection of >40 boards platforms in place I use to "stress test" Arduino IDE, but never happens when I have a more reasonable number of platforms installed. My hypothesis was that this is a "concurrency bug" caused by two operations happening simultaneously:

  • Update indexes
  • Install libraries

Arduino IDE (actually Arduino CLI) rescans the installed libraries during the index update process, so if the timing is just right, it loses its internal data about the libraries that are installed just as it is attempting to install this library. The number of platforms influences the timing because it takes longer to scan through them all.

I didn't report this specific bug because it only occurred for me under conditions a regular user would not have and that would be very difficult for the developers to reproduce (because they would have to spend hours installing 20 GB of platforms from dozens of obscure package indexes). I did see a user report of the problem since that time (Failed_precondition?), but it still seemed quite rare and my hope was that the fix for a more straightforward bug would also fix the elusive one. The straightforward bug is this:

That was fixed two weeks ago. I just tried replacing the stock version of Arduino CLI used by Arduino IDE with the one that has the fix and sure enough I am no longer able to reproduce the fault! So let's hope it is now fixed.

This time the result was expected.

During the beta/pre-release phase of Arduino IDE 2.x, we received complaints that when the user already had a specific version of one of the "built-in" libraries installed on their system from during their time using Arduino IDE 1.x, Arduino IDE 2.x's first run installation of the library would cause an unwanted update of the library, which might break projects that were intended to be used with the previous version of the library:

The fix implemented by the developers was to configure the first run "built-in" library installation to be canceled if it would result in an update of a previously installed library:

That solved the update problem, but not another problem caused by the "built-in" library installation, which was that their installation in the sketchbook resulted in them having a higher priority than the Arduino IDE 1.x "built-in" libraries. The solution was to use a special dedicated folder for the installation of these libraries just the same as Arduino IDE 1.x had, and with the same priority as given to the Arduino IDE 1.x "built-in" libraries:

After that was implemented, the "no overwrite" fix implemented in arduino/arduino-ide#1169 was no longer needed, since there was no longer any concern about the installation updating the user's pre-existing libraries. But there also wasn't any reason to revert arduino/arduino-ide#1169 since the installation is only ever expected to run once, in which case there would not be any chance of an overwrite. That doesn't consider that users might clear the "user data" folder and trigger an additional "first run" installation process. However, even then it is not necessarily wrong for Arduino IDE to decline to update the existing "built-in" libraries and in fact the safest behavior is probably to leave any updates up to the user instead of doing them automatically.