Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed due to failure of loading libclang.dll when generating bindings #440

Open
Sydonian opened this issue Jul 21, 2024 · 12 comments
Assignees

Comments

@Sydonian
Copy link

building logs:

   Compiling byteorder v1.5.0
   Compiling nb v1.1.0
   Compiling embedded-io v0.6.1
   Compiling stable_deref_trait v1.2.0
   Compiling embedded-hal v1.0.0
   Compiling futures-core v0.3.30
   Compiling futures-task v0.3.30
   Compiling pin-utils v0.1.0
   Compiling esp-idf-sys v0.35.0
   Compiling pin-project-lite v0.2.14
   Compiling enumset v1.1.3
   Compiling libc v0.2.155
   Compiling futures-util v0.3.30
   Compiling nb v0.1.3
   Compiling const_format v0.2.32
   Compiling embedded-io-async v0.6.1
   Compiling hash32 v0.3.1
   Compiling void v1.0.2
   Compiling critical-section v1.1.2
   Compiling cfg-if v1.0.0
   Compiling num_enum v0.7.2
   Compiling heapless v0.8.0
   Compiling embedded-hal v0.2.7
   Compiling embedded-hal-nb v1.0.0
   Compiling embedded-hal-async v1.0.0
   Compiling embedded-can v0.4.1
   Compiling serde v1.0.204
   Compiling atomic-waker v1.1.2
   Compiling log v0.4.22
   Compiling uncased v0.9.10
   Compiling embassy-time-driver v0.1.0
   Compiling embassy-futures v0.1.1
   Compiling embassy-sync v0.6.0
   Compiling embedded-svc v0.28.0
The following warnings were emitted during compilation:

warning: [email protected]: (esp-idf-sys) Too long output directory: `\\?\E:\ESP\projects\testlcd\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-3ae04a86ffd25549\out`. Shorten your project path down to no more than 10 characters (or use WSL2 and its native Linux filesystem). Note that tricks like Windows `subst` do NOT work!
warning: [email protected]: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `cc` installed? (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
warning: [email protected]: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `c++` installed? (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
warning: [email protected]: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `cc` installed? (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)

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

Caused by:
  process didn't exit successfully: `E:\ESP\projects\testlcd\target\debug\build\esp-idf-sys-d7ae078c1bb86ffe\build-script-build` (exit code: 101)
  --- stdout
  cargo:warning=(esp-idf-sys) Too long output directory: `\\?\E:\ESP\projects\testlcd\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-3ae04a86ffd25549\out`. Shorten your project path down to no more than 10 characters (or use WSL2 and its native Linux filesystem). Note that tricks like Windows `subst` do NOT work!
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=MCU
  cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=EXTRA-COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
  Python 3.12.4
  pip 24.1.2 from E:\ESP\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\Lib\site-packages\pip (python 3.12)
  Requirement already satisfied: pip in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (24.1.2)
  Requirement already satisfied: setuptools in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (71.0.0)
  Collecting setuptools
    Using cached setuptools-71.0.4-py3-none-any.whl.metadata (6.5 kB)
  Using cached setuptools-71.0.4-py3-none-any.whl (2.3 MB)
  Installing collected packages: setuptools
    Attempting uninstall: setuptools
      Found existing installation: setuptools 71.0.0
      Uninstalling setuptools-71.0.0:
        Successfully uninstalled setuptools-71.0.0
  Successfully installed setuptools-71.0.4
  Looking in indexes: https://pypi.org/simple, https://dl.espressif.com/pypi
  Ignoring importlib_metadata: markers 'python_version < "3.8"' don't match your environment
  Collecting setuptools (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 3))
    Using cached setuptools-71.0.0-py3-none-any.whl.metadata (6.5 kB)
  Requirement already satisfied: packaging in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 4)) (24.1)
  Requirement already satisfied: click in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 7)) (8.1.7)
  Requirement already satisfied: pyserial in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 8)) (3.5)
  Requirement already satisfied: cryptography in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (41.0.7)
  Requirement already satisfied: pyparsing in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 10)) (3.1.2)
  Requirement already satisfied: pyelftools in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 11)) (0.31)
  Requirement already satisfied: idf-component-manager in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.5.3)
  Requirement already satisfied: esp-coredump in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 13)) (1.11.0)
  Requirement already satisfied: esptool in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (4.7.0)
  Requirement already satisfied: esp-idf-kconfig in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15)) (1.4.2)
  Requirement already satisfied: esp-idf-monitor in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 16)) (1.4.0)
  Requirement already satisfied: esp-idf-size in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (1.5.0)
  Requirement already satisfied: esp-idf-panic-decoder in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 18)) (1.1.0)
  Requirement already satisfied: pyclang in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 19)) (0.4.2)
  Requirement already satisfied: construct in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 20)) (2.10.70)
  Requirement already satisfied: freertos_gdb in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 23)) (1.0.3)
  Requirement already satisfied: colorama in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from click->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 7)) (0.4.6)
  Requirement already satisfied: cffi>=1.12 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from cryptography->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (1.16.0)
  Requirement already satisfied: requests<3 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2.32.3)
  Requirement already satisfied: urllib3<2 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.26.19)
  Requirement already satisfied: requests-file<2 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.5.1)
  Requirement already satisfied: requests-toolbelt in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.0.0)
  Requirement already satisfied: schema<=0.7.5 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (0.7.5)
  Requirement already satisfied: six in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.16.0)
  Requirement already satisfied: tqdm<5 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (4.66.4)
  Requirement already satisfied: pyyaml>5.2 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (6.0.1)
  Requirement already satisfied: cachecontrol>0.12.6 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (0.14.0)
  Requirement already satisfied: contextlib2>0.6.0 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (21.6.0)
  Requirement already satisfied: pygdbmi>=0.9.0.2 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esp-coredump->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 13)) (0.11.0.0)
  Requirement already satisfied: bitstring>=3.1.6 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esptool->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (4.2.3)
  Requirement already satisfied: ecdsa>=0.16.0 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esptool->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (0.19.0)
  Requirement already satisfied: reedsolo<1.8,>=1.5.3 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esptool->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (1.7.0)
  Requirement already satisfied: intelhex in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esptool->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (2.3.0)
  Requirement already satisfied: kconfiglib>=13.7.1 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esp-idf-kconfig->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15)) (14.1.0)
  Requirement already satisfied: windows-curses in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esp-idf-kconfig->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15)) (2.3.3)
  Requirement already satisfied: rich in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esp-idf-size->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (13.7.1)
  Requirement already satisfied: bitarray<3.0.0,>=2.9.0 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from bitstring>=3.1.6->esptool->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (2.9.2)
  Requirement already satisfied: msgpack<2.0.0,>=0.5.2 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from cachecontrol>0.12.6->cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.0.8)
  Requirement already satisfied: filelock>=3.8.0 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (3.15.4)
  Requirement already satisfied: pycparser in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from cffi>=1.12->cryptography->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (2.22)
  Requirement already satisfied: charset-normalizer<4,>=2 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from requests<3->idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (3.3.2)
  Requirement already satisfied: idna<4,>=2.5 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from requests<3->idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (3.7)
  Requirement already satisfied: certifi>=2017.4.17 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from requests<3->idf-component-manager->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2024.7.4)
  Requirement already satisfied: markdown-it-py>=2.2.0 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from rich->esp-idf-size->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (3.0.0)
  Requirement already satisfied: pygments<3.0.0,>=2.13.0 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from rich->esp-idf-size->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (2.18.0)
  Requirement already satisfied: mdurl~=0.1 in e:\esp\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from markdown-it-py>=2.2.0->rich->esp-idf-size->-r E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (0.1.2)
  Using cached setuptools-71.0.0-py3-none-any.whl (908 kB)
  Installing collected packages: setuptools
    Attempting uninstall: setuptools
      Found existing installation: setuptools 71.0.4
      Uninstalling setuptools-71.0.4:
        Successfully uninstalled setuptools-71.0.4
  Successfully installed setuptools-71.0.0
  Upgrading pip and setuptools...
  Skipping the download of E:\ESP\projects\testlcd\.embuild\espressif\espidf.constraints.v5.2.txt because it was downloaded recently.
  Installing Python packages
   Constraint file: E:\ESP\projects\testlcd\.embuild\espressif\espidf.constraints.v5.2.txt
   Requirement files:
    - E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt
  cargo:rerun-if-changed=E:\ESP\projects\testlcd\sdkconfig.defaults
  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `cc` installed? (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `c++` installed? (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `cc` installed? (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
  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" "E:\\ESP\\projects\\testlcd\\target\\xtensa-esp32-espidf\\debug\\build\\esp-idf-sys-3ae04a86ffd25549\\out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=E:\\ESP\\projects\\testlcd\\.embuild\\espressif\\esp-idf\\v5.2.2\\tools\\cmake\\toolchain-esp32.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=E:/ESP/projects/testlcd/.embuild/espressif/python_env/idf5.2_py3.12_env/Scripts/python" "-DCMAKE_INSTALL_PREFIX=E:\\ESP\\projects\\testlcd\\target\\xtensa-esp32-espidf\\debug\\build\\esp-idf-sys-3ae04a86ffd25549\\out" "-DCMAKE_C_FLAGS= -mlongcalls -Wno-frame-address -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy" "-DCMAKE_CXX_FLAGS= -mlongcalls -Wno-frame-address -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy" "-DCMAKE_ASM_FLAGS= -mlongcalls"
  -- git describe returned 'fatal: bad revision 'HEAD''
  -- Could not use 'git describe' to determine PROJECT_VER.
  -- Building ESP-IDF components for target esp32
  -- Checking Python dependencies...
  Python requirements are satisfied.
  Constraint file: E:\ESP\projects\testlcd\.embuild\espressif\espidf.constraints.v5.2.txt
  Requirement files:
   - E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt
  Python being checked: E:\ESP\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\Scripts\python.exe
  -- Project sdkconfig file E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/sdkconfig
  Loading defaults file E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/gen-sdkconfig.defaults...
  E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/gen-sdkconfig.defaults:2 CONFIG_COMPILER_OPTIMIZATION_DEFAULT was replaced with CONFIG_COMPILER_OPTIMIZATION_DEBUG
  Loading defaults file E:/ESP/projects/testlcd/sdkconfig.defaults...
  -- Compiler supported targets: xtensa-esp-elf
  -- App "libespidf" version: 1
  -- Adding linker script E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/build/esp-idf/esp_system/ld/memory.ld
  -- Adding linker script E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/build/esp-idf/esp_system/ld/sections.ld.in
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.api.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/soc/esp32/ld/esp32.peripherals.ld
  -- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash nvs_sec_provider openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
  -- Component paths: E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/app_trace E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/app_update E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bootloader E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bootloader_support E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bt E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/cmock E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/console E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/cxx E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/driver E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/efuse E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp-tls E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_adc E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_app_format E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_bootloader_format E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_coex E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_common E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_eth E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_event E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_gdbstub E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_hid E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_http_client E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_http_server E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_https_ota E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_https_server E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_hw_support E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_lcd E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_local_ctrl E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_mm E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_netif E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_netif_stack E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_partition E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_phy E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_pm E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_psram E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_ringbuf E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_system E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_timer E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_wifi E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/espcoredump E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esptool_py E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/fatfs E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/freertos E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/hal E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/heap E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/http_parser E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/idf_test E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/ieee802154 E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/json E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/log E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/lwip E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/main E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/mbedtls E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/mqtt E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/newlib E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/nvs_flash E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/nvs_sec_provider E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/openthread E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/partition_table E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/perfmon E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/protobuf-c E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/protocomm E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/pthread E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/sdmmc E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/soc E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/spi_flash E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/spiffs E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/tcp_transport E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/ulp E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/unity E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/usb E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/vfs E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/wear_levelling E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/wifi_provisioning E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/wpa_supplicant E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/xtensa
  -- Configuring done
  -- Generating done
  -- Build files have been written to: E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/build
  running: "cmake" "--build" "." "--config" "MinSizeRel" "--parallel" "12"
  [1/7] Generating ld/sections.ld
  [2/7] Linking CXX executable libespidf.elf
  [3/7] Performing build step for 'bootloader'
  -- Building ESP-IDF components for target esp32
  -- Project sdkconfig file E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/sdkconfig
  -- Compiler supported targets: xtensa-esp-elf
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/soc/esp32/ld/esp32.peripherals.ld
  -- Bootloader project name: "bootloader" version: 1
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.api.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/main/ld/esp32/bootloader.ld
  -- Adding linker script E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld
  -- Components: bootloader bootloader_support efuse esp_app_format esp_bootloader_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
  -- Component paths: E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bootloader E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bootloader_support E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/efuse E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_app_format E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_bootloader_format E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_common E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_hw_support E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esp_system E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/esptool_py E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/freertos E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/hal E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/log E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/main E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/components/micro-ecc E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/newlib E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/partition_table E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/soc E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/spi_flash E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/xtensa
  -- Configuring done
  -- Generating done
  -- Build files have been written to: E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/build/bootloader
  [0/1] Re-running CMake...
  [1/1] cmd.exe /C "cd /D E:\ESP\projects\testlcd\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-3ae04a86ffd25549\out\build\bootloader\esp-idf\esptool_py && E:\ESP\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\Scripts\python E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/build/bootloader/bootloader.bin"
  Bootloader binary size 0x6860 bytes. 0x7a0 bytes (7%) free.
  [4/5] Generating binary image from built executable
  esptool.py v4.7.0
  Creating esp32 image...
  Merged 2 ELF sections
  Successfully created esp32 image.
  Generated E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/build/libespidf.bin
  [5/5] cmd.exe /C "cd /D E:\ESP\projects\testlcd\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-3ae04a86ffd25549\out\build\esp-idf\esptool_py && E:\ESP\projects\testlcd\.embuild\espressif\python_env\idf5.2_py3.12_env\Scripts\python E:/ESP/projects/testlcd/.embuild/espressif/esp-idf/v5.2.2/components/partition_table/check_sizes.py --offset 0x8000 partition --type app E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/build/partition_table/partition-table.bin E:/ESP/projects/testlcd/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-3ae04a86ffd25549/out/build/libespidf.bin"
  libespidf.bin binary size 0x27930 bytes. Smallest app partition is 0x100000 bytes. 0xd86d0 bytes (85%) free.
  cargo:root=E:\ESP\projects\testlcd\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-3ae04a86ffd25549\out
  cargo:rerun-if-changed=C:\Users\79nos\.cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\esp-idf-sys-0.35.0\src\include\esp-idf\bindings.h
  cargo:rustc-env=EMBUILD_GENERATED_BINDINGS_FILE=E:\ESP\projects\testlcd\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-3ae04a86ffd25549\out\bindings.rs

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: None,
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: None,
      mcu: Some(
          "esp32",
      ),
      native: NativeConfig {
          esp_idf_version: Some(
              Tag(
                  "v5.2.2",
              ),
          ),
          esp_idf_repository: None,
          esp_idf_cmake_generator: None,
          idf_path: None,
          extra_components: [],
          esp_idf_components: None,
          esp_idf_component_manager: None,
      },
      esp_idf_sys_root_crate: None,
  }
  Using managed esp-idf repository: RemoteSdk { repo_url: None, git_ref: Tag("v5.2.2") }
  Using esp-idf v5.2.2 at 'E:\ESP\projects\testlcd\.embuild\espressif\esp-idf\v5.2.2'
  Built components: xtensa, esp_ringbuf, efuse, esp_mm, driver, esp_pm, mbedtls, esp_bootloader_format, esp_app_format, bootloader_support, bootloader, esptool_py, partition_table, esp_partition, app_update, 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, nvs_sec_provider, openthread, perfmon, spiffs, ulp, usb, wifi_provisioning, main
  thread 'main' panicked at C:\Users\79nos\.cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\bindgen-0.69.4\lib.rs:622:31:
  Unable to find libclang: "the `libclang` shared library at C:\\Users\\79nos\\.rustup\\toolchains\\esp\\xtensa-esp32-elf-clang\\esp-clang\\bin\\libclang.dll could not be opened: LoadLibraryExW failed"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

and I have set the LIBCLANG_PATH env:
image

@thielemans
Copy link

thielemans commented Jul 23, 2024

Can confirm that I have the same issue after updating rustup, espup & espup update.

The dll is on the specified path but could not be opened for some reason. This persists after (re)installing the ESP IDF cargo subcommands and doing espup remove & espup install.


I reverted to an older espup version (cargo install [email protected]), ran espup uninstall & espup install and compilation is now working again on my Windows machine.

@Vollbrecht
Copy link
Contributor

Vollbrecht commented Jul 23, 2024

what version of the esp rust toolchain did you currently have installed? E.g what is the result of rustc +esp --version. There were some windows specific problems, that lead the team to not be able to create a windows version of the compiler for some of the latest releases.

You can checkout the respective repos here and here.

Depending on your version installed try to downgrade one compiler version earlier and check if that helps. You can see on the linked release page from above, how you can install a specific compiler version. Also than make sure to either delete the "newer" so the other one is actually used.

@Sydonian
Copy link
Author

what version of the esp rust toolchain did you currently have installed? E.g what is the result of rustc +esp --version. There were some windows specific problems, that lead the team to not be able to create a windows version of the compiler for some of the latest releases.

You can checkout the respective repos here and here.

Depending on your version installed try to downgrade one compiler version earlier and check if that helps. You can see on the linked release page from above, how you can install a specific compiler version. Also than make sure to either delete the "newer" so the other one is actually used.

Here is the toolchain version I using currently:
QQ截图20240723201541
and the version of espup:
image

I just ran esp uninstall and esp install --toolchain-version 1.77.0 to install an older toolchain, then I got complied successfully. Maybe there is something wrong with the newer veriosn?

@thielemans
Copy link

I tried with 3 espup versions, each time doing an uninstall first and installing the default toolchain (1.79.0.0 nightly) again. Tested on a clean build of my current project.

espup 0.12.2
rustc 1.79.0-nightly (e60d66433 2024-06-10) (1.79.0.0)

Fails

espup 0.12.0
rustc 1.79.0-nightly (e60d66433 2024-06-10) (1.79.0.0)

Also fails

rustc 1.79.0-nightly (e60d66433 2024-06-10) (1.79.0.0)
espup 0.11.0

Works in my case. Would it be possible that the issue is related to the way how espup sets up the environment?

@Sydonian Sydonian changed the title Build failed due to load libclang.dll when generating bindings Build failed due to failure of loading libclang.dll when generating bindings Jul 23, 2024
@Vollbrecht
Copy link
Contributor

@SergioGasquez @MabezDev are you aware of windows specific issues in espup v12 ? Should i transfer the issue?

@MabezDev MabezDev transferred this issue from esp-rs/esp-idf-sys Jul 25, 2024
@taks
Copy link

taks commented Jul 26, 2024

The same error occurred in my environment.
I was able to compile successfully by replacing LLVM17 files with LLVM16 files in .rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang directory.

@SergioGasquez
Copy link
Member

The same error occurred in my environment. I was able to compile successfully by replacing LLVM17 files with LLVM16 files in .rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang directory.

Out of curiosity, what happens if you only replace the libclang.dll from LLVM 17 for the on in LLVM 16?

@taks
Copy link

taks commented Jul 30, 2024

Out of curiosity, what happens if you only replace the libclang.dll from LLVM 17 for the on in LLVM 16?

If only libclang.dll is replaced, the same error occurs.
(This is because there is no dependency dll.)

I tried to get the cause of the load error with the GetLastError function.
The error code when loading the LLVM17 dll was 193 (ERROR_BAD_EXE_FORMAT: %1 is not a valid Win32 application.)

Incidentally, the error code when replacing only libclang.dll was 126 (ERROR_MOD_NOT_FOUND: The specified module could not be found.)

@SergioGasquez
Copy link
Member

Thanks for the detailed information, at the moment I don't have a Windows environment to reproduce the error and Im not sure what we can do from the espup side (but removing LLVM 17 and just using LLVM 16 for Windows). I would like to ask a few extra tests if you dont mind:

  • Have you tried using the -e, --extended-llvm flag?
  • Could you try using the following LLVM 17 release, we are using the latest one in espup
    • To use this release, just download the Windows asset, unzip it and replace the files in the folder like you did for LLVM 16.

@taks
Copy link

taks commented Jul 30, 2024

I found the cause of the error.

When loading libclang.dll (LLVM17), the dependency libstdc++-6.dll is also loaded.
However, instead of libstdc++-6.dll, which is bundled with libclang.dll, the one in embuild\espressif\tools\xtensa-esp-elf\esp-13.2.0_20230928\xtensa-esp-elf\bin is loaded.
These libstdc++-6.dll are different and this error is caused.

(the libstdc++-6.dll is not bundled in LLVM16)

  • Have you tried using the -e, --extended-llvm flag?
  • Could you try using the following LLVM 17 release, we are using the latest one in espup

Both do not work well.

@KiritoMC03
Copy link

KiritoMC03 commented Sep 1, 2024

Hi !
I had the same problem.
Solved by replacing the contents of

  • ".rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang\bin"
    and
  • ".rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang\lib"

with the contents of the same folders from https://github.com/espressif/llvm-project/releases/tag/esp-16.0.4-20231113
and renaming of the file ".rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-17.0.1_20240419" to "esp-16.0.4-20231113"

Build logs (cargo clean -> cargo build)
no_backtrace_logs.txt
backtrace_full_logs.txt

Project config files:
config.toml.txt
Cargo.toml.txt

Environment:

@licsber
Copy link

licsber commented Sep 25, 2024

Same above.
Replace ~/.rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang with
libs_llvm-esp-16.0.4-20231113-win64.tar.xz works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

7 participants