ivmarkov / rust-esp32-std-demo

Rust on ESP32 STD demo app. A demo STD binary crate for the ESP32[XX] and ESP-IDF, which connects to WiFi, Ethernet, drives a small HTTP server and draws on a LED screen.
Apache License 2.0
784 stars 105 forks source link

Cannot build the latest demo inside espressif/idf-rust-examples Docker container #87

Closed callmephilip closed 2 years ago

callmephilip commented 2 years ago

Running

docker run -it espressif/idf-rust-examples

Then inside docker

cd rust-esp32-std-demo
git pull origin main
export RUST_ESP32_STD_DEMO_WIFI_SSID=<ssid>
export RUST_ESP32_STD_DEMO_WIFI_PASS=<ssid>
cargo +esp build

Results in

Compiling esp-idf-sys v0.31.5
The following warnings were emitted during compilation:

warning: esp-idf version (5.0.0) not officially supported by `esp-idf-sys`. Supported versions are 'master', 'release/v4.4', 'release/v4.3', 'v4.4(.X)', 'v4.3.2'.

error: failed to run custom build command for `esp-idf-sys v0.31.5`

Caused by:
  process didn't exit successfully: `/opt/rust-esp32-std-demo/target/debug/build/esp-idf-sys-c1bd466bd2ec9680/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=MCU
  cargo:warning=esp-idf version (5.0.0) not officially supported by `esp-idf-sys`. Supported versions are 'master', 'release/v4.4', 'release/v4.3', 'v4.4(.X)', 'v4.3.2'.
  cargo:rerun-if-changed=/opt/rust-esp32-std-demo/sdkconfig.defaults
  cargo:rerun-if-changed=/opt/rust-esp32-std-demo/sdkconfig.defaults.esp32
  cargo:rerun-if-changed=/opt/rust-esp32-std-demo/sdkconfig.defaults.esp32
  cargo:rerun-if-changed=/opt/rust-esp32-std-demo/sdkconfig.defaults.esp32s2
  CMAKE_PREFIX_PATH_xtensa-esp32-espidf = None
  CMAKE_PREFIX_PATH_xtensa_esp32_espidf = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_xtensa-esp32-espidf = None
  CMAKE_xtensa_esp32_espidf = None
  TARGET_CMAKE = None
  CMAKE = None
  running: "cmake" "/opt/rust-esp32-std-demo/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-8d0c4c9d291d3560/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/opt/esp/idf/tools/cmake/toolchain-esp32.cmake" "-DCMAKE_BUILD_TYPE=" "-DCMAKE_INSTALL_PREFIX=/opt/rust-esp32-std-demo/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-8d0c4c9d291d3560/out" "-DCMAKE_C_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections" "-DCMAKE_CXX_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections" "-DCMAKE_ASM_FLAGS=  -ffunction-sections -fdata-sections"
  -- Checking Python dependencies...
  -- Configuring incomplete, errors occurred!
  See also "/opt/rust-esp32-std-demo/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-8d0c4c9d291d3560/out/build/CMakeFiles/CMakeOutput.log".

  --- stderr
  Using activated esp-idf v5.0.0 environment at '/opt/esp/idf'
  ERROR: /opt/rust-esp32-std-demo/.embuild/espressif/python_env/idf5.0_py3.8_env/bin/python doesn't exist! Please run the install script or "idf_tools.py install-python-env" in order to create it
  CMake Error at /opt/esp/idf/tools/cmake/build.cmake:286 (message):
    Some Python dependencies must be installed.  Check above message for
    details.
  Call Stack (most recent call first):
    /opt/esp/idf/tools/cmake/build.cmake:415 (__build_check_python)
    CMakeLists.txt:6 (idf_build_process)

  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /opt/cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
georgik commented 2 years ago

PTAL @SergioGasquez . Would it be possible to reuse one of your latest builds of containers and replace former idf-rust-examples which is slightly outdated? I've noticed another issue, that the build is against 5.0 which is not stable yet and it should be 4.4.

SergioGasquez commented 2 years ago

Yes, just tried with our latest builds, and it's building fine. Here are the steps:

  1. Choose the desired tag, here is a description of every tag
    • I would recommend using esp32, esp32c3, esp32s2 or esp32s3 if you are only planning to use one target, and espidf_v4.4 if you want to build the project for any target.
  2. docker run -it sergiogasquez/esp-rs-env:<tag>
  3. Then inside the docker
    1. git clone https://github.com/ivmarkov/rust-esp32-std-demo
    2. export RUST_ESP32_STD_DEMO_WIFI_SSID=<ssid> && export RUST_ESP32_STD_DEMO_WIFI_PASS=<ssid>
    3. cd rust-esp32-std-demo/
    4. cargo +esp build

If you want to use VsCode devcontainers: 1.git clone https://github.com/SergioGasquez/esp-rs-devcontainer

  1. Choose the proper tag
  2. Reopen in Container
  3. Run the above commands inside the container
SergioGasquez commented 2 years ago

The github action completed suscesfully, just tested it again and I can confirm that is working fine!

callmephilip commented 2 years ago

nice one @SergioGasquez! I can confirm that sergiogasquez/esp-rs-env:esp32 works!

SergioGasquez commented 2 years ago

Can we close this issue? Using tags from espressif/idf-rust also work.