esp-rs / esp-idf-template

A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework.
373 stars 44 forks source link

Build fails for cmake template with esp-idf v5.0 #118

Closed mrsch closed 1 year ago

mrsch commented 1 year ago

The cmake template with esp-idf version 5.0 fails to build local and in the CI with the following issue:

% idf.py build
Executing action: all (aliases: build)
Running cmake in directory /home/mario/tmp/rust-component/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/mario/.espressif/python_env/idf5.1_py3.11_env/bin/python -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/mario/tmp/rust-component"...
-- IDF_TARGET is not set, guessed 'esp32' from sdkconfig '/home/mario/tmp/rust-component/sdkconfig'
-- Found Git: /usr/bin/git (found version "2.40.1")
-- Component directory /home/mario/tmp/esp-idf/components/asio does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/cbor does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/coap does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/expat does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/libsodium does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/nghttp does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/tinyusb does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/mario/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/mario/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/mario/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file /home/mario/tmp/rust-component/sdkconfig
Loading defaults file /home/mario/tmp/rust-component/sdkconfig.defaults...
Compiler supported targets: xtensa-esp32-elf

-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Found Python3: /home/mario/.espressif/python_env/idf5.1_py3.11_env/bin/python (found version "3.11.3") found components: Interpreter
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "rust-component" version: 1
-- Adding linker script /home/mario/tmp/rust-component/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_system/ld/esp32/sections.ld.in
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash openthread partition_table perfmon protobuf-c protocomm pthread rust-rust-component sdmmc soc spi_flash spiffs tcp_transport ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /home/mario/tmp/esp-idf/components/app_trace /home/mario/tmp/esp-idf/components/app_update /home/mario/tmp/esp-idf/components/bootloader /home/mario/tmp/esp-idf/components/bootloader_support /home/mario/tmp/esp-idf/components/bt /home/mario/tmp/esp-idf/components/cmock /home/mario/tmp/esp-idf/components/console /home/mario/tmp/esp-idf/components/cxx /home/mario/tmp/esp-idf/components/driver /home/mario/tmp/esp-idf/components/efuse /home/mario/tmp/esp-idf/components/esp-tls /home/mario/tmp/esp-idf/components/esp_adc /home/mario/tmp/esp-idf/components/esp_app_format /home/mario/tmp/esp-idf/components/esp_coex /home/mario/tmp/esp-idf/components/esp_common /home/mario/tmp/esp-idf/components/esp_eth /home/mario/tmp/esp-idf/components/esp_event /home/mario/tmp/esp-idf/components/esp_gdbstub /home/mario/tmp/esp-idf/components/esp_hid /home/mario/tmp/esp-idf/components/esp_http_client /home/mario/tmp/esp-idf/components/esp_http_server /home/mario/tmp/esp-idf/components/esp_https_ota /home/mario/tmp/esp-idf/components/esp_https_server /home/mario/tmp/esp-idf/components/esp_hw_support /home/mario/tmp/esp-idf/components/esp_lcd /home/mario/tmp/esp-idf/components/esp_local_ctrl /home/mario/tmp/esp-idf/components/esp_mm /home/mario/tmp/esp-idf/components/esp_netif /home/mario/tmp/esp-idf/components/esp_netif_stack /home/mario/tmp/esp-idf/components/esp_partition /home/mario/tmp/esp-idf/components/esp_phy /home/mario/tmp/esp-idf/components/esp_pm /home/mario/tmp/esp-idf/components/esp_psram /home/mario/tmp/esp-idf/components/esp_ringbuf /home/mario/tmp/esp-idf/components/esp_rom /home/mario/tmp/esp-idf/components/esp_system /home/mario/tmp/esp-idf/components/esp_timer /home/mario/tmp/esp-idf/components/esp_wifi /home/mario/tmp/esp-idf/components/espcoredump /home/mario/tmp/esp-idf/components/esptool_py /home/mario/tmp/esp-idf/components/fatfs /home/mario/tmp/esp-idf/components/freertos /home/mario/tmp/esp-idf/components/hal /home/mario/tmp/esp-idf/components/heap /home/mario/tmp/esp-idf/components/http_parser /home/mario/tmp/esp-idf/components/idf_test /home/mario/tmp/esp-idf/components/ieee802154 /home/mario/tmp/esp-idf/components/json /home/mario/tmp/esp-idf/components/log /home/mario/tmp/esp-idf/components/lwip /home/mario/tmp/rust-component/main /home/mario/tmp/esp-idf/components/mbedtls /home/mario/tmp/esp-idf/components/mqtt /home/mario/tmp/esp-idf/components/newlib /home/mario/tmp/esp-idf/components/nvs_flash /home/mario/tmp/esp-idf/components/openthread /home/mario/tmp/esp-idf/components/partition_table /home/mario/tmp/esp-idf/components/perfmon /home/mario/tmp/esp-idf/components/protobuf-c /home/mario/tmp/esp-idf/components/protocomm /home/mario/tmp/esp-idf/components/pthread /home/mario/tmp/rust-component/components/rust-rust-component /home/mario/tmp/esp-idf/components/sdmmc /home/mario/tmp/esp-idf/components/soc /home/mario/tmp/esp-idf/components/spi_flash /home/mario/tmp/esp-idf/components/spiffs /home/mario/tmp/esp-idf/components/tcp_transport /home/mario/tmp/esp-idf/components/ulp /home/mario/tmp/esp-idf/components/unity /home/mario/tmp/esp-idf/components/usb /home/mario/tmp/esp-idf/components/vfs /home/mario/tmp/esp-idf/components/wear_levelling /home/mario/tmp/esp-idf/components/wifi_provisioning /home/mario/tmp/esp-idf/components/wpa_supplicant /home/mario/tmp/esp-idf/components/xtensa
-- Configuring done (3.3s)
-- Generating done (0.2s)
-- Build files have been written to: /home/mario/tmp/rust-component/build
Running ninja in directory /home/mario/tmp/rust-component/build
Executing "ninja all"...
[18/893] Generating ../../partition_table/partition-table.binPartition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
*******************************************************************************
[582/893] Performing configure step for 'bootloader'-- Found Git: /usr/bin/git (found version "2.40.1")
-- Component directory /home/mario/tmp/esp-idf/components/asio does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/cbor does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/coap does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/expat does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/libsodium does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/nghttp does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/mario/tmp/esp-idf/components/tinyusb does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/mario/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/mario/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/mario/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file /home/mario/tmp/rust-component/sdkconfig
Compiler supported targets: xtensa-esp32-elf

-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Adding linker script /home/mario/tmp/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- App "bootloader" version: v5.1-dev-4734-g8a08cfe7d1
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.ld
-- Adding linker script /home/mario/tmp/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp_app_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
-- Component paths: /home/mario/tmp/esp-idf/components/bootloader /home/mario/tmp/esp-idf/components/bootloader_support /home/mario/tmp/esp-idf/components/efuse /home/mario/tmp/esp-idf/components/esp_app_format /home/mario/tmp/esp-idf/components/esp_common /home/mario/tmp/esp-idf/components/esp_hw_support /home/mario/tmp/esp-idf/components/esp_rom /home/mario/tmp/esp-idf/components/esp_system /home/mario/tmp/esp-idf/components/esptool_py /home/mario/tmp/esp-idf/components/freertos /home/mario/tmp/esp-idf/components/hal /home/mario/tmp/esp-idf/components/log /home/mario/tmp/esp-idf/components/bootloader/subproject/main /home/mario/tmp/esp-idf/components/bootloader/subproject/components/micro-ecc /home/mario/tmp/esp-idf/components/newlib /home/mario/tmp/esp-idf/components/partition_table /home/mario/tmp/esp-idf/components/soc /home/mario/tmp/esp-idf/components/spi_flash /home/mario/tmp/esp-idf/components/xtensa
-- Configuring done (5.9s)
-- Generating done (0.1s)
-- Build files have been written to: /home/mario/tmp/rust-component/build/bootloader
[622/893] Performing build step for 'project_rust_rust_component'   Compiling proc-macro2 v1.0.56
   Compiling quote v1.0.27
   Compiling unicode-ident v1.0.8
   Compiling libc v0.2.144
   Compiling compiler_builtins v0.1.87
   Compiling memchr v2.5.0
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling core v0.0.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core)
   Compiling serde_derive v1.0.162
   Compiling serde v1.0.162
   Compiling log v0.4.17
   Compiling regex-syntax v0.7.1
   Compiling glob v0.3.1
   Compiling bitflags v1.3.2
   Compiling syn v1.0.109
   Compiling once_cell v1.17.1
   Compiling io-lifetimes v1.0.10
   Compiling rustversion v1.0.12
   Compiling libc v0.2.139
   Compiling lazy_static v1.4.0
   Compiling minimal-lexical v0.2.1
   Compiling rustix v0.37.19
   Compiling same-file v1.0.6
   Compiling os_str_bytes v6.5.0
   Compiling fnv v1.0.7
   Compiling termcolor v1.2.0
   Compiling serde_json v1.0.96
   Compiling cc v1.0.77
   Compiling indexmap v1.9.3
   Compiling thiserror v1.0.40
   Compiling hashbrown v0.12.3
   Compiling clap_lex v0.2.4
   Compiling walkdir v2.3.3
   Compiling clang-sys v1.6.1
   Compiling thread_local v1.1.7
   Compiling libloading v0.7.4
   Compiling aho-corasick v1.0.1
   Compiling aho-corasick v0.7.20
   Compiling bstr v1.4.0
   Compiling nom v7.1.3
   Compiling humantime v2.1.0
   Compiling itoa v1.0.6
   Compiling linux-raw-sys v0.3.7
   Compiling textwrap v0.16.0
   Compiling syn v2.0.15
   Compiling anyhow v1.0.71
   Compiling strsim v0.10.0
   Compiling ryu v1.0.13
   Compiling either v1.8.1
   Compiling bindgen v0.60.1
   Compiling heck v0.4.1
   Compiling shlex v1.1.0
   Compiling semver v1.0.17
   Compiling peeking_take_while v0.1.2
   Compiling camino v1.1.4
   Compiling lazycell v1.3.0
   Compiling atty v0.2.14
   Compiling clap v3.2.25
   Compiling unwind v0.0.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/unwind)
   Compiling dirs-sys v0.3.7
   Compiling which v4.4.0
   Compiling cc v1.0.79
   Compiling rustc-hash v1.1.0
   Compiling fastrand v1.9.0
   Compiling dirs v4.0.0
   Compiling regex v1.8.1
   Compiling remove_dir_all v0.7.0
   Compiling filetime v0.2.21
   Compiling num-traits v0.2.15
   Compiling std v0.0.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std)
   Compiling num-integer v0.1.45
   Compiling cmake v0.1.50
   Compiling iana-time-zone v0.1.56
   Compiling unicode-xid v0.2.4
   Compiling const_format_proc_macros v0.2.29
   Compiling globset v0.4.10
   Compiling cexpr v0.6.0
   Compiling env_logger v0.9.3
   Compiling thiserror-impl v1.0.40
   Compiling ignore v0.4.20
   Compiling chrono v0.4.24
   Compiling tempfile v3.5.0
   Compiling strum_macros v0.24.3
   Compiling globwalk v0.8.1
   Compiling build-time v0.1.3
   Compiling strum v0.24.1
   Compiling cargo-platform v0.1.2
   Compiling envy v0.4.2
   Compiling rustc-std-workspace-core v1.99.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling embuild v0.30.5
   Compiling cargo_metadata v0.15.4
   Compiling alloc v0.0.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/alloc)
   Compiling rustc-demangle v0.1.21
   Compiling esp-idf-sys v0.31.12
   Compiling rust-rust-component v0.1.0 (/home/mario/tmp/rust-component/components/rust-rust-component)
   Compiling rustc-std-workspace-alloc v1.99.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling panic_abort v0.0.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_abort)
   Compiling panic_unwind v0.0.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_unwind)
   Compiling std_detect v0.1.5 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling proc_macro v0.0.0 (/home/mario/.rustup/toolchains/esp/lib/rustlib/src/rust/library/proc_macro)
   Compiling const_format v0.2.30
error[E0423]: expected function, found struct `stat`
     --> /home/mario/.cargo/registry/src/github.com-1ecc6299db9ec823/esp-idf-sys-0.31.12/src/patches/lstat.rs:12:5
      |
12    |       stat(path, buf)
      |       ^^^^^^^^^^^^^^^
      |
     ::: /home/mario/tmp/rust-component/build/esp-idf/rust-rust-component/target/xtensa-esp32-espidf/release/build/esp-idf-sys-701baeefcea06fb7/out/bindings.rs:15038:1
      |
15038 | / pub struct stat {
15039 | |     _unused: [u8; 0],
15040 | | }
      | |_- `stat` defined here
      |
help: use struct literal syntax instead
      |
12    |     stat { _unused: val }
      |
help: consider importing this function instead
      |
1     | use libc::stat;
      |

For more information about this error, try `rustc --explain E0423`.
error: could not compile `esp-idf-sys` due to previous error
[102/103] Generating binary image from built executableesptool.py v4.5.1
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.
Generated /home/mario/tmp/rust-component/build/bootloader/bootloader.bin
[103/103] cd /home/mario/tmp/rust-component/build/bootloader/esp-idf/e... 0x1000 /home/mario/tmp/rust-component/build/bootloader/bootloader.binBootloader binary size 0x6820 bytes. 0x7e0 bytes (7%) free.
[881/893] Linking C static library esp-idf/wifi_provisioning/libwifi_provisioning.aFAILED: esp-idf/rust-rust-component/stamp/project_rust_rust_component-build esp-idf/rust-rust-component/target/xtensa-esp32-espidf/release/librust_rust_component.a /home/mario/tmp/rust-component/build/esp-idf/rust-rust-component/stamp/project_rust_rust_component-build /home/mario/tmp/rust-component/build/esp-idf/rust-rust-component/target/xtensa-esp32-espidf/release/librust_rust_component.a
cd /home/mario/tmp/rust-component/components/rust-rust-component && /usr/bin/cmake -E env "CARGO_CMAKE_BUILD_INCLUDES=/home/mario/tmp/rust-component/build/config;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/rust-component/build/esp-idf/rust-rust-component/target;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/newlib/platform_include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/freertos/FreeRTOS-Kernel/include;/home/mario/tmp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include;/home/mario/tmp/esp-idf/components/freertos/esp_additions/include/freertos;/home/mario/tmp/esp-idf/components/freertos/esp_additions/include;/home/mario/tmp/esp-idf/components/freertos/esp_additions/arch/xtensa/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/esp_hw_support/include;/home/mario/tmp/esp-idf/components/esp_hw_support/include/soc;/home/mario/tmp/esp-idf/components/esp_hw_support/include/soc/esp32;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/esp_hw_support/port/esp32/.;/home/mario/tmp/esp-idf/components/esp_hw_support/port/esp32/private_include;/home/mario/tmp/esp-idf/components/heap/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/log/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/soc/include;/home/mario/tmp/esp-idf/components/soc/esp32;/home/mario/tmp/esp-idf/components/soc/esp32/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/hal/esp32/include;/home/mario/tmp/esp-idf/components/hal/include;/home/mario/tmp/esp-idf/components/hal/platform_port/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/esp_rom/include;/home/mario/tmp/esp-idf/components/esp_rom/include/esp32;/home/mario/tmp/esp-idf/components/esp_rom/esp32;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/esp_common/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/esp_system/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/esp_system/port/soc;/home/mario/tmp/esp-idf/components/esp_system/port/include/private;/home/mario/tmp/esp-idf/components/xtensa/include;/home/mario/tmp/esp-idf/components/xtensa/esp32/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/lwip/include;/home/mario/tmp/esp-idf/components/lwip/include/apps;/home/mario/tmp/esp-idf/components/lwip/include/apps/sntp;/home/mario/tmp/esp-idf/components/lwip/lwip/src/include;/home/mario/tmp/esp-idf/components/lwip/port/include;/home/mario/tmp/esp-idf/components/lwip/port/freertos/include;/home/mario/tmp/esp-idf/components/lwip/port/esp32xx/include;/home/mario/tmp/esp-idf/components/lwip/port/esp32xx/include/arch;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/pthread/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/driver/include;/home/mario/tmp/esp-idf/components/driver/deprecated;/home/mario/tmp/esp-idf/components/driver/analog_comparator/include;/home/mario/tmp/esp-idf/components/driver/dac/include;/home/mario/tmp/esp-idf/components/driver/gpio/include;/home/mario/tmp/esp-idf/components/driver/gptimer/include;/home/mario/tmp/esp-idf/components/driver/i2c/include;/home/mario/tmp/esp-idf/components/driver/i2s/include;/home/mario/tmp/esp-idf/components/driver/ledc/include;/home/mario/tmp/esp-idf/components/driver/mcpwm/include;/home/mario/tmp/esp-idf/components/driver/parlio/include;/home/mario/tmp/esp-idf/components/driver/pcnt/include;/home/mario/tmp/esp-idf/components/driver/rmt/include;/home/mario/tmp/esp-idf/components/driver/sdio_slave/include;/home/mario/tmp/esp-idf/components/driver/sdmmc/include;/home/mario/tmp/esp-idf/components/driver/sigma_delta/include;/home/mario/tmp/esp-idf/components/driver/spi/include;/home/mario/tmp/esp-idf/components/driver/temperature_sensor/include;/home/mario/tmp/esp-idf/components/driver/touch_sensor/include;/home/mario/tmp/esp-idf/components/driver/twai/include;/home/mario/tmp/esp-idf/components/driver/uart/include;/home/mario/tmp/esp-idf/components/driver/usb_serial_jtag/include;/home/mario/tmp/esp-idf/components/driver/touch_sensor/esp32/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/esp_pm/include;/home/mario/tmp/rust-component/build/config;/home/mario/tmp/esp-idf/components/esp_ringbuf/include;/home/mario/tmp/rust-component/build/config" "CARGO_CMAKE_BUILD_LINK_LIBRARIES=__idf_cxx;__idf_newlib;__idf_freertos;__idf_esp_hw_support;__idf_heap;__idf_log;__idf_soc;__idf_hal;__idf_esp_rom;__idf_esp_common;__idf_esp_system;__idf_xtensa;__idf_cxx;__idf_newlib;__idf_freertos;__idf_esp_hw_support;__idf_heap;__idf_log;__idf_soc;__idf_hal;__idf_esp_rom;__idf_esp_common;__idf_esp_system;__idf_xtensa;__idf_pthread;__idf_driver;library_rust_rust_component" CARGO_CMAKE_BUILD_SDKCONFIG=/home/mario/tmp/rust-component/sdkconfig CARGO_CMAKE_BUILD_ESP_IDF=/home/mario/tmp/esp-idf CARGO_CMAKE_BUILD_COMPILER=/home/mario/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc "RUSTFLAGS=--cfg espidf_time64" cargo build --target xtensa-esp32-espidf --target-dir /home/mario/tmp/rust-component/build/esp-idf/rust-rust-component/target --release -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /home/mario/tmp/rust-component/build/log/idf_py_stderr_output_125756 and /home/mario/tmp/rust-component/build/log/idf_py_stdout_output_125756
mrsch commented 1 year ago

I was able to fix this by adding the following to src/include/esp-idf/bindings.h in esp-idf-sys:

#include "sys/stat.h"

Not sure if this is the right way to fix this.

ivmarkov commented 1 year ago

When you say "esp idf 5.0" which 5.0 version do you mean precisely? The release/v5.0 branch, or some tag? If a tag, which one?

SergioGasquez commented 1 year ago

When you say "esp idf 5.0" which 5.0 version do you mean precisely? The release/v5.0 branch, or some tag? If a tag, which one?

I suppose it's release/v5.0 as he mentioned seeing the same issue in the CI

ivmarkov commented 1 year ago

Now - after fixing everything else - I'm seeing it too. Weird. Must be caused by CMake using only a handful of the ESP IDF components by default.

ivmarkov commented 1 year ago

@mrsch I think I just fixed it. Please issue cargo update in the root of your rust crate to pull the latest esp-idf-sys version.

Reopen if it still does not work for you.

mrsch commented 1 year ago

Everything is working now, thanks a lot.