Build failed with latest PIO

Doing a verbose build failed failed with the newest PIO
Executing task: platformio run --verbose --environment esp32dev_home_ota

MACOS 13.1 Mac Studio M1 vscode 1.75.1 arm64

Processing esp32dev_home_ota (platform: espressif32; board: esp32dev; framework: espidf; monitor_port: /dev/cu.usbserial-8344401; monitor_speed: 115200; build_flags: -DCORE_DEBUG_LEVEL=0; monitor_filters: esp32_exception_decoder; build_type: debug; extra_scripts: post_script.py; custom_ota_host: 192.168.1.3; custom_ota_port: 3232; board_build.partitions: factory_app_two_ota.csv)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.0.1) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf @ 3.50000.0 (5.0.0) 
 - tool-cmake @ 3.16.4 
 - tool-esptoolpy @ 1.40400.0 (4.4.0) 
 - tool-ninja @ 1.9.0 
 - toolchain-esp32ulp @ 1.23500.220830 (2.35.0) 
 - toolchain-xtensa-esp32 @ 11.2.0+2022r1
Reading CMake configuration...
-- Building ESP-IDF components for target esp32
-- Configuring incomplete, errors occurred!
See also "/Users/waltermarchewka/Documents/PlatformIO/Projects/UTF_C_PLUS.nosync/.pio/build/esp32dev_home_ota/CMakeFiles/CMakeOutput.log".

fatal: not a git repository (or any of the parent directories): .git
CMake Error at /Users/waltermarchewka/.platformio/packages/framework-espidf/tools/cmake/build.cmake:519 (message):
  Traceback (most recent call last):

    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/requests/compat.py", line 11, in <module>
      import chardet

  ModuleNotFoundError: No module named 'chardet'

  

  During handling of the above exception, another exception occurred:

  

  Traceback (most recent call last):

    File "<frozen runpy>", line 198, in _run_module_as_main
    File "<frozen runpy>", line 88, in _run_code
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/idf_component_manager/prepare_components/__main__.py", line 4, in <module>
      from .prepare import main
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/idf_component_manager/prepare_components/prepare.py", line 18, in <module>
      from ..core import ComponentManager
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/idf_component_manager/core.py", line 17, in <module>
      import requests
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/requests/__init__.py", line 45, in <module>
      from .exceptions import RequestsDependencyWarning
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/requests/exceptions.py", line 9, in <module>
      from .compat import JSONDecodeError as CompatJSONDecodeError
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/requests/compat.py", line 13, in <module>
      import charset_normalizer as chardet
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/charset_normalizer/__init__.py", line 24, in <module>
      from .api import from_bytes, from_fp, from_path
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/charset_normalizer/api.py", line 5, in <module>
      from .cd import (
    File "/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/charset_normalizer/cd.py", line 9, in <module>
      from .md import is_suspiciously_successive_range

  ImportError:
  dlopen(/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so,
  0x0002): tried:
  '/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so'
  (mach-o file, but is an incompatible architecture (have 'arm64', need
  'x86_64')),
  '/System/Volumes/Preboot/Cryptexes/OS/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so'
  (no such file),
  '/Users/waltermarchewka/.platformio/penv/.espidf-5.0.0/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so'
  (mach-o file, but is an incompatible architecture (have 'arm64', need
  'x86_64'))

Call Stack (most recent call first):
  /Users/waltermarchewka/.platformio/packages/framework-espidf/tools/cmake/project.cmake:440 (idf_build_process)
  CMakeLists.txt:3 (project)



==================================================================================== [FAILED] Took 1.00 seconds ====================================================================================

Environment           Status    Duration
--------------------  --------  ------------
esp32dev_work_serial  IGNORED
esp32dev_home_ota     FAILED    00:00:00.998
esp32dev_home_serial  IGNORED
=============================================================================== 1 failed, 0 succeeded in 00:00:00.998 ===============================================================================

 *  The terminal process "platformio 'run', '--verbose', '--environment', 'esp32dev_home_ota'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.

Do you have Rosetta 2 installed?

No i do not. I did not think i would need it as the VsCode i installed was for Apple Silicon.

This python package needed by ESP-IDF needs x86_64 support. Install it e.g. via the command line shown in Upload Filesystem Image OTA issue on macbook air M2 issue - #11 by maxgerhardt.

After looking, i did verify i had Rosetta 2 installed, but reinstalled anyway.
I get the same error.

Can you run VSCode with the x86_64 architecture instead of ARM?

1 Like

So i did install VSCODE with the X86_64 architecture. This did allow me to get rid of the build errors previously. However, the latest espidf v5 broke a bunch of stuff and i reverted back.

1 Like

I was able to get my MAC M1 running with the vscode arm build.
The first error showing that “chardet” was missing, really was missing from the /Users/xxx/.platformio/penv/lib/python3.10/site-packages.
I added the chardet lib in there and now i can compile.
oddly the error that [maxgerhardt] pointed out seem to resolve itself after adding the library

Same chardet issue on my m1.

History:

  • installed python 3.11 with brew
    • it worked, but python was only available as python3
  • platform io created its env with system version 3.9
  • error

Fixed it by

  • uninstalled platform io (might be unnecessary)
  • deleting ~/.platformio (get rid of old env)
  • installing python 3.11.2 with asdf, such that python --version returns 3.11.2
  • Install platform io (this time it got 3.11.2 for its venv) and create new project
  • success