espressif / vscode-esp-idf-extension

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

idf.postBuildTask not working in v1.8.0 (VSC-1425) #1244

Open policeman0077 opened 1 week ago

policeman0077 commented 1 week ago

OS

Windows

Operating System version

win11

Visual Studio Code version

1.91.0

ESP-IDF version

4.4.5

Python version

3.11.6

Doctor command output

---------------------------------------------- ESP-IDF Extension for Visual Studio Code report --------------------------------------------- OS win32 x64 10.0.22631 System environment variable IDF_PYTHON_ENV_PATH undefined System environment variable PATH C:\Python311\Scripts\;C:\Python311\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\ProgramData\chocolatey\bin;C:\Program Files\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\qemu;C:\mingw64\bin;C:\Program Files\Meld\;C:\Program Files\ffmpeg-2024-02-04-git-7375a6ca7b-essentials_build\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:.cargo\bin;C:\Program Files\SEGGER\JLink;C:\AppData\Local\Programs\Python\Python39\;C:\AppData\Local\Microsoft\WindowsApps;C:\AppData\Roaming\Python\Python311\Scripts;C:.dotnet\tools;C:\AppData\Local\Programs\Microsoft VS Code\bin; System environment variable PYTHON undefined Visual Studio Code version 1.91.0 Visual Studio Code language en Visual Studio Code shell C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ESP-IDF Extension version 1.7.1 Workspace folder c:\Desktop\firmware\esp32_solar ---------------------------------------------------- Extension configuration settings ------------------------------------------------------ ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH} ESP-IDF Path (idf.espIdfPath) C:\esp\esp-idf ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH} ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH} ESP-HomeKit-SDK Path (idf.espHomeKitSdkPath) ${env:HOMEKIT_PATH} Custom extra paths (idf.customExtraPaths) C:.espressif\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin;C:.espressif\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin;C:.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin;C:.espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s2-elf\bin;C:.espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\bin;C:.espressif\tools\riscv32-esp-elf\esp-2021r2-patch5-8.4.0\riscv32-esp-elf\bin;C:.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;C:.espressif\tools\cmake\3.23.1\bin;C:.espressif\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin;C:.espressif\tools\ninja\1.10.2;C:.espressif\tools\idf-exe\1.0.3;C:.espressif\tools\ccache\4.3\ccache-4.3-windows-64;C:.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64 Custom extra vars (idf.customExtraVars) OPENOCD_SCRIPTS: C:.espressif\tools\openocd-esp32\v0.11.0-esp32-20221026/openocd-esp32/share/openocd/scripts IDF_CCACHE_ENABLE: 1 Virtual env Python Path (idf.pythonBinPath) C:.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe Serial port (idf.port) COM4 OpenOCD Configs (idf.openOcdConfigs) interface/ftdi/esp32_devkitj_v1.cfg,target/esp32.cfg ESP-IDF Tools Path (idf.toolsPath) C:.espressif Git Path (idf.gitPath) C:.espressif\tools\idf-git\2.39.2\cmd\git.exe Notification Mode (idf.notificationMode) All -------------------------------------------------------- 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-HomeKit Path (idf.espHomeKitSdkPath) false Access to ESP-IDF Custom extra paths Access to C:.espressif\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin: true Access to C:.espressif\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin: true Access to C:.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin: true Access to C:.espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s2-elf\bin: true Access to C:.espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\bin: true Access to C:.espressif\tools\riscv32-esp-elf\esp-2021r2-patch5-8.4.0\riscv32-esp-elf\bin: true Access to C:.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: true Access to C:.espressif\tools\cmake\3.23.1\bin: true Access to C:.espressif\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin: true Access to C:.espressif\tools\ninja\1.10.2: true Access to C:.espressif\tools\idf-exe\1.0.3: true Access to C:.espressif\tools\ccache\4.3\ccache-4.3-windows-64: true Access to C:.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64: 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-HomeKit-SDK Path (idf.espHomeKitSdkPath) false Spaces in ESP-IDF Custom extra paths Spaces in C:.espressif\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin: false Spaces in C:.espressif\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin: false Spaces in C:.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin: false Spaces in C:.espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s2-elf\bin: false Spaces in C:.espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\bin: false Spaces in C:.espressif\tools\riscv32-esp-elf\esp-2021r2-patch5-8.4.0\riscv32-esp-elf\bin: false Spaces in C:.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: false Spaces in C:.espressif\tools\cmake\3.23.1\bin: false Spaces in C:.espressif\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin: false Spaces in C:.espressif\tools\ninja\1.10.2: false Spaces in C:.espressif\tools\idf-exe\1.0.3: false Spaces in C:.espressif\tools\ccache\4.3\ccache-4.3-windows-64: false Spaces in C:.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64: 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 4.4.5 Python version 3.8.7 Python's pip version 20.3.3 -------------------------------------------------- Project configuration settings ---------------------------------------------------------- -------------------------------------------------- Python packages in idf.pythonBinPath ---------------------------------------------------- bitstring version: 3.1.9 Brotli version: 1.1.0 cachecontrol version: 0.13.1 certifi version: 2023.7.22 cffi version: 1.16.0 charset-normalizer version: 3.3.0 click version: 8.0.4 colorama version: 0.4.6 construct version: 2.10.54 contextlib2 version: 21.6.0 cryptography version: 41.0.4 ecdsa version: 0.18.0 esp-debug-backend version: 1.0.3 esp-windows-curses version: 0.1 filelock version: 3.12.4 Flask version: 0.12.5 Flask-Compress version: 1.14 Flask-SocketIO version: 2.9.6 future version: 0.18.3 gcovr version: 6.0 gdbgui version: 0.13.2.0 gevent version: 1.5.0 greenlet version: 3.0.0 idf-component-manager version: 1.4.1 idna version: 3.4 itsdangerous version: 2.0.1 Jinja2 version: 3.0.3 kconfiglib version: 13.7.1 lxml version: 4.9.3 MarkupSafe version: 2.1.3 msgpack version: 1.0.7 packaging version: 23.2 pip version: 20.3.3 pycparser version: 2.21 pyelftools version: 0.30 pygdbmi version: 0.9.0.2 Pygments version: 2.16.1 pyparsing version: 2.3.1 pyserial version: 3.5 python-engineio version: 3.14.2 python-socketio version: 4.6.1 pywin32 version: 306 PyYAML version: 6.0.1 reedsolo version: 1.5.4 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.17 websocket-client version: 1.6.4 Werkzeug version: 0.16.1 wheel version: 0.36.2 windows-curses version: 2.3.1 ---------------------------------------------------- Check ESP-IDF python requirements.txt ------------------------------------------------- Check ESP-IDF Python packages C:\esp\esp-idf\tools\check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources Python requirements from C:\esp\esp-idf\requirements.txt are satisfied. ---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------ Check Debug AdapterPython packages C:\esp\esp-idf\tools\check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources Python requirements from c:.vscode\extensions\espressif.esp-idf-extension-1.7.1\esp_debug_adapter\requirements.txt are satisfied. ---------------------------------------------------- Visual Studio Code launch.json -------------------------------------------------------- { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "espidf", "name": "Launch", "request": "launch", } ] }

---------------------------------------------------- Visual Studio Code c_cpp_properties.json ---------------------------------------------- { "configurations": [ { "name": "ESP-IDF", "compilerPath": "/Users/Sam/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc", "cStandard": "c11", "cppStandard": "c++17", "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

No response

Description

I have a python script to zip bin file and calculate md5. I run it using idf.postBuildTask function. Since v1.8.0 it is not working properly.

in setting.json I have idf.postBuildTask enabled by adding: "idf.postBuildTask":"python ota_zip_gen.py", It was working fine in v1.7.1 and v1.6.5. Here is a screen shot of when it was working: image

In v1.8.0 it gives me an error message: image

Does the grammar for this function changed in v1.8.0? Is there any document for how to use this function? I could not find any examples of this function.

Debug Message

here is the output of the error message: 

*  Executing task: c:\Users\Sam\Desktop\firmware\esp32_solar\build\python ota_zip_gen.py  

 *  The terminal process failed to launch: Path to shell executable "c:\Users\Sam\Desktop\firmware\esp32_solar\build\python ota_zip_gen.py" does not exist.

Other Steps to Reproduce

  1. create a python script
  2. add "idf.postBuildTask":"python script.py", to setting.jason
  3. build project
  4. you will see the error message image

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

brianignacio5 commented 1 week ago

This is a duplicate of #1232

Could you try this vsix installer ?

policeman0077 commented 1 week ago

This is a duplicate of #1232

Could you try this vsix installer ?

Thank you. The installer you provided is working.