@@ -115,11 +115,12 @@ def get_espidf():
115
115
cmd = [
116
116
[
117
117
'git' , 'submodule' , 'update' , '--init' ,
118
- f'--jobs { os .cpu_count ()} ' , '--' , 'lib/esp-idf'
118
+ f'--jobs { os .cpu_count ()} ' , '--depth=1' ,
119
+ '--' , 'lib/esp-idf'
119
120
],
120
- ['cd' , ' lib/esp-idf' ],
121
+ ['cd lib/esp-idf' ],
121
122
[
122
- 'git' , 'submodule' , 'update' , '--init' ,
123
+ 'git' , 'submodule' , 'update' , '--init' , '--depth=1' ,
123
124
f'--jobs { os .cpu_count ()} ' , '--' ,
124
125
'components/bt/host/nimble/nimble' ,
125
126
'components/esp_wifi' ,
@@ -473,7 +474,10 @@ def has_correct_idf():
473
474
cached_idf_version = version
474
475
475
476
return (
476
- cached_idf_version is not None and cached_idf_version == IDF_VER
477
+ cached_idf_version is not None and (
478
+ cached_idf_version == IDF_VER or
479
+ cached_idf_version == IDF_VER .rsplit ('.' , 1 )[0 ]
480
+ )
477
481
)
478
482
479
483
@@ -580,10 +584,34 @@ def setup_idf_environ():
580
584
# There were some modifications made with how the environment gets set up
581
585
# @cheops put quite a bit of time in to research the best solution
582
586
# and also with the testing of the code.
583
- if IDF_ENVIRON_SET or (not IDF_ENVIRON_SET and has_correct_idf ()):
587
+
588
+ if IDF_ENVIRON_SET :
584
589
env = os .environ
585
590
IDF_ENVIRON_SET = True
586
- elif not IDF_ENVIRON_SET :
591
+ elif has_correct_idf ():
592
+ idf_path = get_idf_path ()
593
+
594
+ cmd = [
595
+ ['cd' , idf_path ],
596
+ [
597
+ 'git' , 'submodule' , 'update' , '--init' , '--depth=1' ,
598
+ f'--jobs { os .cpu_count ()} ' , '--' ,
599
+ 'components/bt/host/nimble/nimble' ,
600
+ 'components/esp_wifi' ,
601
+ 'components/esptool_py/esptool' ,
602
+ 'components/lwip/lwip' ,
603
+ 'components/mbedtls/mbedtls' ,
604
+ 'components/bt/controller/lib_esp32' ,
605
+ 'components/bt/controller/lib_esp32c3_family'
606
+ ]
607
+ ]
608
+ env = os .environ
609
+ result , _ = spawn (cmd , spinner = True , env = env )
610
+ if result != 0 :
611
+ sys .exit (result )
612
+
613
+ IDF_ENVIRON_SET = True
614
+ else :
587
615
print ('Getting ESP-IDF build Environment' )
588
616
idf_path = 'lib/esp-idf'
589
617
@@ -641,9 +669,6 @@ def setup_idf_environ():
641
669
642
670
env = os .environ
643
671
IDF_ENVIRON_SET = True
644
- else :
645
- # this is a sanity check and should never actually run
646
- env = os .environ
647
672
648
673
if 'GITHUB_RUN_ID' in os .environ :
649
674
idf_path = os .path .abspath (env ["IDF_PATH" ])
@@ -678,7 +703,7 @@ def submodules():
678
703
env = {k : v for k , v in os .environ .items ()}
679
704
env ['IDF_PATH' ] = os .path .abspath (idf_path )
680
705
681
- result , _ = spawn (cmds , env = env )
706
+ result , _ = spawn (cmds , spinner = True , env = env )
682
707
if result != 0 :
683
708
sys .exit (result )
684
709
0 commit comments