Skip to content

Incorrect handling of Legacy format libraries by File > Examples menu #40

Closed
@ubidefeo

Description

@ubidefeo

Describe the bug

The examples of installed "1.0 format" libraries are not correctly handled by the IDE's File > Examples menu.

Background:

The "1.5 library format" is attained by the addition of a library.properties metadata file to the library root folder. The decade of Arduino library development before the introduction of this format produced many "1.0 format" libraries, which are still supported by the Arduino development software for the sake of backwards compatibility.

To Reproduce

  1. Download https://github.com/arduino-libraries/RestClient/archive/refs/heads/master.zip
    NOTE: this is just an arbitrary 1.0 format library. The issue will occur with any such library.
  2. Select Sketch > Include Library > Add .ZIP Library... from the Arduino IDE menus.
  3. Select the downloaded file (RestClient-master.zip).
  4. Click the Open button.
  5. Close the Arduino IDE.
  6. Start the Arduino IDE.
    (there is a separate bug that causes the examples of libraries installed via Add .ZIP Library... to not be shown until restart)
  7. Open the File > Examples menu
    Note that the expected "RestClient-master" entry is missing.
    Note that there is a blank entry in the menu that contains all examples of all installed 1.0 format libraries:

image

Expected behavior

Handling of "1.0 format" libraries to be done the same as in the classic Arduino IDE:

A menu entry is added to the File > Examples menu for each library which provides example sketches, regardless of its format. Since 1.0 format libraries don't provide a name via the name field of the library.properties metadata file, the name is determined by the name of the library's installation folder.

image

Desktop

OS: Windows 10
Version: 2.0.0-beta.2-snapshot.f9730ab
Date: 2021-02-18T13:01:31.751Z
CLI Version: 0.16.0 alpha [c977a238]

Additional context

Incidence in platform bundled libraries

The original demonstration of this issue used the platform bundled libraries of the "Arduino Mbed OS Boards" platform. The bug still affects versions of that platform up to, and including, version 2.5.2:

Clipboard01-2

After 2.5.2, the platform's libraries were converted to "1.5 format" as a workaround for this bug (arduino/ArduinoCore-mbed#340), so the later versions of the platform are not affected. For this reason, I changed the demo to using a manually installed "1.0 format" library, which is a less dramatic demo.

However, it may be that "1.0 format" libraries are still relatively common in bundled libraries of 3rd party platforms, since they are not distributed through Library Manager, which has been the primary reason for converting libraries to the 1.5 format.

Reports

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions