Skip to content

lib list should not report empty folders under <directories.user>/libraries as a is_legacy library #1728

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

Closed
kittaakos opened this issue May 9, 2022 · 1 comment · Fixed by #2083
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

Bug Report

Empty folders under <directories.user>/libraries show up as is_legacy: true libraries. If the folder is empty (or contains non-sketch/library files), maybe it should be ignored.

Current behavior

Steps to reproduce:

% rm -rf ~/Documents/Arduino && rm -rf ~/Library/Arduino15
% ./arduino-cli version --format json                     
{
  "Application": "arduino-cli",
  "VersionString": "0.22.0",
  "Commit": "65f662a7",
  "Status": "",
  "Date": "2022-05-06T11:09:35Z"
}
% ./arduino-cli lib list --format json                    
[]
% mkdir -p ~/Documents/Arduino/libraries/nothing_here     
% ./arduino-cli lib list --format json               
[
  {
    "library": {
      "name": "nothing_here",
      "architectures": [
        "*"
      ],
      "install_dir": "/Users/a.kitta/Documents/Arduino/libraries/nothing_here",
      "source_dir": "/Users/a.kitta/Documents/Arduino/libraries/nothing_here",
      "is_legacy": true,
      "location": 1
    }
  }
]
%

Expected behavior

The empty folder is ignored by the lib list command:

% rm -rf ~/Documents/Arduino && rm -rf ~/Library/Arduino15
% ./arduino-cli version --format json                     
{
  "Application": "arduino-cli",
  "VersionString": "0.22.0",
  "Commit": "65f662a7",
  "Status": "",
  "Date": "2022-05-06T11:09:35Z"
}
% ./arduino-cli lib list --format json                    
[]
% mkdir -p ~/Documents/Arduino/libraries/nothing_here     
% ./arduino-cli lib list --format json               
[]
%

Environment

  • CLI version (output of arduino-cli version): arduino-cli Version: 0.22.0 Commit: 65f662a7 Date: 2022-05-06T11:09:35Z
  • OS and platform: macOS 12.3.1 (21E258)

Additional context

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels May 9, 2022
@umbynos
Copy link
Contributor

umbynos commented Feb 7, 2023

This is the old legacy library structure. The cli should at least check if there is a .h file inside the library directory. We should also update the library specification accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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