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

1.9 new esp-idf terminal can't support bat build (VSC-1542) #1369

Open
1 task done
huexpub opened this issue Dec 17, 2024 · 8 comments · May be fixed by #1381
Open
1 task done

1.9 new esp-idf terminal can't support bat build (VSC-1542) #1369

huexpub opened this issue Dec 17, 2024 · 8 comments · May be fixed by #1381
Assignees
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue) Issue Template Ignored Author hasn't follow the issue template
Milestone

Comments

@huexpub
Copy link

huexpub commented Dec 17, 2024

OS

Windows

Operating System version

windows 11

Visual Studio Code version

No response

ESP-IDF version

5.3

Python version

3.11

Doctor command output

use bat run esp-idf build

Extension

No response

Description

vscode , new esp-idf terminal will every time show run espressif.esp-idf-extension-1.9.0\export.ps1 , yes ,it can run esp-idf ,but can't run build of bat(compile different types together)

@echo build task init
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod1xxx" build
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod2xxx" build
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod3xxx" build
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod4xxx" build
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod5xxx" build

in 1.8 ,it woks well , but change to 1.9 will show error like this

Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

Debug Message

back to 1.8 woks...

Other Steps to Reproduce

no

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

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@huexpub huexpub added the bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue) label Dec 17, 2024
@github-actions github-actions bot changed the title 1.9 new esp-idf terminal can't support bat build 1.9 new esp-idf terminal can't support bat build (VSC-1542) Dec 17, 2024
@brianignacio5
Copy link
Collaborator

brianignacio5 commented Dec 17, 2024

Could you share the troubleshooting information ? Is your default terminal profile Command Prompt or Powershell? You can see the shell used by the extension in doctor command output.

There should be one script ps1 for Powershell and one .bat for Command Prompt.

a. I select vscode default terminal profile to Command Prompt

  1. I used ESP-IDF v5.3.1 Open a blink example and run ESP-IDF: Open ESP-IDF Terminal,
  2. Then I run the following command one after another:
idf.py fullclean
idf.py build
idf.py fullclean

Seems to work without issues in my Windows 11 setup.

@brianignacio5 brianignacio5 added the Issue Template Ignored Author hasn't follow the issue template label Dec 17, 2024
@huexpub
Copy link
Author

huexpub commented Dec 17, 2024

yes , you are right ,this works , but not this issue , we use build.bat files to compile all the project with diff prod.

like this bat file ;

@echo build task init
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod1xxx" build
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod2xxx" build
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod3xxx" build
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod4xxx" build
idf.py fullclean
idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod5xxx" build

use this file we can run the bat to compile all prod build and change diff module like esp32s3 s2. it can works 1.18 ,but 1.19 will show error...

thank you!

@brianignacio5
Copy link
Collaborator

brianignacio5 commented Dec 18, 2024

Please share the requested troubleshooting information.

@huexpub
Copy link
Author

huexpub commented Dec 18, 2024

in 1.9 open new terminal and run buld.bat show this error

PS D:\Code\espressif\abc\def> c:\Users\huex\.vscode\extensions\espressif.esp-idf-extension-1.9.0\export.ps1
PS D:\Code\espressif\abc\def> .\build.bat
build task init

D:\Code\espressif\abc\def>idf.py fullclean 
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod1xxx" build 
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py fullclean 
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod2xxx" build
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py fullclean
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod3xxx" build
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py fullclean
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod4xxx" build
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py fullclean
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

D:\Code\espressif\abc\def>idf.py -B build -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.prod5xxx" build
Cannot import module "esp_idf_monitor". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.

1.8 works well

thank you

@brianignacio5 brianignacio5 linked a pull request Dec 23, 2024 that will close this issue
5 tasks
@brianignacio5
Copy link
Collaborator

Could you please try this vsix installer to see if the issue is fixed ?

@brianignacio5 brianignacio5 self-assigned this Dec 23, 2024
@brianignacio5 brianignacio5 added this to the v2.0.0 milestone Dec 23, 2024
@huexpub
Copy link
Author

huexpub commented Dec 24, 2024

Could you please try this vsix installer to see if the issue is fixed ?

it works .
thank you

@huexpub
Copy link
Author

huexpub commented Dec 25, 2024

emm , but i found a issue ,when i close the vscode ,and reopen, new terminal will set default target is esp32 , but last i run esp-idf build is already set esp32c6 , so i need try set target again, when try close and open again ,new terminal will set default target is esp32 again.

@brianignacio5
Copy link
Collaborator

How do you set the esp32c6 target ? Do you use the extension ESP-IDF: Set Espressif Device Target or status bar icon with current target (esp32 for example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue) Issue Template Ignored Author hasn't follow the issue template
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants