Skip to content

Commit af52f80

Browse files
committed
fixes esp32 build
1 parent 8624f49 commit af52f80

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

builder/esp32.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,33 +297,31 @@ def setup_idf_environ():
297297
# has the ESP-IDF installed
298298
env = {k: v for k, v in os.environ.items() if not k.startswith('IDF')}
299299
py_path = os.path.split(sys.executable)[0]
300+
idf_path = os.path.abspath(idf_path)
301+
idf_tools_path = os.path.join(idf_path, 'tools')
302+
env['PATH'] = py_path + os.pathsep + idf_path + os.pathsep + idf_tools_path + os.pathsep + env.get('PATH', '')
303+
env['IDF_PATH'] = idf_path
300304

301305
if 'GITHUB_RUN_ID' in env:
302306
if sys.platform.startswith('win'):
303307
env_cmds = [
304308
['echo', f"{py_path}", '|', 'Out-File', '-Append',
305309
'-FilePath', '$env:GITHUB_PATH', '-Encoding', 'utf8'],
306-
['echo', f"{os.path.abspath(idf_path)}", '|', 'Out-File', '-Append',
310+
['echo', f"{idf_path}", '|', 'Out-File', '-Append',
311+
'-FilePath', '$env:GITHUB_PATH', '-Encoding', 'utf8'],
312+
['echo', f"{idf_tools_path}", '|', 'Out-File', '-Append',
307313
'-FilePath', '$env:GITHUB_PATH', '-Encoding', 'utf8']
308314
]
309315
else:
310316
env_cmds = [
311317
['echo', f"{py_path}", '>>', '$GITHUB_PATH'],
312-
['echo', f"{os.path.abspath(idf_path)}", '>>', '$GITHUB_PATH']
318+
['echo', f"{idf_path}", '>>', '$GITHUB_PATH'],
319+
['echo', f"{idf_tools_path}", '>>', '$GITHUB_PATH']
320+
313321
]
314322

315323
spawn(env_cmds, env=env, out_to_screen=False)
316324

317-
env['IDF_PATH'] = os.path.abspath(idf_path)
318-
319-
if 'PATH' in env:
320-
env['PATH'] = py_path + os.pathsep + env['PATH']
321-
elif 'path' in env:
322-
env['PATH'] = py_path + os.pathsep + env['path']
323-
del env['path']
324-
else:
325-
env['PATH'] = py_path + os.pathsep
326-
327325
result, output = spawn(cmds, env=env, out_to_screen=False)
328326

329327
if result != 0:

0 commit comments

Comments
 (0)