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

error[E0063]: missing field stack_alloc_caps in initializer of `esp_idf_sys::esp_pthread_cfg_t #253

Closed
dmitryr117 opened this issue Feb 8, 2024 · 6 comments

Comments

@dmitryr117
Copy link

When I try to run cargo build after setting up environment - I get:

   Compiling exp-01 v0.1.0 (/home/dmitryr117/dev/iot/esp32s3/exp-01)
   Compiling embassy-futures v0.1.1
   Compiling embedded-svc v0.27.0
error[E0063]: missing field `stack_alloc_caps` in initializer of `esp_idf_sys::esp_pthread_cfg_t`
   --> /home/dmitryr117/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-hal-0.43.0/src/task.rs:357:13
    |
357 |             Self {
    |             ^^^^ missing `stack_alloc_caps`

For more information about this error, try `rustc --explain E0063`.
error: could not compile `esp-idf-hal` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

My Cargo.toml is as follows:

[package]
name = "exp-01"
version = "0.1.0"
authors = ["Dmitry <[email protected]>"]
edition = "2021"
resolver = "2"
rust-version = "1.71"

[profile.release]
opt-level = "s"

[profile.dev]
debug = true    # Symbols are nice and they don't increase the size on Flash
opt-level = "z"

[features]
default = ["std", "embassy", "esp-idf-svc/native"]

pio = ["esp-idf-svc/pio"]
std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"]
alloc = ["esp-idf-svc/alloc"]
nightly = ["esp-idf-svc/nightly"]
experimental = ["esp-idf-svc/experimental"]
embassy = ["esp-idf-svc/embassy-sync", "esp-idf-svc/critical-section", "esp-idf-svc/embassy-time-driver"]

[dependencies]
log = { version = "0.4", default-features = false }
esp-idf-svc = { version = "0.48", default-features = false }

[build-dependencies]
embuild = "0.31.3"

Don't know what is causing the problem.

@dmitryr117
Copy link
Author

Restarted computer, and reran . ~/export-esp.sh. Then there was an issue with error: linker ldproxy not found. Ran cargo install ldproxy, and then cargo build again. Finally everything worked.

@EthnTuttle
Copy link

I am experiencing the same issue but it is not resolved after reboot

@dmitryr117
Copy link
Author

I'll reopen the issue. But I think it has something to do with environment variables set. Will probably have to do a more detailed investigation why this error occurs.

@dmitryr117 dmitryr117 reopened this Feb 23, 2024
@EthnTuttle
Copy link

EthnTuttle commented Feb 23, 2024 via email

@dmitryr117
Copy link
Author

So to fix this issue have to make sure that there are no conflicting environment variables set. This can commonly happen when a user is setting up an environment for the first time, and follows instructions from different sources.

@aklitzke
Copy link

Running into this issue also. This is with a fresh sample project following https://github.com/esp-rs/esp-idf-template/blob/master/README-cmake.md#prerequisites

using both 'std' and 'hal'.

Steps to reproduce:

  1. start fresh dev env
  2. run get_idf
  3. run idf.py set-target esp32
  4. run idf.py build
(base) ➜  is-cat-fed git:(master) ✗ idf.py build
Executing action: all (aliases: build)
Running ninja in directory /Users/andrewklitzke/esp/is-cat-fed/build
Executing "ninja all"...
[0/15] Performing build step for 'project_rust_is_cat_fed'   Compiling esp-idf-hal v0.43.1
error[E0063]: missing field `stack_alloc_caps` in initializer of `esp_idf_sys::esp_pthread_cfg_t`
   --> /Users/andrewklitzke/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-hal-0.43.1/src/task.rs:357:13
    |
357 |             Self {
    |             ^^^^ missing `stack_alloc_caps`

For more information about this error, try `rustc --explain E0063`.
error: could not compile `esp-idf-hal` (lib) due to 1 previous error
[1/1] cd /Users/andrewklitzke/esp/is-cat-fed/build/bootloader/esp-idf/esptool_py && /Users/andrewklitzke/....py --offset 0x8000 bootloader 0x1000 /Users/andrewklitzke/esp/is-cat-fed/build/bootloader/bootloader.bin
Bootloader binary size 0x6870 bytes. 0x790 bytes (7%) free.
[3/15] Completed 'bootloader'
FAILED: esp-idf/rust-is-cat-fed/stamp/project_rust_is_cat_fed-build esp-idf/rust-is-cat-fed/target/xtensa-esp32-espidf/release/librust_is_cat_fed.a /Users/andrewklitzke/esp/is-cat-fed/build/esp-idf/rust-is-cat-fed/stamp/project_rust_is_cat_fed-build /Users/andrewklitzke/esp/is-cat-fed/build/esp-idf/rust-is-cat-fed/target/xtensa-esp32-espidf/release/librust_is_cat_fed.a
cd /Users/andrewklitzke/esp/is-cat-fed/components/rust-is-cat-fed && /opt/homebrew/Cellar/cmake/3.28.3/bin/cmake -E env "CARGO_CMAKE_BUILD_INCLUDES=/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/is-cat-fed/build/esp-idf/rust-is-cat-fed/target;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/newlib/platform_include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/freertos/config/include;/Users/andrewklitzke/esp/esp-idf/components/freertos/config/include/freertos;/Users/andrewklitzke/esp/esp-idf/components/freertos/config/xtensa/include;/Users/andrewklitzke/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include;/Users/andrewklitzke/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include;/Users/andrewklitzke/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos;/Users/andrewklitzke/esp/esp-idf/components/freertos/esp_additions/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/include;/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/include/soc;/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/include/soc/esp32;/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/dma/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/port/esp32/.;/Users/andrewklitzke/esp/esp-idf/components/esp_hw_support/port/esp32/include;/Users/andrewklitzke/esp/esp-idf/components/heap/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/log/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/soc/include;/Users/andrewklitzke/esp/esp-idf/components/soc/esp32;/Users/andrewklitzke/esp/esp-idf/components/soc/esp32/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/hal/platform_port/include;/Users/andrewklitzke/esp/esp-idf/components/hal/esp32/include;/Users/andrewklitzke/esp/esp-idf/components/hal/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_rom/include;/Users/andrewklitzke/esp/esp-idf/components/esp_rom/include/esp32;/Users/andrewklitzke/esp/esp-idf/components/esp_rom/esp32;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_common/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_system/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_system/port/soc;/Users/andrewklitzke/esp/esp-idf/components/esp_system/port/include/private;/Users/andrewklitzke/esp/esp-idf/components/xtensa/esp32/include;/Users/andrewklitzke/esp/esp-idf/components/xtensa/include;/Users/andrewklitzke/esp/esp-idf/components/xtensa/deprecated_include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/lwip/include;/Users/andrewklitzke/esp/esp-idf/components/lwip/include/apps;/Users/andrewklitzke/esp/esp-idf/components/lwip/include/apps/sntp;/Users/andrewklitzke/esp/esp-idf/components/lwip/lwip/src/include;/Users/andrewklitzke/esp/esp-idf/components/lwip/port/include;/Users/andrewklitzke/esp/esp-idf/components/lwip/port/freertos/include;/Users/andrewklitzke/esp/esp-idf/components/lwip/port/esp32xx/include;/Users/andrewklitzke/esp/esp-idf/components/lwip/port/esp32xx/include/arch;/Users/andrewklitzke/esp/esp-idf/components/lwip/port/esp32xx/include/sys;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/pthread/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/driver/deprecated;/Users/andrewklitzke/esp/esp-idf/components/driver/i2c/include;/Users/andrewklitzke/esp/esp-idf/components/driver/touch_sensor/include;/Users/andrewklitzke/esp/esp-idf/components/driver/twai/include;/Users/andrewklitzke/esp/esp-idf/components/driver/touch_sensor/esp32/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_pm/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_ringbuf/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_gpio/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_pcnt/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_gptimer/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_spi/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_mcpwm/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_ana_cmpr/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_i2s/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_sdmmc/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/sdmmc/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_sdspi/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_sdio/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_dac/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_rmt/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_tsens/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_sdm/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_i2c/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_uart/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/vfs/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_ledc/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_parlio/include;/Users/andrewklitzke/esp/is-cat-fed/build/config;/Users/andrewklitzke/esp/esp-idf/components/esp_driver_usb_serial_jtag/include;/Users/andrewklitzke/esp/is-cat-fed/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;__idf_vfs;library_rust_is_cat_fed" CARGO_CMAKE_BUILD_SDKCONFIG=/Users/andrewklitzke/esp/is-cat-fed/sdkconfig CARGO_CMAKE_BUILD_ESP_IDF=/Users/andrewklitzke/esp/esp-idf CARGO_CMAKE_BUILD_COMPILER=/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc "RUSTFLAGS=--cfg espidf_time64" MCU=esp32 cargo build --target xtensa-esp32-espidf --target-dir /Users/andrewklitzke/esp/is-cat-fed/build/esp-idf/rust-is-cat-fed/target --release -Zbuild-std=std,panic_abort
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /Users/andrewklitzke/esp/is-cat-fed/build/log/idf_py_stderr_output_22813 and /Users/andrewklitzke/esp/is-cat-fed/build/log/idf_py_stdout_output_22813

env:

(base) ➜  is-cat-fed git:(master) ✗ env
TERM_SESSION_ID=w0t0p0:FF5D44B0-127D-4257-96F5-3D2BD60CFDD3
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.tLAyJ1gsvf/Listeners
LC_TERMINAL_VERSION=3.4.16
COLORFGBG=7;0
ITERM_PROFILE=Default
XPC_FLAGS=0x0
LANG=en_US.UTF-8
PWD=/Users/andrewklitzke/esp/is-cat-fed
SHELL=/bin/zsh
__CFBundleIdentifier=com.googlecode.iterm2
SECURITYSESSIONID=186b0
TERM_PROGRAM_VERSION=3.4.16
TERM_PROGRAM=iTerm.app
PATH=/Users/andrewklitzke/esp/esp-idf/components/espcoredump:/Users/andrewklitzke/esp/esp-idf/components/partition_table:/Users/andrewklitzke/esp/esp-idf/components/app_update:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/andrewklitzke/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/Users/andrewklitzke/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/andrewklitzke/.espressif/python_env/idf5.3_py3.9_env/bin:/Users/andrewklitzke/esp/esp-idf/tools:/Users/andrewklitzke/.gvm/bin:/Users/andrewklitzke/Downloads/google-cloud-sdk/bin:/opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/andrewklitzke/.cargo/bin
LC_TERMINAL=iTerm2
COLORTERM=truecolor
COMMAND_MODE=unix2003
TERM=xterm-256color
HOME=/Users/andrewklitzke
TMPDIR=/var/folders/s2/kx0cfh5n54v25c8xprdtmng00000gn/T/
USER=andrewklitzke
XPC_SERVICE_NAME=0
LOGNAME=andrewklitzke
LaunchInstanceID=57992774-0C5D-499F-96F8-05251691719C
__CF_USER_TEXT_ENCODING=0x0:0:0
ITERM_SESSION_ID=w0t0p0:FF5D44B0-127D-4257-96F5-3D2BD60CFDD3
SHLVL=1
OLDPWD=/Users/andrewklitzke/esp
HOMEBREW_PREFIX=/opt/homebrew
HOMEBREW_CELLAR=/opt/homebrew/Cellar
HOMEBREW_REPOSITORY=/opt/homebrew
MANPATH=/opt/homebrew/share/man::
INFOPATH=/opt/homebrew/share/info:
ZSH=/Users/andrewklitzke/.oh-my-zsh
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS=di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43
CONDA_EXE=/opt/homebrew/Caskroom/miniconda/base/bin/conda
_CE_M=
_CE_CONDA=
CONDA_PYTHON_EXE=/opt/homebrew/Caskroom/miniconda/base/bin/python
CONDA_SHLVL=1
CONDA_PREFIX=/opt/homebrew/Caskroom/miniconda/base
CONDA_DEFAULT_ENV=base
CONDA_PROMPT_MODIFIER=(base)
GVM_ROOT=/Users/andrewklitzke/.gvm
GVM_VERSION=1.0.22
GVM_PATH_BACKUP=/Users/andrewklitzke/.gvm/bin:/Users/andrewklitzke/Downloads/google-cloud-sdk/bin:/opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/andrewklitzke/.cargo/bin
IDF_PATH=/Users/andrewklitzke/esp/esp-idf
OPENOCD_SCRIPTS=/Users/andrewklitzke/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/share/openocd/scripts
ESP_ROM_ELF_DIR=/Users/andrewklitzke/.espressif/tools/esp-rom-elfs/20240305/
IDF_PYTHON_ENV_PATH=/Users/andrewklitzke/.espressif/python_env/idf5.3_py3.9_env
ESP_IDF_VERSION=5.3
IDF_DEACTIVATE_FILE_PATH=/var/folders/s2/kx0cfh5n54v25c8xprdtmng00000gn/T/tmpqyznp1pvidf_16887
IDF_TOOLS_EXPORT_CMD=/Users/andrewklitzke/esp/esp-idf/export.sh
IDF_TOOLS_INSTALL_CMD=/Users/andrewklitzke/esp/esp-idf/install.sh
_=/usr/bin/env

using an m1 mac, cargo and rustc 1.75.0

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

No branches or pull requests

3 participants