Skip to content

Commit efc7239

Browse files
authored
make sure UTF-8 is used for esp-idf-size
1 parent 7a80f01 commit efc7239

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

builder/main.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def __fetch_fs_size(target, source, env):
225225
board = env.BoardConfig()
226226
mcu = board.get("build.mcu", "esp32")
227227
toolchain_arch = "xtensa-%s" % mcu
228-
filesystem = board.get("build.filesystem", "spiffs")
228+
filesystem = board.get("build.filesystem", "littlefs")
229229
if mcu in ("esp32c2", "esp32c3", "esp32c5", "esp32c6", "esp32h2", "esp32p4"):
230230
toolchain_arch = "riscv32-esp"
231231

@@ -306,7 +306,7 @@ def check_lib_archive_exists():
306306
return True
307307
#print("lib_archive was not found in platformio.ini")
308308
return False
309-
309+
310310
if not check_lib_archive_exists():
311311
env_section = "env:" + env["PIOENV"]
312312
projectconfig.set(env_section, "lib_archive", "False")
@@ -367,10 +367,13 @@ def firmware_metrics(target, source, env):
367367
if os.path.isfile(map_file):
368368
try:
369369
import subprocess
370+
python_exe = env.subst("$PYTHONEXE")
371+
run_env = os.environ.copy()
372+
run_env["PYTHONIOENCODING"] = "utf-8"
370373
# Show output of esp_idf_size, but suppresses the command echo
371374
subprocess.run([
372-
env.subst("$PYTHONEXE"), "-m", "esp_idf_size", "--ng", map_file
373-
], check=False)
375+
python_exe, "-m", "esp_idf_size", "--ng", map_file
376+
], env=run_env, check=False)
374377
except Exception:
375378
print("Warning: Failed to run firmware metrics. Is esp-idf-size installed?")
376379
pass

0 commit comments

Comments
 (0)