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

a component should have component meta data #260

Closed
2 tasks done
trombik opened this issue Nov 11, 2021 · 8 comments
Closed
2 tasks done

a component should have component meta data #260

trombik opened this issue Nov 11, 2021 · 8 comments
Assignees
Labels
build system This is about the build system enhancement New feature or request

Comments

@trombik
Copy link
Collaborator

trombik commented Nov 11, 2021

Device type:

  • ESP32
  • ESP8226

Framework version:

does not really matter.

Describe the bug:

Each component should have meta data. the meta data can be used for automation, and, possibly, other things.

an example meta data file for ads111x (components/ads111x/.eil.yml) looks like this:

---
components:
  - name: foo
    group: ADC/DAC
    licenses:
      - name: ISC
    targets:
      - name: esp32
    description: foo driver
  - name: ads111x
    description: |
      Driver for ADS1113/ADS1114/ADS1115 and ADS1013/ADS1014/ADS1015 I2C ADC
    group: ADC/DAC
    groups: []
    code_owners:
      - name: UncleRus
    depneds:
      - name: i2cdev
      - name: log
      - name: esp_idf_lib_helpers
    thread_safe: yes
    targets:
      - name: esp32
      - name: esp8266
    licenses:
      - name: BSD-3-Clause
    copyrights:
      - name: UncleRus
        full_name: Ruslan V. Uss
        email: unclerus@gmail.com
        year: 2016
      - name: dianlight
        full_name: Lucio Tarantino
        year: 2020

for starter, it helps to generate README.md. Components section would look like this:

## Components
<%
    groups = []
    @components.each do |c| 
      c["components"].each do |sub_c|
        groups << sub_c["group"]
      end 
    end 
    groups = groups.uniq.sort
-%>
<% groups.each do |g| %>
### <%= g %> libraries

| Component      | Description                                                             | License | ESP8266 | Thread safety
|----------------|-------------------------------------------------------------------------|---------|---------|---------------
<%
  group_components = []
  @components.each do |component|
    group_components += component["components"].select { |sub_component| sub_component["group"] == g } 
  end 
  group_components.each do |c| 
    name = c["name"]
    license = c["licenses"].map { |l| l["name"] }.join(", ")
    targets = c["targets"].map { |t| t["name"] }
    esp8266_support = targets.include?("esp8266") ? "Yes" : "No"
    thread_safe = c["thread_safe"] == "yes" ? "Yes" : "No"
    description = c["description"].chomp -%> 
| **<%= name %>** | <%= description %> | <%= license %> | <%= esp8266_support %> | <%= thread_safe %>
<% end -%> 
<% end -%> 

the meta data file format is not yet fixed.

other possibilities include:

  • skip compilation of some components if they are not needed
  • ensure the license is valid
  • ensure the copyright holders are properly attributed
  • clarify code owner
  • generate other meta data
@trombik
Copy link
Collaborator Author

trombik commented Nov 11, 2021

@UncleRus if you like the idea, I'll implement it

@UncleRus
Copy link
Owner

I love the idea.
Next step is generating documentation source, not just a README.

@UncleRus UncleRus added build system This is about the build system enhancement New feature or request labels Nov 11, 2021
@nicola-lunghi
Copy link

nicola-lunghi commented Nov 16, 2021

@UncleRus @trombik
Have a look here:

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html

I think espressif is developing their own "component library" manager.
It would be useful to implement their metadata instead

@trombik
Copy link
Collaborator Author

trombik commented Nov 18, 2021

fixed in #261

@trombik trombik closed this as completed Nov 18, 2021
@pedrominatel
Copy link

@UncleRus @trombik Have a look here:

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html

I think espressif is developing their own "component library" manager. It would be useful to implement their metadata instead

Hi, we (Espressif) are interested in having the libraries on the Components Manager. This will be an extremely valuable contribution to the community!

Can we talk about it @UncleRus?

Components Manager: https://components.espressif.com/search/

We can help you on this process.

@trombik
Copy link
Collaborator Author

trombik commented Nov 24, 2021

as the author of the issue and the pr, I would like to emphasize the purposes. the issue was raised to fix problems we have. updating README is tedious and error prone. consistency is not guaranteed. code might have GPL code. I'd like to fix these issues first. on the other hand, few users requested to support third-party repositories, and the possible benefits they claimed have not convinced me. most of users are not beginners. they know how to install the libraries, to use git, or to try a proposed fix branch in their project. however, I'm not against the idea only if it's not another burden for us.

once we have stable metadata, it would be a matter of simple conversion to support your project. however, there are other issues. version management and release management. that's where we could break user projects, which I would like to avoid. I don't think you can help us here.

I've already had a look at your implementation and was happy to see you are implementing bundler-like behaviour. we should not repeat same failures of npm.

@trombik
Copy link
Collaborator Author

trombik commented Nov 24, 2021

here is one thing you can help: clearly stating espressif policy about trademark infringement. I asked i_grr about this on twitter. public statement will certainly help. if you're curious why it matters, ask Google about leftpad and Kik.

@trombik
Copy link
Collaborator Author

trombik commented Feb 9, 2022

at the moment, the component repository is alpha. see espressif/idf-component-manager#4 for details. i will see how it works and benefits us when it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system This is about the build system enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants