espressif / rust-esp32-example

Example of Rust integration into an ESP-IDF project, for ESP32 series of chips
MIT License
436 stars 36 forks source link

PlatformIO Core not found. #36

Closed dcharbonnier closed 2 years ago

dcharbonnier commented 2 years ago

Just following the instruction does not work

latest: Pulling from espressif/idf-rust-examples
Digest: sha256:ae300eac447f51c6cffd0994e62635af7f5785d1f3b68d39123ba048f3ef81ef
Status: Image is up to date for espressif/idf-rust-examples:latest
    cd /opt/rust-esp32-std-hello
    cargo build --release
    espflash /dev/ttyUSB0 target/xtensa-esp32-espidf/release/rust-esp32-std-hello
    cargo pio espidf monitor -e release /dev/ttyUSB0
  --- stderr
  Error: Compatible PlatformIO Core not found.
  Reason: PlatformIO executable not found in `/root/.platformio/penv/bin`
  CMake Error at /root/.platformio/packages/framework-espidf/tools/cmake/scripts/data_file_embed_asm.cmake:26 (file):
    file failed to open for reading (No such file or directory):

      /opt/rust-esp32-std-hello/target/xtensa-esp32-espidf/release/build/esp-idf-sys-32173fcf1c714593/out/esp-idf/.pio/build/release/x509_crt_bundle

  *** Error 1
  *** [.pio/build/release/.pio/build/release/x509_crt_bundle.o] Source `.pio/build/release/x509_crt_bundle.S' not found, needed by target `.pio/build/release/.pio/build/release/x509_crt_bundle.o'.
  ========================= [FAILED] Took 69.47 seconds =========================
  Environment    Status    Duration
  -------------  --------  ------------
  release        FAILED    00:01:09.471
  ==================== 1 failed, 0 succeeded in 00:01:09.471 ====================
  Error: No such file or directory (os error 2)
georgik commented 2 years ago

Thank you @dcharbonnier for reporting the issue. This is caused by release of Python Cryptography v35, release on 29th Sept. To correct this issue enter following commands:

source ~/.platformio/penv/bin/activate
pip install "cryptography<4"
cargo +esp build

The issue is being discussed at https://matrix.to/#/#esp-rs:matrix.org FYI @ivmarkov

dcharbonnier commented 2 years ago

there is no ~/.platformio/penv/bin/activate

ivmarkov commented 2 years ago

It is somehow here: /root/.platformio/packages/framework-espidf/ - as the error message points out. Not sure how this /root is mapped out when using docker images.

The above is basically a quick workaround until, I guess - PlatformIO and ESP-IDF release an official patch. The issue is not even related to this example, but a generic one.

ivmarkov commented 2 years ago

Given that this problem is pinned in the meantime, we can probably close this issue as a duplicate.