Closed ds2k5 closed 11 months ago
This is a debian specific problem. You can't rawly install python packages via pip if its not in a venv or through apt, they enforced this now in debian 12. The esp-idf installtation try's to install virtualenv if its not found, but this failed because its only allowed inside a virtualenv. But because the virtualenv is not created you got this error.
Solution: apt install python3-virtualenv
Hi @Vollbrecht, thanks for the hint
did the following:
$ sudo apt-get install python3-virtualenv $ cargo clean $ rm -rf .embuild $ cargo build
Successfully created esp32 image.
Generated /home/developer/rust/test23/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-d0b03021d1cb46d6/out/build/libespidf.bin
[884/884] cd /home/developer/rust/test23/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-d0b03021d1cb46d6/out/build/esp-idf/esptool_py && /home/developer/rust/test23/.embuild/espressif/python_env/idf5.1_py3.11_env/bin/python /home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/developer/rust/test23/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-d0b03021d1cb46d6/out/build/partition_table/partition-table.bin /home/developer/rust/test23/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-d0b03021d1cb46d6/out/build/libespidf.bin
libespidf.bin binary size 0x273d0 bytes. Smallest app partition is 0x100000 bytes. 0xd8c30 bytes (85%) free.
cargo:root=/home/developer/rust/test23/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-d0b03021d1cb46d6/out
cargo:rerun-if-changed=/home/developer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-sys-0.33.2/src/include/esp-idf/bindings.h
cargo:rustc-env=EMBUILD_GENERATED_BINDINGS_FILE=/home/developer/rust/test23/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-d0b03021d1cb46d6/out/bindings.rs
--- stderr
Build configuration: BuildConfig {
esp_idf_tools_install_dir: None,
esp_idf_sdkconfig: None,
esp_idf_sdkconfig_defaults: None,
mcu: None,
native: NativeConfig {
esp_idf_version: Some(
Tag(
"v5.1.1",
),
),
esp_idf_repository: None,
esp_idf_cmake_generator: None,
idf_path: None,
extra_components: [],
esp_idf_components: None,
},
esp_idf_sys_root_crate: None,
}
Using managed esp-idf repository: RemoteSdk { repo_url: None, git_ref: Tag("v5.1.1") }
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1'...
Note: switching to 'e088c3766ba440e72268b458a68f27b6e7d63986'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
Submodule 'components/bootloader/subproject/components/micro-ecc/micro-ecc' (https://github.com/kmackay/micro-ecc.git) registered for path 'components/bootloader/subproject/components/micro-ecc/micro-ecc'
Submodule 'components/bt/controller/lib_esp32' (https://github.com/espressif/esp32-bt-lib.git) registered for path 'components/bt/controller/lib_esp32'
Submodule 'components/bt/controller/lib_esp32c2/esp32c2-bt-lib' (https://github.com/espressif/esp32c2-bt-lib.git) registered for path 'components/bt/controller/lib_esp32c2/esp32c2-bt-lib'
Submodule 'components/bt/controller/lib_esp32c3_family' (https://github.com/espressif/esp32c3-bt-lib.git) registered for path 'components/bt/controller/lib_esp32c3_family'
Submodule 'components/bt/controller/lib_esp32c6/esp32c6-bt-lib' (https://github.com/espressif/esp32c6-bt-lib.git) registered for path 'components/bt/controller/lib_esp32c6/esp32c6-bt-lib'
Submodule 'components/bt/controller/lib_esp32h2/esp32h2-bt-lib' (https://github.com/espressif/esp32h2-bt-lib.git) registered for path 'components/bt/controller/lib_esp32h2/esp32h2-bt-lib'
Submodule 'components/bt/host/nimble/nimble' (https://github.com/espressif/esp-nimble.git) registered for path 'components/bt/host/nimble/nimble'
Submodule 'components/cmock/CMock' (https://github.com/ThrowTheSwitch/CMock.git) registered for path 'components/cmock/CMock'
Submodule 'components/esp_coex/lib' (https://github.com/espressif/esp-coex-lib.git) registered for path 'components/esp_coex/lib'
Submodule 'components/esp_phy/lib' (https://github.com/espressif/esp-phy-lib.git) registered for path 'components/esp_phy/lib'
Submodule 'components/esp_wifi/lib' (https://github.com/espressif/esp32-wifi-lib.git) registered for path 'components/esp_wifi/lib'
Submodule 'components/heap/tlsf' (https://github.com/espressif/tlsf.git) registered for path 'components/heap/tlsf'
Submodule 'components/ieee802154/lib' (https://github.com/espressif/esp-ieee802154-lib.git) registered for path 'components/ieee802154/lib'
Submodule 'components/json/cJSON' (https://github.com/DaveGamble/cJSON.git) registered for path 'components/json/cJSON'
Submodule 'components/lwip/lwip' (https://github.com/espressif/esp-lwip.git) registered for path 'components/lwip/lwip'
Submodule 'components/mbedtls/mbedtls' (https://github.com/espressif/mbedtls.git) registered for path 'components/mbedtls/mbedtls'
Submodule 'components/mqtt/esp-mqtt' (https://github.com/espressif/esp-mqtt.git) registered for path 'components/mqtt/esp-mqtt'
Submodule 'components/openthread/lib' (https://github.com/espressif/esp-thread-lib.git) registered for path 'components/openthread/lib'
Submodule 'components/openthread/openthread' (https://github.com/espressif/openthread.git) registered for path 'components/openthread/openthread'
Submodule 'components/protobuf-c/protobuf-c' (https://github.com/protobuf-c/protobuf-c.git) registered for path 'components/protobuf-c/protobuf-c'
Submodule 'components/spiffs/spiffs' (https://github.com/pellepl/spiffs.git) registered for path 'components/spiffs/spiffs'
Submodule 'components/unity/unity' (https://github.com/ThrowTheSwitch/Unity.git) registered for path 'components/unity/unity'
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/bootloader/subproject/components/micro-ecc/micro-ecc'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/bt/controller/lib_esp32'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/bt/controller/lib_esp32c2/esp32c2-bt-lib'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/bt/controller/lib_esp32c3_family'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/bt/controller/lib_esp32c6/esp32c6-bt-lib'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/bt/controller/lib_esp32h2/esp32h2-bt-lib'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/bt/host/nimble/nimble'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/cmock/CMock'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/esp_coex/lib'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/esp_phy/lib'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/esp_wifi/lib'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/heap/tlsf'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/ieee802154/lib'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/json/cJSON'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/lwip/lwip'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/mbedtls/mbedtls'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/mqtt/esp-mqtt'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/openthread/lib'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/openthread/openthread'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/protobuf-c/protobuf-c'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/spiffs/spiffs'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/unity/unity'...
From https://github.com/kmackay/micro-ecc
* branch d037ec89546fad14b5c4d5456c2e23a71e554966 -> FETCH_HEAD
From https://github.com/espressif/esp32-bt-lib
* branch e1b3a29c58a452a6c017113686262094afd87042 -> FETCH_HEAD
From https://github.com/espressif/esp32c2-bt-lib
* branch 5fcfd0e457a76ebb234086ccd6dc391690d69e90 -> FETCH_HEAD
From https://github.com/espressif/esp32c3-bt-lib
* branch b438f60a295183e7c67eb42ae05f4580f4b1ced0 -> FETCH_HEAD
From https://github.com/espressif/esp32c6-bt-lib
* branch d785de0a7c46d9badcd73bc83c2e5cb78f7054b2 -> FETCH_HEAD
From https://github.com/espressif/esp32h2-bt-lib
* branch 35bd3cd7352014d303a96c46d8ea8446ea0a9a54 -> FETCH_HEAD
From https://github.com/espressif/esp-nimble
* branch 9478bc510fa9fc792d98efbc80dc547b97a13b99 -> FETCH_HEAD
From https://github.com/ThrowTheSwitch/CMock
* branch eeecc49ce8af123cf8ad40efdb9673e37b56230f -> FETCH_HEAD
Submodule 'vendor/c_exception' (https://github.com/throwtheswitch/cexception.git) registered for path 'components/cmock/CMock/vendor/c_exception'
Submodule 'vendor/unity' (https://github.com/throwtheswitch/unity.git) registered for path 'components/cmock/CMock/vendor/unity'
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/cmock/CMock/vendor/c_exception'...
Cloning into '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1/components/cmock/CMock/vendor/unity'...
From https://github.com/throwtheswitch/cexception
* branch 71b47be7c950f1bf5f7e5303779fa99a16224bb6 -> FETCH_HEAD
From https://github.com/throwtheswitch/unity
* branch cf949f45ca6d172a177b00da21310607b97bc7a7 -> FETCH_HEAD
From https://github.com/espressif/esp-coex-lib
* branch 37698e17a4c7fd2e0872317fc8befaac3bb10cb4 -> FETCH_HEAD
From https://github.com/espressif/esp-phy-lib
* branch 998e05636344949ba219e8ac56feb733e27bf5d2 -> FETCH_HEAD
From https://github.com/espressif/esp32-wifi-lib
* branch 0a89d5ffd2c452407940c2e617434e54f3c34576 -> FETCH_HEAD
From https://github.com/DaveGamble/cJSON
* branch d348621ca93571343a56862df7de4ff3bc9b5667 -> FETCH_HEAD
From https://github.com/espressif/esp-lwip
* branch 269a58f18597aedec31c439e34cdaea47229dda3 -> FETCH_HEAD
From https://github.com/espressif/mbedtls
* branch 65b3c0857c9f207dcb0b646f2b4ebd8e5edf83c1 -> FETCH_HEAD
From https://github.com/espressif/esp-mqtt
* branch dffabb067fb3c39f486033d2e47eb4b1416f0c82 -> FETCH_HEAD
From https://github.com/espressif/esp-thread-lib
* branch c9c17a0b6634af016111c9817f0be1fe0e7112f6 -> FETCH_HEAD
From https://github.com/espressif/openthread
* branch 5beae143700db54c6e9bd4b15a568abe2f305723 -> FETCH_HEAD
From https://github.com/pellepl/spiffs
* branch 0dbb3f71c5f6fae3747a9d935372773762baf852 -> FETCH_HEAD
From https://github.com/ThrowTheSwitch/Unity
* branch 7d2bf62b7e6afaf38153041a9d53c21aeeca9a25 -> FETCH_HEAD
Using esp-idf v5.1.1 at '/home/developer/rust/test23/.embuild/espressif/esp-idf/v5.1.1'
Compiler supported targets: xtensa-esp32-elf
Built components: xtensa, esp_ringbuf, efuse, driver, esp_pm, mbedtls, esp_app_format, bootloader_support, bootloader, esptool_py, partition_table, esp_partition, app_update, esp_mm, spi_flash, pthread, esp_system, esp_rom, hal, log, heap, soc, esp_hw_support, freertos, newlib, cxx, esp_common, esp_timer, app_trace, esp_event, nvs_flash, esp_phy, vfs, lwip, esp_netif_stack, esp_netif, wpa_supplicant, esp_coex, esp_wifi, bt, unity, cmock, console, http_parser, esp-tls, esp_adc, esp_eth, esp_gdbstub, esp_hid, tcp_transport, esp_http_client, esp_http_server, esp_https_ota, esp_https_server, esp_psram, esp_lcd, protobuf-c, protocomm, esp_local_ctrl, espcoredump, wear_levelling, sdmmc, fatfs, idf_test, ieee802154, json, mqtt, openthread, perfmon, spiffs, ulp, usb, wifi_provisioning
error: unknown target triple 'xtensa', please use -triple or -arch
thread 'main' panicked at /home/developer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.63.0/ir/context.rs:530:15:
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!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
did you install via espup ? make sure your env variables are not poluted and that you source the export script export-esp.sh
$ espup install $ chmod u+x ~/export-esp.sh $ ~/export-esp.sh $ cargo generate --git https://github.com/esp-rs/esp-idf-template cargo $ cd project1 $ cargo build
.... error as above
thats not how you source env file on debian - please also check out https://github.com/esp-rs/esp-idf-hal/issues/319 for more info regarding this specific problem
thanks - will check tomorrow
$ chmod u+x ~/export-esp.sh ~/export-esp.sh
Yeah, to cut some chasing in the (long) other thread @Vollbrecht mentioned, you need to do, exactly:
. ~/export-esp.sh
And I'm so sick and tired of this problem :(
@SergioGasquez Enjoy your vacation, but maybe another nail on the "export" script coffin. :) We need the symlink approach, I think.
$ . ~/export-esp.sh $ caro clean $ rm -rf .embuild $ cargo build
Compiling esp-idf-svc v0.46.2 Compiling embedded-can v0.4.1 Compiling no-std-net v0.5.0 Compiling embassy-time v0.1.4 Compiling project1 v0.1.0 (/home/developer/rust/project1) Compiling embassy-futures v0.1.0 Compiling embedded-svc v0.25.3 Finished dev [optimized + debuginfo] target(s) in 4m 03s
thanks a lot to @ALL !
@ivmarkov
And I'm so sick and tired of this problem :(
Sorry about that!
Hi, using Debian 12 on x86_64
did following:
$ rustup toolchain install nightly --component rust-src $ cargo install cargo-generate $ cargo install ldproxy $ cargo install espflash $ cargo install cargo-espflash
$ rustc --version rustc 1.73.0-nightly (9163a2087 2023-10-03) (1.73.0.0)
$ cargo generate --git https://github.com/esp-rs/esp-idf-template cargo
$ cargo build
How can I fix this ?
I tyed this:
$ cargo add virtualenv-rs
but got this by running: cargo build