Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Generated command exceeds windows 32k limit and then fails #1522

Open
zackees opened this issue Dec 27, 2024 · 21 comments
Open

Windows: Generated command exceeds windows 32k limit and then fails #1522

zackees opened this issue Dec 27, 2024 · 21 comments

Comments

@zackees
Copy link

zackees commented Dec 27, 2024

Hi there, I'm a dev on FastLED. I'm cannot build esp32c6 on windows due to command limit of 32k being exceeded:

Repro steps.

  • git clone https://github.com/fastled/fastled
  • checkout commit 5442a57c6603baac823bac885f2f10753bca2ff9
  • pio run

Result

Compiling .pio\build\dev\lib354\fastled\FastLED.cpp.o
Compiling .pio\build\dev\lib354\fastled\bitswap.cpp.o
Compiling .pio\build\dev\lib354\fastled\cled_controller.cpp.o
Compiling .pio\build\dev\lib354\fastled\colorpalettes.cpp.o
Compiling .pio\build\dev\lib354\fastled\colorutils.cpp.o
Compiling .pio\build\dev\lib354\fastled\crgb.cpp.o
riscv32-esp-elf-g++: fatal error: cannot execute 'C:/Users/niteris/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
Compiling .pio\build\dev\lib354\fastled\five_bit_hd_gamma.cpp.o
*** [.pio\build\dev\lib354\fastled\bitswap.cpp.o] Error 1
riscv32-esp-elf-g++: fatal error: cannot execute 'C:/Users/niteris/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
*** [.pio\build\dev\lib354\fastled\colorpalettes.cpp.o] Error 1
riscv32-esp-elf-g++: fatal error: cannot execute 'C:/Users/niteris/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
*** [.pio\build\dev\lib354\fastled\FastLED.cpp.o] Error 1
riscv32-esp-elf-g++: fatal error: cannot execute 'C:/Users/niteris/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
*** [.pio\build\dev\lib354\fastled\cled_controller.cpp.o] Error 1
riscv32-esp-elf-g++: fatal error: cannot execute 'C:/Users/niteris/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
*** [.pio\build\dev\lib354\fastled\five_bit_hd_gamma.cpp.o] Error 1
riscv32-esp-elf-g++: fatal error: cannot execute 'C:/Users/niteris/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
*** [.pio\build\dev\lib354\fastled\crgb.cpp.o] Error 1
riscv32-esp-elf-g++: fatal error: cannot execute 'C:/Users/niteris/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
*** [.pio\build\dev\lib354\fastled\colorutils.cpp.o] Error 1

This is the generated command, running this with wc -m shows that the size is 34k, larger than the 32k windows limit.

It would be helpful if a lot of these same path prefixes were instead folded into an environmental variable.

-o .pio/build/dev/lib354/fastled/bitswap.cpp.o -c -march=rv32imac_zicsr_zifencei -std=gnu++2b -fexceptions -fno-rtti -std=gnu++17 -Werror=return-type -Os -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -nostartfiles -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -Wno-error=uninitialized -Wno-error=maybe-uninitialized -Wno-format-nonliteral -Wno-missing-field-initializers -Wno-error=array-bounds -Wno-write-strings "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>" -MMD -DPLATFORMIO=60116 -DESP32_ARDUINO_LIB_BUILDER -DESP_PLATFORM -DIDF_VER=\"v5.3.2-174-g083aad99cf-dirty\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DMD5_ENABLED=1 -DOPENTHREAD_CONFIG_FILE=\"openthread-core-esp32x-ftd-config.h\" -DOPENTHREAD_FTD=1 -DOPENTHREAD_PROJECT_LIB_CONFIG_FILE=\"openthread-core-esp32x-ftd-config.h\" -DSERIAL_FLASHER_BOOT_HOLD_TIME_MS=50 -DSERIAL_FLASHER_RESET_HOLD_TIME_MS=100 -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -DUNITY_INCLUDE_CONFIG_H -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -DTF_LITE_STATIC_MEMORY -DCHIP_CONFIG_SOFTWARE_VERSION_NUMBER=0 -DCHIP_MINMDNS_DEFAULT_POLICY=1 -DCHIP_MINMDNS_USE_EPHEMERAL_UNICAST_PORT=0 -DCHIP_MINMDNS_HIGH_VERBOSITY=0 -DCHIP_DNSSD_DEFAULT_MINIMAL=1 -DARDUINO_ARCH_ESP32 -DESP32=ESP32 -DF_CPU=160000000L -DARDUINO=10812 -DARDUINO_VARIANT=\"esp32c6\" "-DARDUINO_BOARD=\"Espressif ESP32-C6-DevKitC-1\"" -DARDUINO_PARTITION_default -Isrc -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/newlib/platform_include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/freertos/config/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/freertos/config/include/freertos -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/freertos/config/riscv/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/freertos/FreeRTOS-Kernel/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/freertos/FreeRTOS-Kernel/portable/riscv/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/freertos/esp_additions/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hw_support/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hw_support/include/soc -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hw_support/include/soc/esp32c6 -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hw_support/dma/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hw_support/ldo/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hw_support/port/esp32c6 -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hw_support/port/esp32c6/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hw_support/port/esp32c6/private_include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/heap/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/log/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/soc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/soc/esp32c6 -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/soc/esp32c6/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/hal/platform_port/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/hal/esp32c6/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/hal/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_rom/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_rom/include/esp32c6 -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_rom/esp32c6 -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_common/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_system/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_system/port/soc -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_system/port/include/riscv -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_system/port/include/private -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/riscv/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_timer/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/include/apps -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/include/apps/sntp -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/lwip/src/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/port/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/port/freertos/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/port/esp32xx/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/port/esp32xx/include/arch -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/lwip/port/esp32xx/include/sys -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-tflite-micro -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-tflite-micro/third_party/gemmlowp -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-tflite-micro/third_party/flatbuffers/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-tflite-micro/third_party/ruy -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-tflite-micro/third_party/kissfft -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-tflite-micro/signal/micro/kernels -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-tflite-micro/signal/src -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-tflite-micro/signal/src/kiss_fft_wrappers -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/lib -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/lib/dnssd -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/OpenThread -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/third_party/nlfaultinjection/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/third_party/nlassert/repo/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/third_party/nlio/repo/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/zzz_generated/app-common -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp-idf/espressif__esp_matter -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_matter -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_matter/utils -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_matter_bridge -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_matter_console -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_matter/zap_common -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/ESP32 -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/ESP32/bluedroid -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/ESP32/nimble -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/ESP32/route_hook -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_eth/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_event/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_spi/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_pm/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/include/esp32c6/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/common/osi/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/common/api/include/api -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/common/btc/profile/esp/blufi/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/common/btc/profile/esp/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/common/hci_log/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/host/bluedroid/api/include/api -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/common/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/common/tinycrypt/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/core -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/core/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/core/storage -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/btc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/models/common/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/models/client/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/models/server/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/api/core/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/api/models/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/api -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/lib/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/v1.1/api/core/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/v1.1/api/models/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/esp_ble_mesh/v1.1/btc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/porting/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/porting/npl/freertos/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/porting/transport/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_wifi/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_wifi/wifi_apps/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_wifi/wifi_apps/nan_app/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_wifi/include/local -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_phy/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_phy/esp32c6/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_netif/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/mbedtls/port/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/mbedtls/mbedtls/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/mbedtls/mbedtls/library -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/mbedtls/esp_crt_bundle/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/mbedtls/mbedtls/3rdparty/everest/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/mbedtls/mbedtls/3rdparty/p256-m -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/mbedtls/mbedtls/3rdparty/p256-m/p256-m -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/fatfs/diskio -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/fatfs/src -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/fatfs/vfs -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/wear_levelling/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_partition/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/sdmmc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_sdmmc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_gpio/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_sdspi/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/app_update/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bootloader_support/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bootloader_support/bootloader_flash/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_app_format/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_bootloader_format/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/console -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/vfs/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_vfs_console/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/openthread/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/openthread/openthread/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_uart/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/driver/deprecated -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/driver/i2c/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/driver/touch_sensor/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/driver/twai/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_ringbuf/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_pcnt/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_gptimer/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_mcpwm/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_ana_cmpr/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_i2s/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_sdio/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_dac/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_rmt/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_tsens/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_sdm/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_i2c/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_ledc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_parlio/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_usb_serial_jtag/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/nvs_flash/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/spi_flash/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_secure_cert_mgr/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/efuse/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/efuse/esp32c6/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__json_parser/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__jsmn/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/spiffs/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_http_client/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__json_generator/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/json/cJSON -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__mdns/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_encrypted_img/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_insights/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_diagnostics/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_mm/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/pthread/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/app_trace/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/wpa_supplicant/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/wpa_supplicant/port/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/wpa_supplicant/esp_supplicant/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_coex/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/unity/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/unity/unity/src -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/cmock/CMock/src -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/http_parser -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp-tls -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp-tls/esp-tls-crypto -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_adc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_adc/interface -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_adc/esp32c6/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_adc/deprecated/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_isp/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_cam/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_cam/interface -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_jpeg/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_driver_ppa/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_gdbstub/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_hid/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/tcp_transport/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_http_server/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_https_ota/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_https_server/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_psram/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_lcd/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_lcd/interface -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/protobuf-c/protobuf-c -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/protocomm/include/common -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/protocomm/include/security -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/protocomm/include/transports -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/protocomm/include/crypto/srp6a -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/protocomm/proto-c -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/esp_local_ctrl/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espcoredump/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espcoredump/include/port/riscv -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/idf_test/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/idf_test/include/esp32c6 -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/ieee802154/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/mqtt/esp-mqtt/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/nvs_sec_provider/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/wifi_provisioning/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-nn/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-nn/src/common -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__rmaker_common/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__cbor/port/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_diag_data_store/src/rtc_store -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_diag_data_store/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/chmorgan__esp-libhelix-mp3/libhelix-mp3/pub -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-modbus/freemodbus/common/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-zboss-lib/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-zigbee-lib/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__libsodium/libsodium/src/libsodium/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__libsodium/port_include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/dotprod/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/support/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/support/mem/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/windows/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/windows/hann/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/windows/blackman/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/windows/blackman_harris/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/windows/blackman_nuttall/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/windows/nuttall/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/windows/flat_top/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/iir/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/fir/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/math/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/math/add/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/math/sub/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/math/mul/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/math/addc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/math/mulc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/math/sqrt/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/matrix/mul/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/matrix/add/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/matrix/addc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/matrix/mulc/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/matrix/sub/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/matrix/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/fft/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/dct/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/conv/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/common/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/matrix/mul/test/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/kalman/ekf/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-dsp/modules/kalman/ekf_imu13states/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_modem/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_schedule/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__network_provisioning/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-serial-flasher/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp-serial-flasher/port -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_rcp_update/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__esp_rainmaker/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/espressif__qrcode/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/joltwallet__littlefs/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/fb_gfx/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/qio_qspi/include -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32/cores/esp32 -IC:/Users/niteris/.platformio/packages/framework-arduinoespressif32/variants/esp32c6 src/bitswap.cpp
@zackees
Copy link
Author

zackees commented Jan 9, 2025

I'm constantly hitting this every day.

@joba-1
Copy link

joba-1 commented Jan 9, 2025

I‘d do myself a favour and develop on WSL.
Works, and as a bonus generally builds much faster

@zackees
Copy link
Author

zackees commented Jan 9, 2025

We have users. https://github.com/fastled/fastled

@Jason2866
Copy link
Contributor

Jason2866 commented Jan 9, 2025

agree with @zackees it is a Platformio issue. When providing for Windows it has to work.
As it is now Windows is simply broken. No big project can be compiled when using Windows as OS
Despite the fact this example is from a fork (which is not the reason for failure) here Windows tells it has a problem, Normally unrelated error messages appear.
https://github.com/pioarduino/platform-espressif32/actions/runs/12690624596/job/35371889939

@joba-1
Copy link

joba-1 commented Jan 9, 2025

Today I read somewhere platformio is „just“ a package manager, now it is a build system :)

AFAIK platformio uses scons for that.
Scons has TempFileMunge command to shorten long command lines.
Maybe look into that?

@zackees
Copy link
Author

zackees commented Jan 10, 2025

I built all of FastLED's massive testing infrastructure on platformio. I built a web compiler for FastLED using platformio.

I've tuned platformio nearly to the maximum performance on linux through docker. It's so much faster than running on windows. Especially when you throw on ccache, then pre-warm it, then when it's ready to go full steam, the image get's frozen, and shipped to the cloud for distribution.

It's an amazing piece of technology - way better than Arduino in pretty much every conceivable way. I make no hesitation to say that FastLED would not be where it is today if it weren't for platformio.

@zackees
Copy link
Author

zackees commented Jan 14, 2025

agree with @zackees it is a Platformio issue. When providing for Windows it has to work.

As it is now Windows is simply broken. No big project can be compiled when using Windows as OS

Despite the fact this example is from a fork (which is not the reason for failure) here Windows tells it has a problem, Normally unrelated error messages appear.

https://github.com/pioarduino/platform-espressif32/actions/runs/12690624596/job/35371889939

@Jason2866

Since espressif doesn't want to pay Ivan for espressif support I think this issue will remain a constant problem.

What would the possibility be that espressif can fix this and push a patch?

@Jason2866
Copy link
Contributor

Jason2866 commented Jan 14, 2025

@zackees I can't speak for espressif nor for Platformio. If you want to see this fixed, you have to do yourself, or wait and hope Platformio is doing for there IDF users.

@valeros
Copy link
Member

valeros commented Jan 14, 2025

It's a WinAPI limitation. The CreateProcess function imposes a limit on the length of the CLI string that can be passed to a new process. Historically, this limit has been 32,768 characters (bytes), which includes the program name and the arguments.

The only workaround I'm aware of is to use special include flags that utilize a common include prefix. To test it out you can create an extra script, for example shorten_includes.py with the following content:

import os

from platformio import fs

Import("env")

platform = env.PioPlatform()

FRAMEWORK_DIR = fs.to_unix_path(
    platform.get_package_dir("framework-arduinoespressif32")
)

IS_INTEGRATION_DUMP = env.IsIntegrationDump()

def shorten_includes(env, node):
    if IS_INTEGRATION_DUMP:
       # Don't shorten include paths for IDE integrations
       return node
       
    includes = [fs.to_unix_path(inc) for inc in env.get("CPPPATH", [])]
    shortened_includes = []
    generic_includes = []
    for inc in includes:
        if inc.startswith(FRAMEWORK_DIR):
            shortened_includes.append(
                "-iwithprefix/"
                + fs.to_unix_path(os.path.relpath(inc, FRAMEWORK_DIR))
            )
        else:
            generic_includes.append(inc)
 
    return env.Object(
        node,
        CPPPATH=generic_includes,
        CCFLAGS=env["CCFLAGS"] + ["-iprefix", FRAMEWORK_DIR] + shortened_includes
    )

env.AddBuildMiddleware(shorten_includes)

Then enable this script in your platformio.ini, for example:

[env:lolin32]
platform = espressif32
framework = arduino
board = lolin32
monitor_speed = 115200
extra_scripts = 
    pre:shorten_includes.py

@Jason2866
Copy link
Contributor

@valeros Thx for the code snipplet. The approach is to invasive. More complex includes in libs are not working anymore.

@valeros
Copy link
Member

valeros commented Jan 15, 2025

More complex includes in libs are not working anymore.

@Jason2866 Mind sharing an example of a complex include that breaks the code above?

@Jason2866
Copy link
Contributor

Jason2866 commented Jan 15, 2025

@valeros
Copy link
Member

valeros commented Jan 16, 2025

@Jason2866 I believe I know what went wrong, but it's a bit hard to confirm based only on a scarce error message from the log, especially when a big project like Tasmota is compiled. Any chance you could put together a minimal example to reproduce the issue?

@Jason2866
Copy link
Contributor

@valeros I need a while. But yes i will try to setup a small example where the error happens.

@Jason2866
Copy link
Contributor

@valeros Here is a small example https://github.com/Jason2866/pio-shortpath

@valeros
Copy link
Member

valeros commented Jan 16, 2025

@Jason2866 Thanks for the example, helped a lot. Here is an improved version of the script:

import os

from platformio import fs

Import("env")

platform = env.PioPlatform()
target = env.BoardConfig().get("build.mcu", "esp32")

FRAMEWORK_SDK_DIR = fs.to_unix_path(
    os.path.join(
        platform.get_package_dir("framework-arduinoespressif32"),
        "tools",
        "sdk",
        target,
        "include",
    )
)

IS_INTEGRATION_DUMP = env.IsIntegrationDump()


def is_framework_subfolder(potential_subfolder):
    if (
        os.path.splitdrive(FRAMEWORK_SDK_DIR)[0]
        != os.path.splitdrive(potential_subfolder)[0]
    ):
        return False
    return os.path.commonpath([FRAMEWORK_SDK_DIR]) == os.path.commonpath(
        [FRAMEWORK_SDK_DIR, potential_subfolder]
    )


def shorthen_includes(env, node):
    if IS_INTEGRATION_DUMP:
        # Don't shorten include paths for IDE integrations
        return node

    includes = [fs.to_unix_path(inc) for inc in env.get("CPPPATH", [])]
    shortened_includes = []
    generic_includes = []
    for inc in includes:
        if is_framework_subfolder(inc):
            shortened_includes.append(
                "-iwithprefix/"
                + fs.to_unix_path(os.path.relpath(inc, FRAMEWORK_SDK_DIR))
            )
        else:
            generic_includes.append(inc)

    return env.Object(
        node,
        CPPPATH=generic_includes,
        CCFLAGS=env["CCFLAGS"]
        + ["-iprefix", FRAMEWORK_SDK_DIR]
        + shortened_includes,
        ASFLAGS=env["ASFLAGS"]
        + ["-iprefix", FRAMEWORK_SDK_DIR]
        + shortened_includes,
    )


env.AddBuildMiddleware(shorthen_includes)

@Jason2866
Copy link
Contributor

@valeros Thx for the advanced script. Included directly in the platform of my test fork branch.
It generates an error when compiling Tasmota in CI

ValueError: Can't mix absolute and relative paths:
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/platformio/builder/main.py", line 173:

The code where the error happens

  File "/home/runner/.platformio/platforms/espressif32/builder/frameworks/arduino.py", line 234:
    if is_framework_subfolder(inc):
  File "/home/runner/.platformio/platforms/espressif32/builder/frameworks/arduino.py", line 220:
    return os.path.commonpath([FRAMEWORK_SDK_DIR]) == os.path.commonpath(

https://github.com/Jason2866/platform-espressif32/actions/runs/12816490475/job/35737551124

File: https://github.com/Jason2866/platform-espressif32/blob/short_path/builder/frameworks/arduino.py

@valeros
Copy link
Member

valeros commented Jan 16, 2025

@Jason2866 I'm not sure how that relative path looks like, but a simple check should suffice:

def is_framework_subfolder(potential_subfolder):
    if not os.path.isabs(potential_subfolder):
        return False
    if (
        os.path.splitdrive(FRAMEWORK_SDK_DIR)[0]
        != os.path.splitdrive(potential_subfolder)[0]
    ):
        return False
    return os.path.commonpath([FRAMEWORK_SDK_DIR]) == os.path.commonpath(
        [FRAMEWORK_SDK_DIR, potential_subfolder]
    )

@Jason2866
Copy link
Contributor

@valeros Great! Tasmota does compile successfully with the script! Going to test the Windows example where compile always failed with the script! Thx so far. Will come back when i have done more tests!

@Jason2866
Copy link
Contributor

Jason2866 commented Jan 17, 2025

All tests successfull. Now code compiles on Windows where it failed before without using this script. Big thank you @valeros
The complete working shorten include path Snipplet.

import os

from platformio import fs

Import("env")

platform = env.PioPlatform()
target = env.BoardConfig().get("build.mcu", "esp32")

FRAMEWORK_SDK_DIR = fs.to_unix_path(
    os.path.join(
        platform.get_package_dir("framework-arduinoespressif32"),
        "tools",
        "sdk",
        target,
        "include",
    )
)

IS_INTEGRATION_DUMP = env.IsIntegrationDump()


def is_framework_subfolder(potential_subfolder):
    if not os.path.isabs(potential_subfolder):
        return False
    if (
        os.path.splitdrive(FRAMEWORK_SDK_DIR)[0]
        != os.path.splitdrive(potential_subfolder)[0]
    ):
        return False
    return os.path.commonpath([FRAMEWORK_SDK_DIR]) == os.path.commonpath(
        [FRAMEWORK_SDK_DIR, potential_subfolder]
    )


def shorthen_includes(env, node):
    if IS_INTEGRATION_DUMP:
        # Don't shorten include paths for IDE integrations
        return node

    includes = [fs.to_unix_path(inc) for inc in env.get("CPPPATH", [])]
    shortened_includes = []
    generic_includes = []
    for inc in includes:
        if is_framework_subfolder(inc):
            shortened_includes.append(
                "-iwithprefix/"
                + fs.to_unix_path(os.path.relpath(inc, FRAMEWORK_SDK_DIR))
            )
        else:
            generic_includes.append(inc)

    return env.Object(
        node,
        CPPPATH=generic_includes,
        CCFLAGS=env["CCFLAGS"]
        + ["-iprefix", FRAMEWORK_SDK_DIR]
        + shortened_includes,
        ASFLAGS=env["ASFLAGS"]
        + ["-iprefix", FRAMEWORK_SDK_DIR]
        + shortened_includes,
    )


env.AddBuildMiddleware(shorthen_includes)

@Jason2866
Copy link
Contributor

Use the script only for Windows. On Mac i see a dramatic increase in compile time. Probably the same happens under Linux (did not test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants