Skip to content

Libraries compatibility is now shown when calling lib list with fqbn #978

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

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What is the current behavior?
    Calling lib list -b <fqbn> returns the same output as lib list.
  • What is the new behavior?
    Calling lib list -b <fqbn> shows which libraries compatibility with the board specified by the fqbn.

Example output:

$ ./arduino-cli lib list                        
Name                      Installed Available    Location Description                                                    
AllThingsTalk_LoRaWAN_SDK 3.1.6     -            user     LoRaWAN SDK for AllThingsTalk Maker                            
ArduinoJson               6.16.1    -            user     A simple and efficient JSON library f...                       
wm8978-esp32              1.0.0     -            user     An esp32 library for the wm8978 dac.                           

$ ./arduino-cli lib list -b arduino:samd:mkr1000
Name                      Installed Available    Compatible   Location Description                                                    
AllThingsTalk_LoRaWAN_SDK 3.1.6     -            ✓            user     LoRaWAN SDK for AllThingsTalk Maker                            
ArduinoJson               6.16.1    -            ✓            user     A simple and efficient JSON library f...                       
wm8978-esp32              1.0.0     -            ✕            user     An esp32 library for the wm8978 dac.     
  • Does this PR introduce a breaking change?
    Nope.
  • Other information:
    None.

See how to contribute

@ubidefeo
Copy link

@silvanocerza can I see the JSON output?

@silvanocerza
Copy link
Contributor Author

@ubidefeo there you go:

[
  {
    "library": {
      "name": "AllThingsTalk_LoRaWAN_SDK",
      "author": "AllThingsTalk",
      "maintainer": "Vanja \[email protected]\u003e",
      "sentence": "LoRaWAN SDK for AllThingsTalk Maker",
      "paragraph": "Compatible with Microchip RN2483 and RN2903 devices.",
      "website": "https://github.com/allthingstalk/arduino-lorawan-sdk",
      "category": "Communication",
      "architectures": [
        "*"
      ],
      "install_dir": "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK",
      "source_dir": "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/src",
      "real_name": "AllThingsTalk LoRaWAN SDK",
      "version": "3.1.6",
      "license": "Unspecified",
      "location": 1,
      "layout": 1,
      "examples": [
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/Product Development Kit/TrackAndTrace_Lora",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/Rapid Development Kit/count-visits",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/Rapid Development Kit/environmental-sensing",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/Rapid Development Kit/guard-your-stuff",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/Rapid Development Kit/pushbutton",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/SDK Examples/BinaryPayloads",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/SDK Examples/GPSCBOR",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/SDK Examples/HelloLora",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/SDK Examples/IotDataPoint",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/SDK Examples/LoraOptions",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/SDK Examples/OTAARetry",
        "/home/alien/Arduino/libraries/AllThingsTalk_LoRaWAN_SDK/examples/SDK Examples/instrumentation"
      ],
      "provides_includes": [
        "AllThingsTalk_LoRaWAN.h"
      ],
      "compatible": true
    },
    "release": {}
  },
  {
    "library": {
      "name": "wm8978-esp32",
      "author": "Cellie \[email protected]\u003e",
      "maintainer": "Cellie \[email protected]\u003e",
      "sentence": "An esp32 library for the wm8978 dac.",
      "paragraph": "Easy setup for the wm8978 dac with configurable i2c and i2s interfaces. With configurable MCLK on every PWM capable pin.",
      "website": "https://github.com/CelliesProjects/wm8978-esp32/",
      "category": "Signal Input/Output",
      "architectures": [
        "esp32"
      ],
      "install_dir": "/home/alien/Arduino/libraries/wm8978-esp32",
      "source_dir": "/home/alien/Arduino/libraries/wm8978-esp32/src",
      "real_name": "wm8978-esp32",
      "version": "1.0.0",
      "license": "Unspecified",
      "location": 1,
      "layout": 1,
      "examples": [
        "/home/alien/Arduino/libraries/wm8978-esp32/examples/M5Stack_wm8978"
      ],
      "provides_includes": [
        "WM8978.h"
      ]
    },
    "release": {}
  },
  {
    "library": {
      "name": "ArduinoJson",
      "author": "Benoit Blanchon \u003cblog.benoitblanchon.fr\u003e",
      "maintainer": "Benoit Blanchon \u003cblog.benoitblanchon.fr\u003e",
      "sentence": "A simple and efficient JSON library for embedded C++.",
      "paragraph": "ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation.",
      "website": "https://arduinojson.org/?utm_source=meta\u0026utm_medium=library.properties",
      "category": "Data Processing",
      "architectures": [
        "*"
      ],
      "install_dir": "/home/alien/Arduino/libraries/ArduinoJson",
      "source_dir": "/home/alien/Arduino/libraries/ArduinoJson/src",
      "real_name": "ArduinoJson",
      "version": "6.16.1",
      "license": "MIT",
      "location": 1,
      "layout": 1,
      "examples": [
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonConfigFile",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonFilterExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonGeneratorExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonHttpClient",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonParserExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonServer",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonUdpBeacon",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/MsgPackParser",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/ProgmemExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/StringExample"
      ],
      "provides_includes": [
        "ArduinoJson.h",
        "ArduinoJson.hpp"
      ],
      "compatible": true
    },
    "release": {}
  }
]

@ubidefeo
Copy link

@silvanocerza
so for not compatible libraries you don't have a compatible property in the JSON section at all?
I would prefer to see it and make it part of the standard response.
A user might want to scan through all the not compatible libraries and do something about it, such as reporting :)

@silvanocerza
Copy link
Contributor Author

@ubidefeo I've noticed that but I assumed it was an expected behaviour of feedback library since other keys are missing too, I'll take a look at it.

@silvanocerza silvanocerza force-pushed the scerza/lib-list-board-filter branch 2 times, most recently from 7651a14 to c0814e9 Compare September 25, 2020 09:34
@silvanocerza
Copy link
Contributor Author

New output.

$ ./arduino-cli lib list               
Name         Installed Available    Location Description                                                      
ArduinoJson  6.16.1    -            user     A simple and efficient JSON library f...                         
wm8978-esp32 1.0.0     -            user     An esp32 library for the wm8978 dac.                             

$ ./arduino-cli lib list -b arduino:samd:mkr1000              
Name        Installed  Available         Location Description                                                        
ArduinoJson 6.16.1     -                 user     A simple and efficient JSON library f...                           

This is lib list --format json:

  {
    "library": {
      "name": "ArduinoJson",
      "author": "Benoit Blanchon \u003cblog.benoitblanchon.fr\u003e",
      "maintainer": "Benoit Blanchon \u003cblog.benoitblanchon.fr\u003e",
      "sentence": "A simple and efficient JSON library for embedded C++.",
      "paragraph": "ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation.",
      "website": "https://arduinojson.org/?utm_source=meta\u0026utm_medium=library.properties",
      "category": "Data Processing",
      "architectures": [
        "*"
      ],
      "install_dir": "/home/alien/Arduino/libraries/ArduinoJson",
      "source_dir": "/home/alien/Arduino/libraries/ArduinoJson/src",
      "real_name": "ArduinoJson",
      "version": "6.16.1",
      "license": "MIT",
      "location": 1,
      "layout": 1,
      "examples": [
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonConfigFile",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonFilterExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonGeneratorExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonHttpClient",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonParserExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonServer",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonUdpBeacon",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/MsgPackParser",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/ProgmemExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/StringExample"
      ],
      "provides_includes": [
        "ArduinoJson.h",
        "ArduinoJson.hpp"
      ]
    },
    "release": {}
  },
  {
    "library": {
      "name": "wm8978-esp32",
      "author": "Cellie \[email protected]\u003e",
      "maintainer": "Cellie \[email protected]\u003e",
      "sentence": "An esp32 library for the wm8978 dac.",
      "paragraph": "Easy setup for the wm8978 dac with configurable i2c and i2s interfaces. With configurable MCLK on every PWM capable pin.",
      "website": "https://github.com/CelliesProjects/wm8978-esp32/",
      "category": "Signal Input/Output",
      "architectures": [
        "esp32"
      ],
      "install_dir": "/home/alien/Arduino/libraries/wm8978-esp32",
      "source_dir": "/home/alien/Arduino/libraries/wm8978-esp32/src",
      "real_name": "wm8978-esp32",
      "version": "1.0.0",
      "license": "Unspecified",
      "location": 1,
      "layout": 1,
      "examples": [
        "/home/alien/Arduino/libraries/wm8978-esp32/examples/M5Stack_wm8978"
      ],
      "provides_includes": [
        "WM8978.h"
      ]
    },
    "release": {}
  }
]

This instead is lib list -b arduino:samd:mkr1000 --format json:

[
  {
    "library": {
      "name": "ArduinoJson",
      "author": "Benoit Blanchon \u003cblog.benoitblanchon.fr\u003e",
      "maintainer": "Benoit Blanchon \u003cblog.benoitblanchon.fr\u003e",
      "sentence": "A simple and efficient JSON library for embedded C++.",
      "paragraph": "ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation.",
      "website": "https://arduinojson.org/?utm_source=meta\u0026utm_medium=library.properties",
      "category": "Data Processing",
      "architectures": [
        "*"
      ],
      "install_dir": "/home/alien/Arduino/libraries/ArduinoJson",
      "source_dir": "/home/alien/Arduino/libraries/ArduinoJson/src",
      "real_name": "ArduinoJson",
      "version": "6.16.1",
      "license": "MIT",
      "location": 1,
      "layout": 1,
      "examples": [
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonConfigFile",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonFilterExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonGeneratorExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonHttpClient",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonParserExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonServer",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/JsonUdpBeacon",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/MsgPackParser",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/ProgmemExample",
        "/home/alien/Arduino/libraries/ArduinoJson/examples/StringExample"
      ],
      "provides_includes": [
        "ArduinoJson.h",
        "ArduinoJson.hpp"
      ],
      "compatible_with": {
        "arduino:samd:mkr1000": true
      }
    },
    "release": {}
  }
]

Remember that the json doesn't reflect the gRPC interface but the CLI output, incompatible libraries are still included in the gRPC response but are marked as incompatible.

Copy link

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works as expected

@silvanocerza silvanocerza force-pushed the scerza/lib-list-board-filter branch from c0814e9 to 743c3e9 Compare September 29, 2020 13:00
@silvanocerza silvanocerza merged commit c3c7c73 into master Sep 29, 2020
@silvanocerza silvanocerza deleted the scerza/lib-list-board-filter branch September 29, 2020 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please review the exit code of the lib list -b command
2 participants