espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.33k stars 7.2k forks source link

Unable to build on Windows if one of the path folders has a space in it (IDFGH-12841) #13807

Open KodeZ opened 3 months ago

KodeZ commented 3 months ago

Answers checklist.

IDF version.

esp-idf-v5.2.1.zip

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

PowerShell

What is the expected behavior?

It should build properly

What is the actual behavior?

It complains about access rights

Steps to reproduce.

  1. Create a blink example project. Make the folder have a space in the name
  2. Build

Build or installation Logs.

*  Executing task: C:\Users\morga\.espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\morga\esp\v5.2.1\esp-idf\tools\idf_size.py c:\Users\morga\esp projects\blink example\blink\build\blink.map 

usage: esp_idf_size [-h] [--format {text,csv,json}] [--archives] [--archive_details ARCHIVE_DETAILS] [--files] [--target TARGET] [--diff ANOTHER_MAP_FILE] [-o OUTPUT_FILE] map_file
esp_idf_size: error: argument map_file: can't open 'c:\Users\morga\esp': [Errno 13] Permission denied: 'c:\\Users\\morga\\esp'

 *  The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command C:\Users\morga\.espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\morga\esp\v5.2.1\esp-idf\tools\idf_size.py c:\Users\morga\esp projects\blink example\blink\build\blink.map" terminated with exit code: 1.

More Information.

Tried running the command manually, but adding hyphens around the last parameter, and that works fine.

fhrbata commented 3 months ago

Hello,

it looks like the VSC plugin should quote the args while calling idf_size.py. Maybe here https://github.com/espressif/vscode-esp-idf-extension/blob/master/src/espIdf/size/idfSizeTask.ts#L56, but I'm not familiar with the code, so I for sure can be missing something. Thank you