PlatformIO Core (or IDE) on Gentoo Linux

I’ve been trying to step through the build process after shifting my dev machine back to Linux and facing a rather odd issue with PIO failing when building an ESP32 project without giving any real information as to why. I enabled a few debug options directly in SCons and was able to see the raw CXX command line just prior to execution but not the actual command that was executed (unfortunately).

Below is the complete “verbose” output, any ideas?

mdunston@studio ~/trains/ESP32CommandStation $ pio run -e pcb_oled_sh1106 -v
Processing pcb_oled_sh1106 (build_unflags: -std=gnu++11; build_flags: -std=c++14, -g3, -DESP32_WIFIMGR_SOCKETPARAMS_LOG_LEVEL=VERBOSE, -DESP32_WIFIMGR_MDNS_LOOKUP_LOG_LEVEL=VERBOSE, -D_GLIBCXX_USE_C99, -DLOCKED_LOGGING, -DOPENMRN_EXCLUDE_REBOOT_IMPL, -DOPENMRN_EXCLUDE_FREE_HEAP_IMPL, -DPROJECT_NAME="\"ESP32 Command Station\"", -DPROJECT_VER="\"1.5.0\"", -DESP32CS_CDI_VERSION=0x0150, -DESP32CS_EXTERNAL_CONFIGURATION=true, -DENABLE_OUTPUTS=false, -DENABLE_SENSORS=false, -DSSID_NAME="\"esp32cs\"", -DSSID_PASSWORD="\"\"", -DWIFI_ENABLE_SOFT_AP_ONLY=true, -DOPS_ENABLE_PIN=17, -DOPS_THERMAL_PIN=0, -DOPS_CURRENT_SENSE_ADC=ADC1_CHANNEL_5, -DOPS_HBRIDGE_TYPE=LMD18200, -DOPS_SIGNAL_PIN=5, -DOPS_PREAMBLE_BITS=16, -DRAILCOM_BRAKE_ENABLE_PIN=25, -DRAILCOM_ENABLE_PIN=26, -DRAILCOM_SHORT_PIN=27, -DRAILCOM_UART=2, -DRAILCOM_UART_RX_PIN=36, -DPROG_ENABLE_PIN=18, -DPROG_CURRENT_SENSE_ADC=ADC1_CHANNEL_6, -DPROG_HBRIDGE_TYPE=L298, -DPROG_SIGNAL_PIN=19, -DPROG_PREAMBLE_BITS=22, -DLCC_CAN_RX_PIN=35, -DLCC_CAN_TX_PIN=32, -DINFO_SCREEN_SDA_PIN=23, -DINFO_SCREEN_SCL_PIN=21, -DSTATUS_LED_DATA_PIN=22, -DSTATUS_LED_ENABLED=CONSTANT_TRUE, -DSTATUS_LED_COLOR_ORDER=RGB, -DSTATUS_LED_TYPE=APA106, -DINFO_SCREEN_OLED=true, -DINFO_SCREEN_OLED_CHIPSET=SH1106, -DINFO_SCREEN_OLED_I2C_ADDRESS=0x3C, -DINFO_SCREEN_OLED_VERTICAL_FLIP=false; extra_scripts: utils/pio_http_headers.py; platform: espressif32; board: esp32dev; framework: espidf, arduino; lib_compat_mode: strict; monitor_speed: 115200; board_build.partitions: ESP32CS-partitions.csv; build_type: release)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 1.11.1 > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (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-arduinoespressif32 2.10004.191002 (1.0.4)
 - framework-espidf 3.30300.190916 (3.3.0)
 - tool-esptoolpy 1.20600.0 (2.6.0)
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ strict
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <OpenMRNLite> 0.1.1 (/home/mdunston/trains/ESP32CommandStation/lib/OpenMRNLite)
|-- <LCCTrainSearchProtocol> (/home/mdunston/trains/ESP32CommandStation/lib/LCCTrainSearchProtocol)
|   |-- <OpenMRNLite> 0.1.1 (/home/mdunston/trains/ESP32CommandStation/lib/OpenMRNLite)
|-- <LiquidCrystal_PCF8574> 1.2.0 (/home/mdunston/trains/ESP32CommandStation/lib/LiquidCrystal_PCF8574)
|   |-- <Wire> 1.0.1 (/home/mdunston/.platformio/packages/framework-arduinoespressif32/libraries/Wire)
|-- <ESP8266_SSD1306> 4.0.0 (/home/mdunston/trains/ESP32CommandStation/lib/ESP8266_SSD1306)
|   |-- <Wire> 1.0.1 (/home/mdunston/.platformio/packages/framework-arduinoespressif32/libraries/Wire)
|-- <Wire> 1.0.1 (/home/mdunston/.platformio/packages/framework-arduinoespressif32/libraries/Wire)
|-- <LocoNet2> 2.0.1 (/home/mdunston/trains/ESP32CommandStation/lib/LocoNet2)
|-- <nlohmann_json> 3.7.3 (/home/mdunston/trains/ESP32CommandStation/lib/nlohmann_json)
|-- <NeoNextion> 2.2.1 (/home/mdunston/trains/ESP32CommandStation/lib/NeoNextion)
|-- <NeoPixelBus> 2.5.0 (/home/mdunston/trains/ESP32CommandStation/lib/NeoPixelBus)
Building in release mode
================================================================================================================================================= [FAILED] Took 13.75 seconds =================================================================================================================================================

Environment       Status    Duration
----------------  --------  ------------
esp32             IGNORED
pcb               IGNORED
pcb_oled_sh1106   FAILED    00:00:13.754
pcb_oled_ssd1306  IGNORED
pcb_lcd_20x4      IGNORED
pcb_lcd_16x2      IGNORED
============================================================================================================================================ 1 failed, 0 succeeded in 00:00:13.754 ============================================================================================================================================
mdunston@studio ~/trains/ESP32CommandStation $

Note, this is only failing for ESP32 builds. I have tested another project that uses an AVR chip and it compiles without issues.

Seems this is specific to using espidf as the framework… A test project using just arduino framework with the following in the platformio.ini file it works:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

But switching to:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = espidf

It fails to compile on the first file. I suspect it is something very basic but I haven’t been able to narrow down where/why still.