esp-rs/esp-idf-hal

Cannot open libclang.dll, LoadLibraryExW failed

MiniMinerX opened this issue · 4 comments

I have followed all the installation instructions, making sure my enviornment variables are set and correct. I cannot build because the .dll file is not being opened and I do not know why. I've treid working at this for hours now with not much online to help. Here is my tomls: [package]
name = "espt12"
version = "0.1.0"
authors = ["MiniMinerX jessehrupe@gmail.com"]
edition = "2021"
resolver = "2"
rust-version = "1.79"

[[bin]]
name = "espt12"
harness = false # do not use the built in cargo test harness -> resolve rust-analyzer errors

[profile.release]
opt-level = "s"

[profile.dev]
debug = true # Symbols are nice and they don't increase the size on Flash
opt-level = "z"

[features]
default = ["std", "embassy", "esp-idf-svc/native"]

pio = ["esp-idf-svc/pio"]
std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"]
alloc = ["esp-idf-svc/alloc"]
nightly = ["esp-idf-svc/nightly"]
experimental = ["esp-idf-svc/experimental"]
embassy = ["esp-idf-svc/embassy-sync", "esp-idf-svc/critical-section", "esp-idf-svc/embassy-time-driver"]

[dependencies]
log = { version = "0.4", default-features = false }
esp-idf-svc = { version = "0.49", default-features = false }

[build-dependencies]
embuild = "0.32.0" and then this toml: [toolchain]
channel = "esp" and then finally: [build]
target = "xtensa-esp32-espidf"

[target.xtensa-esp32-espidf]
linker = "ldproxy"
runner = "espflash flash --monitor" # Select this runner for espflash v3.x.x
rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: esp-rs/rust#110

[unstable]
build-std = ["std", "panic_abort"]

[env]
MCU="esp32"
RUST_BACKTRACE = "full"

Note: this variable is not used by the pio builder (cargo build --features pio)

ESP_IDF_VERSION = "v5.2.2"

Workaround for esp-rs/esp-idf-template#174

CRATE_CC_NO_DEFAULTS = "1"

I ran these commands in the terminal to source the paths: > $Env:LIBCLANG_PATH = "C:\Users\minim.rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang\bin\libclang.dll"

$Env:PATH = "C:\Users\minim.rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang\bin;" + $Env:PATH
$Env:PATH = "C:\Users\minim.rustup\toolchains\esp\xtensa-esp-elf\bin;" + $Env:PATH
PS C:\espt12>

Here is my output after doing cargo build --release

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

PS C:\espt12> cargo build --release
Compiling bindgen v0.69.4
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 espt12 v0.1.0 (C:\espt12)
The following warnings were emitted during compilation:

warning: esp-idf-sys@0.35.0: 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: esp-idf-sys@0.35.0: 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: C:\espt12\target\release\build\esp-idf-sys-b6269cda32b60966\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.12.4
pip 24.1.2 from C:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\Lib\site-packages\pip (python 3.12)
Requirement already satisfied: pip in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (24.1.2)
Requirement already satisfied: setuptools in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (71.0.0)
Collecting setuptools
Using cached setuptools-71.1.0-py3-none-any.whl.metadata (6.6 kB)
Using cached setuptools-71.1.0-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.1.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 C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 4)) (24.1)
Requirement already satisfied: click in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 7)) (8.1.7)
Requirement already satisfied: pyserial in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 8)) (3.5)
Requirement already satisfied: cryptography in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (41.0.7)
Requirement already satisfied: pyparsing in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 10)) (3.1.2)
Requirement already satisfied: pyelftools in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 11)) (0.31)
Requirement already satisfied: idf-component-manager in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.5.3)
Requirement already satisfied: esp-coredump in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 13)) (1.11.0)
Requirement already satisfied: esptool in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (4.7.0)
Requirement already satisfied: esp-idf-kconfig in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15)) (1.4.2)
Requirement already satisfied: esp-idf-monitor in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 16)) (1.4.0)
Requirement already satisfied: esp-idf-size in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 18)) (1.1.0)
Requirement already satisfied: pyclang in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 19)) (0.4.2)
Requirement already satisfied: construct in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 20)) (2.10.70)
Requirement already satisfied: freertos_gdb in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from -r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 23)) (1.0.3)
Requirement already satisfied: colorama in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from click->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 7)) (0.4.6)
Requirement already satisfied: cffi>=1.12 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from cryptography->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (1.16.0)
Requirement already satisfied: requests<3 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (2.32.3)
Requirement already satisfied: urllib3<2 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.26.19)
Requirement already satisfied: requests-file<2 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.5.1)
Requirement already satisfied: requests-toolbelt in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (0.7.5)
Requirement already satisfied: six in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (1.16.0)
Requirement already satisfied: tqdm<5 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (4.66.4)
Requirement already satisfied: pyyaml>5.2 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.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 c:\espt12.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 C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from idf-component-manager->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esp-coredump->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esptool->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esptool->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esptool->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 14)) (1.7.0)
Requirement already satisfied: intelhex in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esptool->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esp-idf-kconfig->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15)) (14.1.0)
Requirement already satisfied: windows-curses in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esp-idf-kconfig->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 15)) (2.3.3)
Requirement already satisfied: rich in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from esp-idf-size->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from bitstring>=3.1.6->esptool->-r C:\espt12.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 c:\espt12.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 C:\espt12.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 c:\espt12.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 C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (3.15.4)
Requirement already satisfied: pycparser in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from cffi>=1.12->cryptography->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 9)) (2.22)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from requests<3->idf-component-manager->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from requests<3->idf-component-manager->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 12)) (3.7)
Requirement already satisfied: certifi>=2017.4.17 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from requests<3->idf-component-manager->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from rich->esp-idf-size->-r C:\espt12.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 c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from rich->esp-idf-size->-r C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt (line 17)) (2.18.0)
Requirement already satisfied: mdurl~=0.1 in c:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\lib\site-packages (from markdown-it-py>=2.2.0->rich->esp-idf-size->-r C:\espt12.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 71.1.0
Uninstalling setuptools-71.1.0:
Successfully uninstalled setuptools-71.1.0
Successfully installed setuptools-71.0.0
Upgrading pip and setuptools...
Skipping the download of C:\espt12.embuild\espressif\espidf.constraints.v5.2.txt because it was downloaded recently.
Installing Python packages
Constraint file: C:\espt12.embuild\espressif\espidf.constraints.v5.2.txt
Requirement files:
- C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt
cargo:rerun-if-changed=C:\espt12\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 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" "C:\espt12\target\xtensa-esp32-espidf\release\build\esp-idf-sys-a5fb95e86f32cad3\out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=C:\espt12\.embuild\espressif\esp-idf\v5.2.2\tools\cmake\toolchain-esp32.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=C:/espt12/.embuild/espressif/python_env/idf5.2_py3.12_env/Scripts/python" "-DCMAKE_INSTALL_PREFIX=C:\espt12\target\xtensa-esp32-espidf\release\build\esp-idf-sys-a5fb95e86f32cad3\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: C:\espt12.embuild\espressif\espidf.constraints.v5.2.txt
Requirement files:

  • C:\espt12.embuild\espressif\esp-idf\v5.2.2\tools\requirements\requirements.core.txt
    Python being checked: C:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\Scripts\python.exe
    -- Project sdkconfig file C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/sdkconfig
    Loading defaults file C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/gen-sdkconfig.defaults...
    C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/gen-sdkconfig.defaults:2 CONFIG_COMPILER_OPTIMIZATION_DEFAULT was replaced with CONFIG_COMPILER_OPTIMIZATION_DEBUG
    Loading defaults file C:/espt12/sdkconfig.defaults...
    -- Compiler supported targets: xtensa-esp-elf
    -- App "libespidf" version: 1
    -- Adding linker script C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/build/esp-idf/esp_system/ld/memory.ld
    -- Adding linker script C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/build/esp-idf/esp_system/ld/sections.ld.in
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.api.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
    -- Adding linker script C:/espt12/.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: C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/app_trace C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/app_update C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/bootloader C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/bootloader_support C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/bt C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/cmock C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/console C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/cxx C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/driver C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/efuse C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp-tls C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_adc C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_app_format C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_bootloader_format C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_coex C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_common C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_eth C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_event C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_gdbstub C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_hid C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_http_client C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_http_server C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_https_ota C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_https_server C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_hw_support C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_lcd C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_local_ctrl C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_mm C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_netif C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_netif_stack C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_partition C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_phy C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_pm C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_psram C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_ringbuf C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_system C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_timer C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_wifi C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/espcoredump C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esptool_py C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/fatfs C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/freertos C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/hal C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/heap C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/http_parser C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/idf_test C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/ieee802154 C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/json C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/log C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/lwip C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/main C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/mbedtls C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/mqtt C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/newlib C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/nvs_flash C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/nvs_sec_provider C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/openthread C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/partition_table C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/perfmon C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/protobuf-c C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/protocomm C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/pthread C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/sdmmc C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/soc C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/spi_flash C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/spiffs C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/tcp_transport C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/ulp C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/unity C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/usb C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/vfs C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/wear_levelling C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/wifi_provisioning C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/wpa_supplicant C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/xtensa
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/build
    running: "cmake" "--build" "." "--config" "MinSizeRel" "--parallel" "32"
    [1/7] Generating ld/sections.ld
    [2/7] Linking CXX executable libespidf.elf
    [3/7] Generating binary image from built executable
    esptool.py v4.7.0
    Creating esp32 image...
    Merged 2 ELF sections
    Successfully created esp32 image.
    Generated C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/build/libespidf.bin
    [4/7] cmd.exe /C "cd /D C:\espt12\target\xtensa-esp32-espidf\release\build\esp-idf-sys-a5fb95e86f32cad3\out\build\esp-idf\esptool_py && C:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\Scripts\python C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/partition_table/check_sizes.py --offset 0x8000 partition --type app C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/build/partition_table/partition-table.bin C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/build/libespidf.bin"
    libespidf.bin binary size 0x27930 bytes. Smallest app partition is 0x100000 bytes. 0xd86d0 bytes (85%) free.
    [5/7] Performing build step for 'bootloader'
    -- Building ESP-IDF components for target esp32
    -- Project sdkconfig file C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/sdkconfig
    -- Compiler supported targets: xtensa-esp-elf
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/soc/esp32/ld/esp32.peripherals.ld
    -- Bootloader project name: "bootloader" version: 1
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.api.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
    -- Adding linker script C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/main/ld/esp32/bootloader.ld
    -- Adding linker script C:/espt12/.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: C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/bootloader C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/bootloader_support C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/efuse C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_app_format C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_bootloader_format C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_common C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_hw_support C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_rom C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esp_system C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/esptool_py C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/freertos C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/hal C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/log C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/main C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/bootloader/subproject/components/micro-ecc C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/newlib C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/partition_table C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/soc C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/spi_flash C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/xtensa
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/build/bootloader
    [0/1] Re-running CMake...
    [1/1] cmd.exe /C "cd /D C:\espt12\target\xtensa-esp32-espidf\release\build\esp-idf-sys-a5fb95e86f32cad3\out\build\bootloader\esp-idf\esptool_py && C:\espt12.embuild\espressif\python_env\idf5.2_py3.12_env\Scripts\python C:/espt12/.embuild/espressif/esp-idf/v5.2.2/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 C:/espt12/target/xtensa-esp32-espidf/release/build/esp-idf-sys-a5fb95e86f32cad3/out/build/bootloader/bootloader.bin"
    Bootloader binary size 0x6860 bytes. 0x7a0 bytes (7%) free.
    cargo:root=C:\espt12\target\xtensa-esp32-espidf\release\build\esp-idf-sys-a5fb95e86f32cad3\out
    cargo:rerun-if-changed=C:\Users\minim.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=C:\espt12\target\xtensa-esp32-espidf\release\build\esp-idf-sys-a5fb95e86f32cad3\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 'C:\espt12.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\minim.cargo\registry\src\index.crates.io-6f17d22bba15001f\bindgen-0.69.4\lib.rs:622:31:
Unable to find libclang: "the libclang shared library at C:\Users\minim\.rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang\bin\libclang.dll could not be opened: LoadLibraryExW failed"
stack backtrace:
0: 0x7ff683a94ffb - std::backtrace_rs::backtrace::trace_unsynchronized::h46a05f2575fa14d7
1: 0x7ff683a967b1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9f0fdb41129a842b
2: 0x7ff683acd01a - core::fmt::write::h9e11dfc6d17d1c07
3: 0x7ff683abb621 - std::io::Write::write_fmt::h33efa9e475fc91de
4: 0x7ff683a9658f - std::process::exit::h5e3cc61667c84915
5: 0x7ff683a976ca - std::panicking::default_hook::hf90ac8f8a78f6f7b
6: 0x7ff683a97353 - std::panicking::default_hook::hf90ac8f8a78f6f7b
7: 0x7ff683a98218 - std::panicking::rust_panic_with_hook::h62023a0c4fd17305
8: 0x7ff683a980f7 - <std::panicking::begin_panic_handler::StaticStrPayload as core::panic::PanicPayload>::take_box::h7d0d2bfc46d23547
9: 0x7ff683a96c6f - std::sys_common::backtrace::__rust_begin_short_backtrace::hde6d43922da5914c
10: 0x7ff683a97e18 - rust_begin_unwind
11: 0x7ff683adc1b4 - core::panicking::panic_fmt::hc019ac27196d215d
12: 0x7ff683adc7b0 - core::result::unwrap_failed::h6552edba637263b2
13: 0x7ff6834bf604 - core::result::Result<T,E>::expect::hb3309c3a1c3c3291
14: 0x7ff6834752bc - core::ops::function::FnOnce::call_once::h5d7cdaa71849ee6d
15: 0x7ff6834f7c3b - lazy_static::lazy::Lazy::get::{{closure}}::h703506b50d675ab2
16: 0x7ff683517c40 - std::sync::once::Once::call_once::{{closure}}::hb294324ebc6a8bd5
17: 0x7ff683adb3b4 - std::sys::sync::once::queue::Once::call::h6b6b7976e380e78c
18: 0x7ff683517ae0 - std::sync::once::Once::call_once::hc09c69e5243b26ad
19: 0x7ff683515ff4 - <bindgen::ensure_libclang_is_loaded::LIBCLANG as core::ops::deref::Deref>::deref::h7a23bd74ad345d54
20: 0x7ff68350ece9 - bindgen::deprecated_target_diagnostic::hf7152a9482ceb835
21: 0x7ff68350fdbe - <bindgen::BindgenError as core::fmt::Display>::fmt::h3e8cdbf0341aa52e
22: 0x7ff68350e3c9 - bindgen::Builder::generate::h1c3ad78b548d2a94
23: 0x7ff68318671c - <build_script_build::BindgenCallbacks as bindgen::callbacks::ParseCallbacks>::int_macro::{{closure}}::ha64a0ff38e86e3d0
24: 0x7ff6831b2696 - core::ops::function::FnOnce::call_once::h6d0f87376d070dbb
25: 0x7ff6831e5779 - std::sys_common::backtrace::__rust_begin_short_backtrace::he5abf919a1dafae7
26: 0x7ff6831a5a2c - std::rt::lang_start::{{closure}}::h832a9944a0b32cb9
27: 0x7ff683a97afe - std::panicking::try::h224dfc5b82599353
28: 0x7ff683aa7f4e - std::rt::lang_start_internal::h243ea0028ca15fb1
29: 0x7ff6831a5a07 - std::rt::lang_start::h01c8cabd9d0af738
30: 0x7ff683188ba9 - main
31: 0x7ff683ad9650 - invoke_main
at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
32: 0x7ff683ad9650 - __scrt_common_main_seh
at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
33: 0x7ffc39f8257d - BaseThreadInitThunk
34: 0x7ffc3b1eaf28 - RtlUserThreadStart
PS C:\espt12>,

That may be a espup problem. We have similar reports from other uses and they could resolve it by downgrading to espup version 11 and installing the toolchain with that espup version. There is an open issue here

That makes sense. I'll try that today. For now I gave up on rancid windows and am running Ubuntu inside of vmware workstation. The Linux setup of esp32 for me was a breeze, so I've been developing on that. I also tried wsl, but my esp32 needed the ch341 drivers, so I had to recompile the wsl kernel with them enabled. Then I broke wsl usbipd for good it seems, so vmware is my savior.

That makes sense. I'll try that today. For now I gave up on rancid windows and am running Ubuntu inside of vmware workstation. The Linux setup of esp32 for me was a breeze, so I've been developing on that. I also tried wsl, but my esp32 needed the ch341 drivers, so I had to recompile the wsl kernel with them enabled. Then I broke wsl usbipd for good it seems, so vmware is my savior.

When I used to work with WSL, I used to do all development from Linux, but then for flashing I just copied the resulting ELF to the Windows partition and then used the espflash utility natively compiled for Windows (with cargo install espflash). This way I did not have to deal with obscure usb drivers on the Linux level.

If I remember correctly, I think you can call native windows binaries from the Linux shell, so with some bash scripting you can further automate calling the Windows-compiled espflash from WSL.