Skip to content

Commit ae25417

Browse files
committed
updates the esp32 build
1 parent 24885a3 commit ae25417

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

builder/esp32.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,6 @@ def setup_idf_environ():
373373
idf_path = 'lib/esp-idf'
374374

375375
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'])
384376

385377
# this removes any IDF environment variable that may exist if the user
386378
# has the ESP-IDF installed
@@ -391,6 +383,13 @@ def setup_idf_environ():
391383
env['PATH'] = py_path + os.pathsep + os.pathsep + idf_tools_path + os.pathsep + env.get('PATH', '')
392384
env['IDF_PATH'] = idf_path
393385

386+
cmds = [
387+
[f'export "IDF_PATH={os.path.abspath(env["IDF_PATH"])}"'],
388+
['. ./export.sh'],
389+
['cd', idf_path],
390+
['printenv']
391+
]
392+
394393
if 'GITHUB_RUN_ID' in env:
395394
if sys.platform.startswith('win'):
396395
env_cmds = [
@@ -458,6 +457,7 @@ def submodules():
458457
print()
459458

460459
cmds = [
460+
[f'export "IDF_PATH={os.path.abspath(idf_path)}"'],
461461
['cd', idf_path],
462462
['git', 'submodule', 'update', '--init',
463463
'components/bt/host/nimble/nimble',
@@ -480,12 +480,13 @@ def submodules():
480480
if result != 0:
481481
sys.exit(result)
482482

483+
env = setup_idf_environ()
484+
483485
if 'deploy' in submodules_cmd:
484486
submodules_cmd.remove('deploy')
485487

486-
env = setup_idf_environ()
487-
488488
cmds = [
489+
[f'export "IDF_PATH={os.path.abspath(env["IDF_PATH"])}"'],
489490
['cd', 'lib/esp-idf'],
490491
['. ./export.sh'],
491492
['cd ../..'],
@@ -569,6 +570,7 @@ def compile(): # NOQA
569570

570571
if not sys.platform.startswith('win'):
571572
cmds = [
573+
[f'export "IDF_PATH={os.path.abspath(env["IDF_PATH"])}"'],
572574
['cd', 'lib/esp-idf'],
573575
['. ./export.sh'],
574576
['cd ../..'],
@@ -721,6 +723,7 @@ def compile(): # NOQA
721723

722724
if not sys.platform.startswith('win'):
723725
cmds = [
726+
[f'export "IDF_PATH={os.path.abspath(env["IDF_PATH"])}"'],
724727
['cd', 'lib/esp-idf'],
725728
['. ./export.sh'],
726729
['cd ../..'],
@@ -729,7 +732,7 @@ def compile(): # NOQA
729732
else:
730733
cmds = cmd
731734

732-
result, _ = spawn(cmds)
735+
result, _ = spawn(cmds, env=env)
733736
if result:
734737
sys.exit(result)
735738

0 commit comments

Comments
 (0)