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

LoadLibraryExW failes on libclang.dll #282

Closed
FssAy opened this issue Nov 29, 2024 · 4 comments
Closed

LoadLibraryExW failes on libclang.dll #282

FssAy opened this issue Nov 29, 2024 · 4 comments

Comments

@FssAy
Copy link

FssAy commented Nov 29, 2024

When trying to run cargo build on Windows 10 after performing every step from the book I am getting an error:

Unable to find libclang: "the `libclang` shared library at C:\\Users\\Dmitrij\\.rustup\\toolchains\\esp\\xtensa-esp32-elf-clang\\esp-clang\\bin\\libclang.dll could not be opened: LoadLibraryExW failed"

The path to the file is correct, the file exists and is not corrupted.

Here is the full log:

D:\vats>cargo build
   Compiling bindgen v0.69.5
   Compiling embuild v0.32.0
   Compiling esp-idf-sys v0.35.0
   Compiling esp-idf-hal v0.44.1
   Compiling esp-idf-svc v0.49.1
   Compiling vats v0.1.0 (D:\vats)
The following warnings were emitted during compilation:

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: `D:\vats\target\debug\build\esp-idf-sys-794f3a5c7d9aa6c9\build-script-build` (exit code: 101)
  --- stdout
  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.13.0
  pip 24.3.1 from D:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\Lib\site-packages\pip (python 3.13)
  Requirement already satisfied: pip in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (24.3.1)
  Requirement already satisfied: setuptools in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (71.0.0)
  Collecting setuptools
    Using cached setuptools-75.6.0-py3-none-any.whl.metadata (6.7 kB)
  Using cached setuptools-75.6.0-py3-none-any.whl (1.2 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-75.6.0
  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 D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 3))
    Using cached https://dl.espressif.com/pypi/setuptools/setuptools-71.0.0-py3-none-any.whl (908 kB)
  Requirement already satisfied: packaging in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 4)) (24.2)
  Requirement already satisfied: click in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 7)) (8.1.7)
  Requirement already satisfied: pyserial in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 8)) (3.5)
  Requirement already satisfied: cryptography in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (41.0.7)
  Requirement already satisfied: pyparsing in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 10)) (3.2.0)
  Requirement already satisfied: pyelftools in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 11)) (0.31)
  Requirement already satisfied: idf-component-manager in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2.0.4)
  Requirement already satisfied: esp-coredump in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 13)) (1.12.0)
  Requirement already satisfied: esptool in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (4.8.1)
  Requirement already satisfied: esp-idf-kconfig in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15)) (1.4.0)
  Collecting esp-idf-kconfig (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15))
    Using cached https://dl.espressif.com/pypi/esp-idf-kconfig/esp_idf_kconfig-1.4.3-py3-none-any.whl (44 kB)
  Requirement already satisfied: esp-idf-monitor in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 16)) (1.5.0)
  Requirement already satisfied: esp-idf-size in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (1.6.1)
  Requirement already satisfied: esp-idf-panic-decoder in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 18)) (1.2.1)
  Requirement already satisfied: pyclang in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 19)) (0.5.0)
  Requirement already satisfied: construct in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 20)) (2.10.70)
  Requirement already satisfied: freertos_gdb in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from -r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 23)) (1.0.3)
  Requirement already satisfied: colorama in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from click->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 7)) (0.4.6)
  Requirement already satisfied: cffi>=1.12 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from cryptography->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (1.17.1)
  Requirement already satisfied: pyyaml in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (6.0.2)
  Requirement already satisfied: requests in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2.32.3)
  Requirement already satisfied: requests-file in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2.1.0)
  Requirement already satisfied: requests-toolbelt in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.0.0)
  Requirement already satisfied: tqdm in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (4.67.1)
  Requirement already satisfied: jsonref in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.1.0)
  Requirement already satisfied: pydantic in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2.10.2)
  Requirement already satisfied: pydantic-core in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2.27.1)
  Requirement already satisfied: pydantic-settings in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2.6.1)
  Requirement already satisfied: pygdbmi>=0.9.0.2 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from esp-coredump->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 13)) (0.11.0.0)
  Requirement already satisfied: bitstring!=4.2.0,>=3.1.6 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from esptool->-r D:\vats\.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 d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from esptool->-r D:\vats\.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 d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from esptool->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (1.7.0)
  Requirement already satisfied: intelhex in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from esptool->-r D:\vats\.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 d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from esp-idf-kconfig->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15)) (14.1.0)
  INFO: pip is looking at multiple versions of esp-idf-kconfig to determine which version is compatible with other requirements. This could take a while.
    Using cached https://dl.espressif.com/pypi/esp-idf-kconfig/esp_idf_kconfig-1.4.2-py3-none-any.whl (44 kB)
    Using cached https://dl.espressif.com/pypi/esp-idf-kconfig/esp_idf_kconfig-1.4.1-py3-none-any.whl (43 kB)
  Requirement already satisfied: rich in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from esp-idf-size->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (13.9.4)
  Requirement already satisfied: bitarray<3.0.0,>=2.9.0 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from bitstring!=4.2.0,>=3.1.6->esptool->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (2.9.3)
  Requirement already satisfied: pycparser in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from cffi>=1.12->cryptography->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (2.22)
  Requirement already satisfied: six>=1.9.0 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from ecdsa>=0.16.0->esptool->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (1.16.0)
  Requirement already satisfied: annotated-types>=0.6.0 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from pydantic->idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (0.7.0)
  Requirement already satisfied: typing-extensions>=4.12.2 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from pydantic->idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (4.12.2)
  Requirement already satisfied: python-dotenv>=0.21.0 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from pydantic-settings->idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.0.1)
  Requirement already satisfied: charset-normalizer<4,>=2 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from requests->idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (3.4.0)
  Requirement already satisfied: idna<4,>=2.5 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from requests->idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (3.10)
  Requirement already satisfied: urllib3<3,>=1.21.1 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from requests->idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.26.20)
  Requirement already satisfied: certifi>=2017.4.17 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from requests->idf-component-manager->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2024.8.30)
  Requirement already satisfied: markdown-it-py>=2.2.0 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from rich->esp-idf-size->-r D:\vats\.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 d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from rich->esp-idf-size->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (2.18.0)
  Requirement already satisfied: mdurl~=0.1 in d:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\lib\site-packages (from markdown-it-py>=2.2.0->rich->esp-idf-size->-r D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (0.1.2)
  Installing collected packages: setuptools
    Attempting uninstall: setuptools
      Found existing installation: setuptools 75.6.0
      Uninstalling setuptools-75.6.0:
        Successfully uninstalled setuptools-75.6.0
  Successfully installed setuptools-71.0.0
  Upgrading pip and setuptools...
  Skipping the download of D:\vats\.embuild\espressif\espidf.constraints.v5.2.txt because it was downloaded recently.
  Installing Python packages
   Constraint file: D:\vats\.embuild\espressif\espidf.constraints.v5.2.txt
   Requirement files:
    - D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt
  cargo:rerun-if-changed=D:\vats\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-esp32s3-espidf = None
  CMAKE_PREFIX_PATH_xtensa_esp32s3_espidf = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_xtensa-esp32s3-espidf = None
  CMAKE_xtensa_esp32s3_espidf = None
  TARGET_CMAKE = None
  CMAKE = None
  running: "cmake" "D:\\vats\\target\\xtensa-esp32s3-espidf\\debug\\build\\esp-idf-sys-bda06fad2065c1fc\\out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=D:\\vats\\.embuild\\espressif\\esp-idf\\v5.2.2\\tools\\cmake\\toolchain-esp32s3.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=D:/vats/.embuild/espressif/python_env/idf5.2_py3.13_env/Scripts/python" "-DCMAKE_INSTALL_PREFIX=D:\\vats\\target\\xtensa-esp32s3-espidf\\debug\\build\\esp-idf-sys-bda06fad2065c1fc\\out" "-DCMAKE_C_FLAGS= -mlongcalls -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy" "-DCMAKE_CXX_FLAGS= -mlongcalls -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 esp32s3
  -- Checking Python dependencies...
  Python requirements are satisfied.
  Constraint file: D:\vats\.embuild\espressif\espidf.constraints.v5.2.txt
  Requirement files:
   - D:\vats\.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt
  Python being checked: D:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\Scripts\python.exe
  -- Project sdkconfig file D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/sdkconfig
  Loading defaults file D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/gen-sdkconfig.defaults...
  D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/gen-sdkconfig.defaults:2 CONFIG_COMPILER_OPTIMIZATION_DEFAULT was replaced with CONFIG_COMPILER_OPTIMIZATION_DEBUG
  Loading defaults file D:/vats/sdkconfig.defaults...
  -- Compiler supported targets: xtensa-esp-elf
  -- App "libespidf" version: 1
  -- Adding linker script D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/build/esp-idf/esp_system/ld/memory.ld
  -- Adding linker script D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/build/esp-idf/esp_system/ld/sections.ld.in
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.version.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/soc/esp32s3/ld/esp32s3.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 touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
  -- Component paths: D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/app_trace D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/app_update D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bootloader D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bootloader_support D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bt D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/cmock D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/console D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/cxx D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/driver D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/efuse D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp-tls D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_adc D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_app_format D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_bootloader_format D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_coex D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_common D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_eth D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_event D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_gdbstub D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_hid D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_http_client D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_http_server D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_https_ota D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_https_server D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_hw_support D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_lcd D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_local_ctrl D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_mm D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_netif D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_netif_stack D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_partition D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_phy D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_pm D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_psram D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_ringbuf D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_system D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_timer D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_wifi D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/espcoredump D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esptool_py D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/fatfs D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/freertos D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/hal D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/heap D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/http_parser D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/idf_test D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/ieee802154 D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/json D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/log D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/lwip D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/main D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/mbedtls D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/mqtt D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/newlib D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/nvs_flash D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/nvs_sec_provider D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/openthread D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/partition_table D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/perfmon D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/protobuf-c D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/protocomm D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/pthread D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/sdmmc D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/soc D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/spi_flash D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/spiffs D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/tcp_transport D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/touch_element D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/ulp D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/unity D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/usb D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/vfs D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/wear_levelling D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/wifi_provisioning D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/wpa_supplicant D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/xtensa
  -- Configuring done
  -- Generating done
  -- Build files have been written to: D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/build
  running: "cmake" "--build" "D:\\vats\\target\\xtensa-esp32s3-espidf\\debug\\build\\esp-idf-sys-bda06fad2065c1fc\\out\\build" "--config" "MinSizeRel" "--parallel" "4"
  [1/7] Performing build step for 'bootloader'
  -- Building ESP-IDF components for target esp32s3
  -- Project sdkconfig file D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/sdkconfig
  -- Compiler supported targets: xtensa-esp-elf
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/soc/esp32s3/ld/esp32s3.peripherals.ld
  -- Bootloader project name: "bootloader" version: 1
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld
  -- Adding linker script D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/main/ld/esp32s3/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: D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bootloader D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bootloader_support D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/efuse D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_app_format D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_bootloader_format D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_common D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_hw_support D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esp_system D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/esptool_py D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/freertos D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/hal D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/log D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/main D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/components/micro-ecc D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/newlib D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/partition_table D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/soc D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/spi_flash D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/xtensa
  -- Configuring done
  -- Generating done
  -- Build files have been written to: D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/build/bootloader
  [0/1] Re-running CMake...
  [1/1] cmd.exe /C "cd /D D:\vats\target\xtensa-esp32s3-espidf\debug\build\esp-idf-sys-bda06fad2065c1fc\out\build\bootloader\esp-idf\esptool_py && D:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\Scripts\python D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/build/bootloader/bootloader.bin"
  Bootloader binary size 0x5250 bytes. 0x2db0 bytes (36%) free.
  [2/5] Generating ld/sections.ld
  [3/5] Linking CXX executable libespidf.elf
  [4/5] Generating binary image from built executable
  esptool.py v4.8.1
  Creating esp32s3 image...
  Merged 2 ELF sections
  Successfully created esp32s3 image.
  Generated D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/build/libespidf.bin
  [5/5] cmd.exe /C "cd /D D:\vats\target\xtensa-esp32s3-espidf\debug\build\esp-idf-sys-bda06fad2065c1fc\out\build\esp-idf\esptool_py && D:\vats\.embuild\espressif\python_env\idf5.2_py3.13_env\Scripts\python D:/vats/.embuild/espressif/esp-idf/v5.2.2/components/partition_table/check_sizes.py --offset 0x8000 partition --type app D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/build/partition_table/partition-table.bin D:/vats/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-bda06fad2065c1fc/out/build/libespidf.bin"
  libespidf.bin binary size 0x32900 bytes. Smallest app partition is 0x100000 bytes. 0xcd700 bytes (80%) free.
  cargo:root=D:\vats\target\xtensa-esp32s3-espidf\debug\build\esp-idf-sys-bda06fad2065c1fc\out
  cargo:rerun-if-changed=C:\Users\Dmitrij\.cargo\registry\src\index.crates.io-6f17d22bba15001f\esp-idf-sys-0.35.0\src\include\esp-idf\bindings.h
  cargo:rustc-env=EMBUILD_GENERATED_BINDINGS_FILE=D:\vats\target\xtensa-esp32s3-espidf\debug\build\esp-idf-sys-bda06fad2065c1fc\out\bindings.rs

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: None,
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: None,
      mcu: Some(
          "esp32s3",
      ),
      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 'D:\vats\.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, touch_element, ulp, usb, wifi_provisioning, main
  thread 'main' panicked at C:\Users\Dmitrij\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bindgen-0.69.5\lib.rs:622:31:
  Unable to find libclang: "the `libclang` shared library at C:\\Users\\Dmitrij\\.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

I have all dependencies installed and using the unmodified generated template with correct options on the correct board (ESP32-S3).

Does anyone have any ideas? I am stuck.

@SergioGasquez
Copy link
Member

Hi!

Have you checked that C:\\Users\\Dmitrij\\.rustup\\toolchains\\esp\\xtensa-esp32-elf-clang\\esp-clang\\bin\\libclang.dll exists?? It should be there if the espup command succeeded, but just to verify.

@FssAy
Copy link
Author

FssAy commented Nov 29, 2024

Hi!

Have you checked that C:\\Users\\Dmitrij\\.rustup\\toolchains\\esp\\xtensa-esp32-elf-clang\\esp-clang\\bin\\libclang.dll exists?? It should be there if the espup command succeeded, but just to verify.

Yes, it exists:

The path to the file is correct, the file exists and is not corrupted.

@FssAy
Copy link
Author

FssAy commented Nov 29, 2024

I traced back the issue to the bindgen crate. Especially the ensure_libclang_is_loaded function in lib.rs. It fails on

clang_sys::load().expect("Unable to find libclang");

But when I run this function manually in a dummy project it loads without any issues, so it's not a problem with my configuration or setup I guess. At this point I have no clue what is going on.

@FssAy
Copy link
Author

FssAy commented Nov 30, 2024

Fixed by downgrading to a lower espup version.

esp-rs/espup#440

@FssAy FssAy closed this as completed Nov 30, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants