|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
| 15 | +import os |
15 | 16 | import re
|
16 | 17 | import sys
|
17 | 18 | from os.path import isfile, join
|
|
23 | 24 | from platformio.util import get_serial_ports
|
24 | 25 | from platformio.project.helpers import get_project_dir
|
25 | 26 |
|
26 |
| -import os |
27 | 27 |
|
28 | 28 | env = DefaultEnvironment()
|
29 | 29 | platform = env.PioPlatform()
|
30 | 30 | projectconfig = env.GetProjectConfig()
|
| 31 | +IS_WINDOWS = sys.platform.startswith("win") |
31 | 32 |
|
32 | 33 | #
|
33 | 34 | # Helpers
|
@@ -392,9 +393,11 @@ def firmware_metrics(target, source, env):
|
392 | 393 | target_firm = join("$BUILD_DIR", "${PROGNAME}.bin")
|
393 | 394 | else:
|
394 | 395 | 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) |
398 | 401 | if set(["buildfs", "uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
|
399 | 402 | target_firm = env.DataToBin(
|
400 | 403 | join("$BUILD_DIR", "${ESP32_FS_IMAGE_NAME}"), "$PROJECT_DATA_DIR"
|
|
0 commit comments