@@ -373,14 +373,6 @@ def setup_idf_environ():
373
373
idf_path = 'lib/esp-idf'
374
374
375
375
if os .path .exists (os .path .join (idf_path , 'export.sh' )):
376
- cmds = [['cd' , idf_path ]]
377
-
378
- if sys .platform .startswith ('win' ):
379
- cmds .append (['export' ])
380
- cmds .append (['set' ])
381
- else :
382
- cmds .append (['. ./export.sh' ])
383
- cmds .append (['printenv' ])
384
376
385
377
# this removes any IDF environment variable that may exist if the user
386
378
# has the ESP-IDF installed
@@ -391,6 +383,13 @@ def setup_idf_environ():
391
383
env ['PATH' ] = py_path + os .pathsep + os .pathsep + idf_tools_path + os .pathsep + env .get ('PATH' , '' )
392
384
env ['IDF_PATH' ] = idf_path
393
385
386
+ cmds = [
387
+ [f'export "IDF_PATH={ os .path .abspath (env ["IDF_PATH" ])} "' ],
388
+ ['. ./export.sh' ],
389
+ ['cd' , idf_path ],
390
+ ['printenv' ]
391
+ ]
392
+
394
393
if 'GITHUB_RUN_ID' in env :
395
394
if sys .platform .startswith ('win' ):
396
395
env_cmds = [
@@ -458,6 +457,7 @@ def submodules():
458
457
print ()
459
458
460
459
cmds = [
460
+ [f'export "IDF_PATH={ os .path .abspath (idf_path )} "' ],
461
461
['cd' , idf_path ],
462
462
['git' , 'submodule' , 'update' , '--init' ,
463
463
'components/bt/host/nimble/nimble' ,
@@ -480,12 +480,13 @@ def submodules():
480
480
if result != 0 :
481
481
sys .exit (result )
482
482
483
+ env = setup_idf_environ ()
484
+
483
485
if 'deploy' in submodules_cmd :
484
486
submodules_cmd .remove ('deploy' )
485
487
486
- env = setup_idf_environ ()
487
-
488
488
cmds = [
489
+ [f'export "IDF_PATH={ os .path .abspath (env ["IDF_PATH" ])} "' ],
489
490
['cd' , 'lib/esp-idf' ],
490
491
['. ./export.sh' ],
491
492
['cd ../..' ],
@@ -569,6 +570,7 @@ def compile(): # NOQA
569
570
570
571
if not sys .platform .startswith ('win' ):
571
572
cmds = [
573
+ [f'export "IDF_PATH={ os .path .abspath (env ["IDF_PATH" ])} "' ],
572
574
['cd' , 'lib/esp-idf' ],
573
575
['. ./export.sh' ],
574
576
['cd ../..' ],
@@ -721,6 +723,7 @@ def compile(): # NOQA
721
723
722
724
if not sys .platform .startswith ('win' ):
723
725
cmds = [
726
+ [f'export "IDF_PATH={ os .path .abspath (env ["IDF_PATH" ])} "' ],
724
727
['cd' , 'lib/esp-idf' ],
725
728
['. ./export.sh' ],
726
729
['cd ../..' ],
@@ -729,7 +732,7 @@ def compile(): # NOQA
729
732
else :
730
733
cmds = cmd
731
734
732
- result , _ = spawn (cmds )
735
+ result , _ = spawn (cmds , env = env )
733
736
if result :
734
737
sys .exit (result )
735
738
0 commit comments