espressif / idf-installer

ESP IDF Windows Installer
https://dl.espressif.com/dl/esp-idf/
101 stars 21 forks source link

programatically launching the idf environment #242

Open kdschlosser opened 1 month ago

kdschlosser commented 1 month ago

OK so this is the skinny, I have been working ona more complete binding of LVGL and MicroPython and one of the larger goals is to simplify compiling it. To do that I have written a python script that is the entry point for compiling. Bump in the road I am running into is getting things to compile on Windows. macOS and Linux are both good. Setting up the build environment in Windows has been a real thorn in my side.

I need to be able to set up the build environment by running an executable, batch file, script, etc... from the command line. It cannot launch another cmd shell that has the environment in it. It needs to set up the environment in the currently running cmd shell.

Alternatively I can run a command without using the cmd shell if it acts in the same manner as the cmd shell.

It would makes things easier if I was able to pass a command to execute if what is being run is a cmd shell. Doing this would require the forwarding of stdout to the cmd shell that executed the command.

I have not seen the ability to do this. I have looked at the lnk file that gets created to launch the build environment..

C:\WINDOWS\system32\cmd.exe /k ""C:\Espressif\idf_cmd_init.bat" esp-idf-e67fc3a73fc75eba5dda3e96918109e6"

and I am thinking that e67fc3a73fc75eba5dda3e96918109e6 is not going to be a constant. it will be different on each machine that the toolkit gets installed on... If that is the case then I am not able to programmatically create a build environment.

The powershell lnk file shows a completely different series of numbers

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoExit -File "C:\Espressif/Initialize-Idf.ps1" -IdfId esp-idf-e67fc3a73fc

This is what leads me to believe that the numbers are generated at installation time and would different for each install.

Another issue is not all of the SOC's are selected by default and i don't see any command line parameter for the installer to specify which SOC's are wanting to be used. I do not know if that is only for the purpose of setting the target or if the installer does other things as well.