espressif / vscode-esp-idf-extension

Visual Studio Code extension for ESP-IDF projects
Apache License 2.0
1.05k stars 301 forks source link

CMD encounters unexpected UNC paths (VSC-1192) #1045

Open ELNL opened 1 year ago

ELNL commented 1 year ago

OS

Windows

Operating System version

windows 10

Visual Studio Code version

1.82.2

ESP-IDF version

1.6.4

Python version

3.11.2

Doctor command output

---------------------------------------------- ESP-IDF Extension for Visual Studio Code report --------------------------------------------- OS win32 x64 10.0.19045 System environment variable IDF_PYTHON_ENV_PATH undefined System environment variable PATH C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Exact Software\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\AppData\Local\Microsoft\WindowsApps;C:\AppData\Local\Programs\Microsoft VS Code\bin System environment variable PYTHON undefined Visual Studio Code version 1.82.2 Visual Studio Code language en Visual Studio Code shell C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe ESP-IDF Extension version 1.6.4 Workspace folder v:\EmbeddedProjects\lvgl_test ---------------------------------------------------- Extension configuration settings ------------------------------------------------------ ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH} ESP-IDF Path (idf.espIdfPath) v:\ESP-IDF-Container\esp-idf ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH} ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH} Custom extra paths (idf.customExtraPaths) v:\ESP-IDF-Tools\tools\xtensa-esp-elf-gdb\12.1_20221002\xtensa-esp-elf-gdb\bin;v:\ESP-IDF-Tools\tools\riscv32-esp-elf-gdb\12.1_20221002\riscv32-esp-elf-gdb\bin;v:\ESP-IDF-Tools\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin;v:\ESP-IDF-Tools\tools\xtensa-esp32s2-elf\esp-12.2.0_20230208\xtensa-esp32s2-elf\bin;v:\ESP-IDF-Tools\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin;v:\ESP-IDF-Tools\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin;v:\ESP-IDF-Tools\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;v:\ESP-IDF-Tools\tools\cmake\3.24.0\bin;v:\ESP-IDF-Tools\tools\openocd-esp32\v0.12.0-esp32-20230419\openocd-esp32\bin;v:\ESP-IDF-Tools\tools\ninja\1.10.2;v:\ESP-IDF-Tools\tools\idf-exe\1.0.3;v:\ESP-IDF-Tools\tools\ccache\4.8\ccache-4.8-windows-x86_64;v:\ESP-IDF-Tools\tools\dfu-util\0.11\dfu-util-0.11-win64;v:\ESP-IDF-Tools\tools\esp-rom-elfs\20230320 Custom extra vars (idf.customExtraVars) OPENOCD_SCRIPTS: v:\ESP-IDF-Tools\tools\openocd-esp32\v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts IDF_CCACHE_ENABLE: 1 ESP_ROM_ELF_DIR: v:\ESP-IDF-Tools\tools\esp-rom-elfs\20230320/ Virtual env Python Path (idf.pythonBinPath) v:\ESP-IDF-Tools\python_env\idf5.1_py3.11_env\Scripts\python.exe Serial port (idf.port) COM1 OpenOCD Configs (idf.openOcdConfigs) interface/ftdi/esp32_devkitj_v1.cfg,target/esp32s3.cfg ESP-IDF Tools Path (idf.toolsPath) v:\ESP-IDF-Tools Git Path (idf.gitPath) v:\ESP-IDF-Tools\tools\idf-git\2.39.2\cmd\git.exe -------------------------------------------------------- Configurations access ------------------------------------------------------------- Access to ESP-ADF Path (idf.espAdfPath) false Access to ESP-IDF Path (idf.espIdfPath) true Access to ESP-MDF Path (idf.espMdfPath) false Access to ESP-Matter Path (idf.espMatterPath) false Access to ESP-IDF Custom extra paths Access to v:\ESP-IDF-Tools\tools\xtensa-esp-elf-gdb\12.1_20221002\xtensa-esp-elf-gdb\bin: true Access to v:\ESP-IDF-Tools\tools\riscv32-esp-elf-gdb\12.1_20221002\riscv32-esp-elf-gdb\bin: true Access to v:\ESP-IDF-Tools\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin: true Access to v:\ESP-IDF-Tools\tools\xtensa-esp32s2-elf\esp-12.2.0_20230208\xtensa-esp32s2-elf\bin: true Access to v:\ESP-IDF-Tools\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin: true Access to v:\ESP-IDF-Tools\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin: true Access to v:\ESP-IDF-Tools\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: true Access to v:\ESP-IDF-Tools\tools\cmake\3.24.0\bin: true Access to v:\ESP-IDF-Tools\tools\openocd-esp32\v0.12.0-esp32-20230419\openocd-esp32\bin: true Access to v:\ESP-IDF-Tools\tools\ninja\1.10.2: true Access to v:\ESP-IDF-Tools\tools\idf-exe\1.0.3: true Access to v:\ESP-IDF-Tools\tools\ccache\4.8\ccache-4.8-windows-x86_64: true Access to v:\ESP-IDF-Tools\tools\dfu-util\0.11\dfu-util-0.11-win64: true Access to v:\ESP-IDF-Tools\tools\esp-rom-elfs\20230320: true Access to Virtual env Python Path (idf.pythonBinPath) true Access to CMake in environment PATH undefined Access to Ninja in environment PATH undefined Access to ESP-IDF Tools Path (idf.toolsPath) true -------------------------------------------------------- Configurations has spaces ------------------------------------------------------------- Spaces in system environment Path true Spaces in ESP-ADF Path (idf.espAdfPath) false Spaces in ESP-IDF Path (idf.espIdfPath) false Spaces in ESP-MDF Path (idf.espMdfPath) false Spaces in ESP-Matter Path (idf.espMatterPath) false Spaces in ESP-IDF Custom extra paths Spaces in v:\ESP-IDF-Tools\tools\xtensa-esp-elf-gdb\12.1_20221002\xtensa-esp-elf-gdb\bin: false Spaces in v:\ESP-IDF-Tools\tools\riscv32-esp-elf-gdb\12.1_20221002\riscv32-esp-elf-gdb\bin: false Spaces in v:\ESP-IDF-Tools\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin: false Spaces in v:\ESP-IDF-Tools\tools\xtensa-esp32s2-elf\esp-12.2.0_20230208\xtensa-esp32s2-elf\bin: false Spaces in v:\ESP-IDF-Tools\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin: false Spaces in v:\ESP-IDF-Tools\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin: false Spaces in v:\ESP-IDF-Tools\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: false Spaces in v:\ESP-IDF-Tools\tools\cmake\3.24.0\bin: false Spaces in v:\ESP-IDF-Tools\tools\openocd-esp32\v0.12.0-esp32-20230419\openocd-esp32\bin: false Spaces in v:\ESP-IDF-Tools\tools\ninja\1.10.2: false Spaces in v:\ESP-IDF-Tools\tools\idf-exe\1.0.3: false Spaces in v:\ESP-IDF-Tools\tools\ccache\4.8\ccache-4.8-windows-x86_64: false Spaces in v:\ESP-IDF-Tools\tools\dfu-util\0.11\dfu-util-0.11-win64: false Spaces in v:\ESP-IDF-Tools\tools\esp-rom-elfs\20230320: false Spaces in Virtual env Python Path (idf.pythonBinPath) false Spaces in ESP-IDF Tools Path (idf.toolsPath) false ----------------------------------------------------------- Executables Versions ----------------------------------------------------------- Git version 2.39.2.windows.1 ESP-IDF version 5.1.1 Python version 3.11.2 Python's pip version 23.2.1 -------------------------------------------------- Project configuration settings ---------------------------------------------------------- -------------------------------------------------- Python packages in idf.pythonBinPath ---------------------------------------------------- bitarray version: 2.8.1 bitstring version: 4.1.2 CacheControl version: 0.13.1 certifi version: 2023.7.22 cffi version: 1.15.1 charset-normalizer version: 3.2.0 click version: 8.0.4 colorama version: 0.4.6 construct version: 2.10.68 contextlib2 version: 21.6.0 cryptography version: 39.0.2 ecdsa version: 0.18.0 esp-coredump version: 1.7.0 esp-debug-backend version: 1.0.3 esp-idf-kconfig version: 1.2.0 esp-idf-monitor version: 1.2.1 esp-idf-panic-decoder version: 0.1.0 esp-idf-size version: 0.4.2 esptool version: 4.7.dev1 filelock version: 3.12.4 freertos-gdb version: 1.0.2 gcovr version: 6.0 idf-component-manager version: 1.4.0 idna version: 3.4 Jinja2 version: 3.0.3 kconfiglib version: 14.1.0 lxml version: 4.9.3 MarkupSafe version: 2.1.3 msgpack version: 1.0.5 packaging version: 23.1 pip version: 23.2.1 pycparser version: 2.21 pyelftools version: 0.29 pygdbmi version: 0.9.0.2 Pygments version: 2.16.1 pyparsing version: 3.0.9 pyserial version: 3.5 pywin32 version: 306 PyYAML version: 6.0.1 reedsolo version: 1.7.0 requests version: 2.31.0 requests-file version: 1.5.1 requests-toolbelt version: 1.0.0 schema version: 0.7.5 setuptools version: 68.2.2 six version: 1.16.0 tqdm version: 4.66.1 urllib3 version: 1.26.16 websocket-client version: 1.6.3 ---------------------------------------------------- Check ESP-IDF python requirements.txt ------------------------------------------------- Check ESP-IDF Python packages Python requirements are satisfied. ---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------ Check Extension Python packages Python requirements are satisfied. ---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------ Check Debug AdapterPython packages Python requirements are satisfied. ---------------------------------------------------- Visual Studio Code launch.json -------------------------------------------------------- { "version": "0.2.0", "configurations": [ { "type": "espidf", "name": "Launch", "request": "launch" } ] } ---------------------------------------------------- Visual Studio Code c_cpp_properties.json ---------------------------------------------- { "configurations": [ { "name": "ESP-IDF", "compilerPath": "v:\ESP-IDF-Tools\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe", "includePath": [ "${config:idf.espIdfPath}/components/", "${config:idf.espIdfPathWin}/components/", "${config:idf.espAdfPath}/components/", "${config:idf.espAdfPathWin}/components/", "${workspaceFolder}/" ], "browse": { "path": [ "${config:idf.espIdfPath}/components", "${config:idf.espIdfPathWin}/components", "${config:idf.espAdfPath}/components/", "${config:idf.espAdfPathWin}/components/**", "${workspaceFolder}" ], "limitSymbolsToIncludedHeaders": false } } ], "version": 4 }


Extension

esp_idf_vsc_ext.log

Description

Buiding app does not succeed. Unexpected somewere in the proces UNC filepaths occur.

Debug Message

AILED: esp-idf/esp_system/ld/memory.ld //EL-WIN10/VisualStudioCode/EmbeddedProjects/lvgl_test/build/esp-idf/esp_system/ld/memory.ld 
cmd.exe /C "cd /D \\EL-WIN10\VisualStudioCode\EmbeddedProjects\lvgl_test\build\esp-idf\esp_system && V:\ESP-IDF-Tools\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin\xtensa-esp32s3-elf-gcc.exe -C -P -x c -E -o //EL-WIN10/VisualStudioCode/EmbeddedProjects/lvgl_test/build/esp-idf/esp_system/ld/memory.ld -I //EL-WIN10/VisualStudioCode/EmbeddedProjects/lvgl_test/build/config -I V:/ESP-IDF-Container/esp-idf/components/esp_system/ld V:/ESP-IDF-Container/esp-idf/components/esp_system/ld/esp32s3/memory.ld.in"
'\\EL-WIN10\VisualStudioCode\EmbeddedProjects\lvgl_test\build\esp-idf\esp_system'
CMD does not support UNC paths as current directories.
ninja: build stopped: subcommand failed.

Other Steps to Reproduce

Install VSC. Install ESP-IDF Create project hello_world

Full Clean

Then the build system interprets some paths as UNC paths.

The system is completely installed on a mapped drive V: Alle paths are accessible with regular paths starting with V:. But somehow UNC paths are introduced. (The current computer name is EL-WIN10)

I have checked existing issues, online documentation and the Troubleshooting Guide

georgik commented 1 year ago

UNC paths are not supported. The problem is not only in CMD, but also in other tools like CMake, Git or CCache. They does not work well with UNC or long paths - see limitation: https://github.com/espressif/idf-installer/issues/103

One possible workaround is to use subst command to map long path to new drive letter:

subst "R:" "my_super_long_path"
ELNL commented 1 year ago

Thank you this response @georgik . To shorten the paths I already used a 'drive mapping' in Windows 10, using the Windows UI. I am not sure is 'subst' works the same way. I will try this. (It will take a few weeks perhaps to do it...)

github-actions[bot] commented 12 months ago

This issue has been marked as stale since there are no activities, and this will be closed in 5 days if there are no further activities

arantius commented 2 weeks ago

I still have exactly this problem. I can build the project (just "hello world" example for now), but I can't run menuconfig. My project is already on a mapped drive, and that's the path I gave when creating the project. But when I try to menuconfig, it uses the UNC path equivalent, instead of the drive letter.

arantius commented 2 weeks ago

Actually, as soon as I've tried to do menuconfig, I can't build anymore for the same UNC path error. If I create a new project and never try to menuconfig it then I can build all I like.

brianignacio5 commented 12 hours ago

It might be related to some default settings that are resolving ${workspaceFolder} to the real project path instead of the mapped location. For example, try this vsix installer and set idf.buildPathWin and idf.sdkconfigFilePath in <your project>\.vscode\settings.json to build and sdkconfig paths using the mapped drive.