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

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

Closed
ubidefeo opened this issue Feb 25, 2021 · 5 comments
Closed
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

@ubidefeo
Copy link

ubidefeo commented Feb 25, 2021

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

@ubidefeo ubidefeo added type: bug priority: medium Resolution is a medium priority labels Feb 25, 2021
@cmaglie cmaglie removed the type: bug label Sep 16, 2021
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@per1234 per1234 added the topic: code Related to content of the project itself label Oct 29, 2021
@rsora rsora added criticality: medium Of moderate impact and removed priority: medium Resolution is a medium priority labels Nov 2, 2021
@mjs513
Copy link

mjs513 commented Feb 4, 2022

In lieu of creating a separate issue I am going to expand on this issue.
OS:
Windows 10x64
Version: 2.0.0-rc3-nightly.20220201
Date: 2022-02-01T03:08:59.105Z
CLI Version: 0.20.2 [13783819]

Incidence in platform bundled libraries (Expanded)
While experimenting with the first version of the Teensyduino Board Manager version for testing the Arduino IDE and Arduino IDE 2, it appears that:
...., 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.
is going to be a continuing problem with some 3rd party platforms.

Problem description: Teensyduino installs its own set of libraries. Some of these libraries are contributed from other sources than PJRC. An example is Bill Porter's EasyTransfer and EasyTransferIC libraries. However, these are in the 1.0 library formated as noted above. To convert the libraries to 1.5 I added a library.property file for both:

name=EasyTransfer
version=1.7
author=Bill Porter
maintainer=Bill Porter
sentence=Transfer data between Arduinos over serial connection.
paragraph=The purpose of this library is to make it easy for the everyday Arduino user working on projects with multiple Arduinos communicating with each other and sharing data over Serial connections.
category=Communication
url=https://github.com/madsci1016/Arduino-EasyTransfer/tree/master/EasyTransfer
architectures=*

This seemed to resolve the issue and showed those libraries in the examples list for the Teensy board selected. However, when I try to open one of the examples in the EasyTransfer library it fails to load the sketch.

Screenshots:
Capture
Capture1

This issue with 1.0 library format is not limited to Teensy. If I select Arduino Uno I am seeing the same thing:
Capture2

@per1234
Copy link
Contributor

per1234 commented Feb 4, 2022

Hi @mjs513.

when I try to open one of the examples in the EasyTransfer library it fails to load the sketch.

That is caused by an unrelated bug: #518

I can see that the "EasyTransfer" library examples use the .pde extension:

https://github.com/PaulStoffregen/Arduino-EasyTransfer/tree/06f6d696f3c8c7d726043af9581a3a959c7a3e2e/EasyTransfer/examples/EasyTransfer_2Way_wPot_Example

This issue (#40) only affects the way the examples menu is organized. Once you select an example from under that blank menu item, it opens just like any other example.

#518 occurs when you try to open any example that uses the deprecated .pde file extension, regardless of whether it is from a "legacy" format library or not.

This issue with 1.0 library format is not limited to Teensy. If I select Arduino Uno I am seeing the same thing

Yes. It is universal.

@mjs513
Copy link

mjs513 commented Feb 4, 2022

Hi @per1234

Thanks for responding so quickly. At least for me still learning about the new IDE and beginning to get use it the more and more I use it. You all did a nice job with it!

So basically we have to convert all pde's to ino's it I am understanding issue #518 correctly.#58

Thanks again Mike

@PaulStoffregen
Copy link

FWIW, I've renamed every old .pde to .ino in all my libraries. Wow, there were a lot of them.

Probably going to wait into a nightly build uses pluggable monitor (issue #769) before I package up another version. When I do, only a small number of files actually meant for Processing with have .pde.

@per1234
Copy link
Contributor

per1234 commented Oct 5, 2022

Fixed by arduino/arduino-cli#1878 (fixed version of Arduino CLI pulled into Arduino IDE by #1418)!

image

@per1234 per1234 closed this as completed Oct 5, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Oct 5, 2022
@per1234 per1234 assigned per1234 and unassigned fstasi Oct 5, 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

No branches or pull requests

7 participants