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

Can't compile the example - invalid certificate #42

Open raaymax opened 2 years ago

raaymax commented 2 years ago
[ 64%] Built target mbedtls
[ 64%] Generating x509_crt_bundle
gen_crt_bundle.py: Invalid certificate in /home/raay/Workspace/Robotics/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem
Invalid certificate
make[2]: *** [esp-idf/mbedtls/CMakeFiles/__idf_mbedtls.dir/build.make:67: esp-idf/mbedtls/x509_crt_bundle] Error 2
make[1]: *** [CMakeFiles/Makefile2:2485: esp-idf/mbedtls/CMakeFiles/__idf_mbedtls.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
   Compiling toml v0.5.8
   Compiling rustlib v0.1.0 (/home/raay/Workspace/Robotics/rust-esp32-example/components/rustlib)
error: failed to run custom build command for `rustlib v0.1.0 (/home/raay/Workspace/Robotics/rust-esp32-example/components/rustlib)`

Caused by:
  process didn't exit successfully: `/home/raay/Workspace/Robotics/rust-esp32-example/build/esp-idf/rustlib/target/release/build/rustlib-88b5bbc1e09b33a8/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/home/raay/Workspace/Robotics/rust-esp32-example/build/esp-idf/rustlib/target/RustApi.h

  --- stderr
  thread 'main' panicked at 'libclang error; possible causes include:
  - Invalid flag syntax
  - Unrecognized flags
  - Invalid flag arguments
  - File I/O errors
  - Host vs. target architecture mismatch
  If you encounter an error missing from this list, please file an issue or a PR!', /home/raay/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.58.1/src/ir/context.rs:535:15
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make[2]: *** [esp-idf/rustlib/CMakeFiles/rustlib_project.dir/build.make:112: esp-idf/rustlib/stamp/rustlib_project-build] Error 101
make[1]: *** [CMakeFiles/Makefile2:4931: esp-idf/rustlib/CMakeFiles/rustlib_project.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
make failed with exit code 2
MabezDev commented 2 years ago

This is currently an issue with platformio's distribution of esp-idf. You can either enable the native feature of esp-idf-sys to use cmake instead of pio. Alternatively, if you'd like to stick with pio the following commands should work.

source ~/.platformio/penv/bin/activate
pip install "cryptography<4"