Closed kkimes2020 closed 1 year ago
I copy here the relevant part of the logs.
ImportError: dlopen(/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '_ffi_type_double'
thread '<unnamed>' panicked at 'Python API call failed', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.18.3/src/err/mod.rs:790:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
File "/Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/gen_crt_bundle.py", line 25, in <module>
from cryptography import x509
File "/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/cryptography/x509/__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
File "/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py", line 11, in <module>
from cryptography.hazmat.bindings._rust import x509 as rust_x509
pyo3_runtime.PanicException: Python API call failed
ninja: build stopped: subcommand failed.
Can you run the following please and see if it reveals anything else:
RUST_BACKTRACE=1 idf.py build
Also please share the output of python -m pip freeze
.
I ran that. Here is the stdout log, stderr is empty.
On Fri, Jun 2, 2023 at 7:07 AM Roland Dobai @.***> wrote:
I copy here the relevant part of the logs.
ImportError: dlopen(/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '_ffi_type_double' thread '
' panicked at 'Python API call failed', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.18.3/src/err/mod.rs:790:5 note: run with RUST_BACKTRACE=1
environment variable to display a backtrace Traceback (most recent call last): File "/Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/gen_crt_bundle.py", line 25, infrom cryptography import x509 File "/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/cryptography/x509/init.py", line 7, in from cryptography.x509 import certificate_transparency File "/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py", line 11, in from cryptography.hazmat.bindings._rust import x509 as rust_x509 pyo3_runtime.PanicException: Python API call failed ninja: build stopped: subcommand failed. Can you run the following please and see if it reveals anything else:
RUST_BACKTRACE=1 idf.py build
Also please share the output of python -m pip freeze.
— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/11578#issuecomment-1573257892, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATYDQ5OQDSBPLWQKKR76V4LXJGGJTANCNFSM6AAAAAAYXY5H4M . You are receiving this because you authored the thread.Message ID: @.***>
Please try to remove the content of /Users/usr/.espressif/python_env/idf5.2_py3.12_env
and re-run the install scripts. Maybe that will help.
I didn't notice the python -m pip freeze
03:18[hello]> python -m pip freeze
bitstring==4.0.2
CacheControl==0.13.0
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.3
colorama==0.4.6
construct==2.10.68
contextlib2==21.6.0
cryptography==41.0.1
ecdsa==0.18.0
esp-coredump==1.5.1
esp-idf-kconfig==1.1.0
esp-idf-monitor==1.0.4
esp-idf-size==0.3.1
esptool==4.6.1
filelock==3.12.0
freertos-gdb==1.0.2
future==0.18.3
idf-component-manager==1.2.3
idna==3.4
kconfiglib==14.1.0
msgpack==1.0.5
packaging==23.1
pycparser==2.21
pyelftools==0.29
pygdbmi==0.9.0.2
pyparsing==3.0.9
pyserial==3.5
PyYAML==6.0
reedsolo==1.7.0
requests==2.31.0
requests-file==1.5.1
requests-toolbelt==1.0.0
schema==0.7.5
six==1.16.0
tqdm==4.65.0
urllib3==1.26.16
03:19[hello]> rm -rf /Users/usr/.espressif/python_env/idf5.2_py3.12_env
03:20[hello]> RUST_BACKTRACE=1 idf.py build
Please use idf.py only in an ESP-IDF shell environment.
03:20[hello]>
On Mon, Jun 5, 2023 at 8:11 AM Roland Dobai @.***> wrote:
Please try to remove the content of /Users/usr/.espressif/python_env/idf5.2_py3.12_env and re-run the install scripts. Maybe that will help.
— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/11578#issuecomment-1576308555, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATYDQ5LPDLWNZQTQ27BBJUDXJWIE5ANCNFSM6AAAAAAYXY5H4M . You are receiving this because you authored the thread.Message ID: @.***>
Ran ./install.sh esp32c3 esp32c6 Then, closed terminal. Opened new terminal emulator and ran . ./export.sh I was concerned about the state of environment. In /esp/hello/, ran idf.py clean then, idf.py set-target esp32c6 RUST_BACKTRACE=1 idf.py build idf_py_stdout_output_44956.txt
In $HOME/esp/hello/, idf.py clean idf.py set-target esp32c3 RUST_BACKTRACE=full idf.py build idf_py_stdout_output_55139.txt
Please try the following and share the output from the terminal (not the files which are missing some information):
. $IDF_PATH/export.sh
python -m pip uninstall cryptography cffi
python -m pip --no-cache-dir install cryptography cffi
cd your_project
idf.py build
I have attached the paste from from my macOS terminal emulator:
On Thu, Jun 8, 2023 at 5:41 PM Roland Dobai @.***> wrote:
Please try the following and share the output from the terminal (not the files which are missing some information):
. $IDF_PATH/export.sh python -m pip uninstall cryptography cffi python -m pip --no-cache-dir install cryptography cffi cd your_project idf.py build
— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-idf/issues/11578#issuecomment-1583079964, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATYDQ5PAXBCSGS6UR6OMPHLXKIFE5ANCNFSM6AAAAAAYXY5H4M . You are receiving this because you authored the thread.Message ID: @.***>
00:45[~]> . $IDF_PATH/export.sh Detecting the Python interpreter Checking "python3" ... Python 3.12.0b1 "python3" has been detected Checking Python compatibility Checking other ESP-IDF version. Adding ESP-IDF tools to PATH... Checking if Python packages are up to date... Constraint file: /Users/usr/.espressif/espidf.constraints.v5.2.txt Requirement files:
/Users/usr/esp/esp-idf/tools/requirements/requirements.core.txt Python being checked: /Users/usr/.espressif/python_env/idf5.2_py3.12_env/bin/python Python requirements are satisfied. Added the following directories to PATH: /Users/usr/esp/esp-idf/components/espcoredump /Users/usr/esp/esp-idf/components/partition_table /Users/usr/esp/esp-idf/components/app_update /Users/usr/.espressif/tools/xtensa-esp-elf-gdb/12.1_20221002/xtensa-esp-elf-gdb/bin /Users/usr/.espressif/tools/riscv32-esp-elf-gdb/12.1_20221002/riscv32-esp-elf-gdb/bin /Users/usr/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin /Users/usr/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin /Users/usr/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin /Users/usr/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin /Users/usr/.espressif/python_env/idf5.2_py3.12_env/bin /Users/usr/esp/esp-idf/tools Done! You can now compile ESP-IDF projects. Go to the project directory and run:
idf.py build
WARNING: Failed to load shell autocompletion for bash version: 3.2.57(1)-release!
00:46[~]> python -m pip uninstall cryptography cffi
Found existing installation: cryptography 41.0.1
Uninstalling cryptography-41.0.1:
Would remove:
/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/cryptography-41.0.1.dist-info/
/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/cryptography/
Proceed (Y/n)?
Successfully uninstalled cryptography-41.0.1
Found existing installation: cffi 1.15.1
Uninstalling cffi-1.15.1:
Would remove:
/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so
/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/cffi-1.15.1.dist-info/
/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/cffi/
Proceed (Y/n)?
Successfully uninstalled cffi-1.15.1
00:46[~]> python -m pip --no-cache-dir install cryptography cffi
Collecting cryptography
Downloading cryptography-41.0.1-cp37-abi3-macosx_10_12_universal2.whl (5.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.3/5.3 MB 2.0 MB/s eta 0:00:00
Collecting cffi
Downloading cffi-1.15.1.tar.gz (508 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 508.5/508.5 kB 4.3 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pycparser in ./.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages (from cffi) (2.21)
Building wheels for collected packages: cffi
Building wheel for cffi (pyproject.toml) ... done
Created wheel for cffi: filename=cffi-1.15.1-cp312-cp312-macosx_10_9_universal2.whl size=257089 sha256=0e30204c2cd4d455e9d92b12f5b09b3182cb93ec43c7cab6622fe110ce2e883c
Stored in directory: /private/var/folders/9k/19_hr_ln0sv9p4chzmzptgdh0000gn/T/pip-ephem-wheel-cache-6yht1zdq/wheels/3a/2a/71/6b7440057c755c3f53076056b834d2d9aad2531db1ed555be4
Successfully built cffi
Installing collected packages: cffi, cryptography
Successfully installed cffi-1.15.1 cryptography-41.0.1
00:46[~]> cd esp/helloo
-bash: cd: esp/helloo: No such file or directory
00:47[~]> cd esp/hello
00:47[hello]> idf.py build
Executing action: all (aliases: build)
Running ninja in directory /Users/usr/esp/hello/build
Executing "ninja all"...
[1/1] cd /Users/usr/esp/hello/build/bo.../hello/build/bootloader/bootloader.binBootloader binary size 0x50b0 bytes. 0x2f50 bytes (37%) free.
[4/205] Generating x509_crt_bundleFAILED: esp-idf/mbedtls/x509_crt_bundle /Users/usr/esp/hello/build/esp-idf/mbedtls/x509_crt_bundle
cd /Users/usr/esp/hello/build/esp-idf/mbedtls && /Users/usr/.espressif/python_env/idf5.2_py3.12_env/bin/python /Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/gen_crt_bundle.py --input /Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem /Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_local.pem -q
ImportError: dlopen(/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '_ffi_type_double'
thread 'RUST_BACKTRACE=1
environment variable to display a backtrace
Traceback (most recent call last):
File "/Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/gen_crt_bundle.py", line 25, in
nvs,data,nvs,0x9000,24K, phy_init,data,phy,0xf000,4K, factory,app,factory,0x10000,1M,
[661/866] Generating x509_crt_bundleFAILED: esp-idf/mbedtls/x509_crt_bundle /Users/usr/esp/hello/build/esp-idf/mbedtls/x509_crt_bundle
cd /Users/usr/esp/hello/build/esp-idf/mbedtls && /Users/usr/.espressif/python_env/idf5.2_py3.12_env/bin/python /Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/gen_crt_bundle.py --input /Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem /Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_local.pem -q
ImportError: dlopen(/Users/usr/.espressif/python_env/idf5.2_py3.12_env/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '_ffi_type_double'
thread 'RUST_BACKTRACE=1
environment variable to display a backtrace
Traceback (most recent call last):
File "/Users/usr/esp/esp-idf/components/mbedtls/esp_crt_bundle/gen_crt_bundle.py", line 25, in
I cloned ninja from github.com, built it and copied it to /usr/local/bin. My "idf.py build" for esp32c3 and esp32c6 now completes without error.
I'm happy that your issue has been solved.
But honestly I don't understand how ninja and cryptography relates to each other. To me, the issue looked liked as a broken cryptography wheel linked to libraries not present on your computer.
Anyway, this seems to be an isolated issue and no further action is required.
I don't understand it at all. But, then I don't understand a lot. Like just about everything "freedesktop.org" aka Redhat has done since the 1990's. Dbus, gvfs, NetworkManager, LoginMaager, systemd... I don't use homebrew anymore because, it creates conflicts after a short while. Anaconda either.
I don't understand what RUST_BACKTRACE=1, is. Is there Rust language code in esp-idf?
I really don't want to have to have gigabytes of binaries in large, complex ".rustup" and ".cargo" directories in order to maintain things. Tools downloading binaries to a machine is scary and rust does it insecurely. Aside from rust's only advantage being manual memory management disguised as new theory and complex constructs in the language. But, when do we get to pick things, these days?
With esp-idf I understand that I need crosscompilers but, it gets really hard to know what's going on with all these python build tools on top of ninja with cmake.
Thanks for your time and help.
Answers checklist.
IDF version.
v5.2-dev-823-g903af13e84
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
What is the expected behavior?
Expect "idf.py build" in my "hello-world" subdirectory of $HOME/esp/ to complete without error.
What is the actual behavior?
Exits with error.
Steps to reproduce.
idf_py_stdout_output_67580.txt idf_py_stderr_output_67580.txt
Build or installation Logs.
More Information.
Have also, tried installing using VSCode and Eclipse similar or more confusing behavior occurred.