Skip to content

Commit 17da90e

Browse files
authored
switch off esp-idf-size for Windows
1 parent cb106a9 commit 17da90e

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
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import os
1516
import re
1617
import sys
1718
from os.path import isfile, join
@@ -23,11 +24,11 @@
2324
from platformio.util import get_serial_ports
2425
from platformio.project.helpers import get_project_dir
2526

26-
import os
2727

2828
env = DefaultEnvironment()
2929
platform = env.PioPlatform()
3030
projectconfig = env.GetProjectConfig()
31+
IS_WINDOWS = sys.platform.startswith("win")
3132

3233
#
3334
# Helpers
@@ -392,9 +393,11 @@ def firmware_metrics(target, source, env):
392393
target_firm = join("$BUILD_DIR", "${PROGNAME}.bin")
393394
else:
394395
target_elf = env.BuildProgram()
395-
silent_action = env.Action(firmware_metrics)
396-
silent_action.strfunction = lambda target, source, env: '' # hack to silence scons command output
397-
env.AddPostAction(target_elf, silent_action)
396+
# python charmap is crashing with Windows and esp-idf-size
397+
if not IS_WINDOWS:
398+
silent_action = env.Action(firmware_metrics)
399+
silent_action.strfunction = lambda target, source, env: '' # hack to silence scons command output
400+
env.AddPostAction(target_elf, silent_action)
398401
if set(["buildfs", "uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
399402
target_firm = env.DataToBin(
400403
join("$BUILD_DIR", "${ESP32_FS_IMAGE_NAME}"), "$PROJECT_DATA_DIR"

0 commit comments

Comments
 (0)