Skip to content

Commit b75c374

Browse files
committed
FINALLY!!! I found the reason why the first build attempt would for the ESP32 port!!!!!.
1 parent 9d084d9 commit b75c374

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

builder/esp32.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ def parse_args(extra_args, lv_cflags, board):
205205

206206

207207
def build_commands(_, extra_args, __, lv_cflags, board):
208+
clean_cmd.extend(esp_cmd[:])
209+
clean_cmd[1] = 'clean'
210+
clean_cmd.append(f'BOARD={board}')
211+
212+
submodules_cmd.extend(esp_cmd[:])
213+
submodules_cmd[1] = 'submodules'
214+
submodules_cmd.append(f'BOARD={board}')
215+
208216
esp_cmd.extend([
209217
f'LV_CFLAGS="{lv_cflags}"',
210218
f'LV_PORT=esp32',
@@ -214,19 +222,13 @@ def build_commands(_, extra_args, __, lv_cflags, board):
214222

215223
esp_cmd.extend(extra_args)
216224

217-
clean_cmd.extend(esp_cmd[:])
218-
clean_cmd[1] = 'clean'
219-
220225
compile_cmd.extend(esp_cmd[:])
221226
compile_cmd.pop(1)
222227

223-
submodules_cmd.extend(esp_cmd[:])
224-
submodules_cmd[1] = 'submodules'
225-
226228
if board_variant:
227-
clean_cmd.insert(8, f'BOARD_VARIANT={board_variant}')
229+
clean_cmd.append(f'BOARD_VARIANT={board_variant}')
228230
compile_cmd.insert(7, f'BOARD_VARIANT={board_variant}')
229-
submodules_cmd.insert(8, f'BOARD_VARIANT={board_variant}')
231+
submodules_cmd.append(f'BOARD_VARIANT={board_variant}')
230232

231233

232234
def get_idf_version():
@@ -258,10 +260,11 @@ def build_manifest(target, script_dir, displays, indevs, frozen_manifest):
258260

259261

260262
def clean():
263+
env = setup_idf_environ()
261264
if 'deploy' in clean_cmd:
262265
clean_cmd.remove('deploy')
263266

264-
spawn(clean_cmd)
267+
spawn(clean_cmd, env=env)
265268

266269

267270
def setup_idf_environ():
@@ -350,7 +353,9 @@ def submodules():
350353
if 'deploy' in submodules_cmd:
351354
submodules_cmd.remove('deploy')
352355

353-
return_code, _ = spawn(submodules_cmd)
356+
env = setup_idf_environ()
357+
358+
return_code, _ = spawn(submodules_cmd, env=env)
354359
if return_code != 0:
355360
sys.exit(return_code)
356361

0 commit comments

Comments
 (0)