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

Using custom components introduces a requirement of specifying all components #296

Open
torkleyy opened this issue Apr 4, 2024 · 7 comments

Comments

@torkleyy
Copy link
Contributor

torkleyy commented Apr 4, 2024

As documented here, extra components require inclusion into esp_idf_components, but if esp_idf_compoents is present it acts as a filter for all built components. Interestingly, this doesn't apply to remotely managed components.

Ideally, extra components specified in Cargo.toml should be included automatically.

@Vollbrecht
Copy link
Collaborator

Can you give concrete example, on how you structured your Cargo.toml and what component you were using one? A custom self-written component or one that you sourced yourself from the idf-component library?

Overall its a two step process, we need a) building the component in the first place and make it link into the esp-idf library. b) generating "bindings" to be included so they are available in rust through esp-idf-sys.

When you say extra components should be included automatically - what part do you want to be included automatically? For us the be able to build the component, we need a known format - that works with esp-idf and that we can than run through cmake.

@torkleyy
Copy link
Contributor Author

Can you give concrete example, on how you structured your Cargo.toml and what component you were using one? A custom self-written component or one that you sourced yourself from the idf-component library?

A custom self-written one:

[[package.metadata.esp-idf-sys.extra_components]]
bindings_header = "extra/include/bindings.h"
component_dirs = ["extra"]

If I do just that, the "extra" component won't be built - I have to do this:

esp_idf_components = ["extra"]

Now it will build the "extra" component, but none of the other components 🙃
So I ended up having to do this:

esp_idf_components = [
    "xtensa", "esp_ringbuf", "efuse", "esp_mm", "driver", "esp_pm", "mbedtls", "esp_bootloader_format", "esp_app_format", "bootloader_support", "bootloader", "esptool_py", "partition_table", "esp_partition", "app_update", "spi_flash", "pthread", "esp_system", "esp_rom", "hal", "log", "heap", "soc", "esp_hw_support", "freertos", "newlib", "cxx", "esp_common", "esp_timer", "app_trace", "esp_event", "nvs_flash", "esp_phy", "vfs", "lwip", "esp_netif_stack", "esp_netif", "wpa_supplicant", "esp_coex", "esp_wifi", "bt", "unity", "cmock", "console", "http_parser", "esp-tls", "esp_adc", "esp_eth", "esp_gdbstub", "esp_hid", "tcp_transport", "esp_http_client", "esp_http_server", "esp_https_ota", "esp_https_server", "esp_psram", "esp_lcd", "protobuf-c", "protocomm", "esp_local_ctrl", "espcoredump", "wear_levelling", "sdmmc", "idf_test", "ieee802154", "json", "mqtt", "nvs_sec_provider", "openthread", "perfmon", "spiffs", "ulp", "usb", "wifi_provisioning", "espressif__mdns", "main", "extra"
]

@Vollbrecht
Copy link
Collaborator

And did you correctly include a CMakeLists file and configured it correctly inside your custom component?

@torkleyy
Copy link
Contributor Author

Yes.

@ivmarkov
Copy link
Collaborator

ivmarkov commented May 1, 2024

@torkleyy using esp_idf_components has nothing to do with "extra" components. These are ALL esp-idf components, and unless you have a very specific use case, you should not touch it at all.

I would rather concentrate / dig into the direction of what is wrong with the actual, original "extra" components syntax that you tried to use and it did not work for you. There is something wrong there in how you specify it for sure. I know it works actually.

@ivmarkov
Copy link
Collaborator

ivmarkov commented May 1, 2024

In other words, inclusion of your extra components in the esp_idf_components list will happen automatically, you don't need to touch it / override it at all.

@torkleyy
Copy link
Contributor Author

torkleyy commented May 1, 2024

Okay, I can try and create a reproducible example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants