I am installing PIO using PIP on Python Alpine Docker python:3.12-alpine, and I get sh: xtensa-lx106-elf-g++: not found errors during compilation (ESP-IDF for ESP32 and Arduino for ESP8266).
Per google this happens when PIO install binaries for the wrong platform, and for Alpine this could be a glibc/musl issue.
Before I spend time trying to troubleshoot, is PIO and xtensa build chains supported on Alpine?
fc3b9f224885:~/.platformio/packages/toolchain-xtensa/bin# ldd xtensa-lx106-elf-gcc
/lib64/ld-linux-x86-64.so.2 (0x7fbf8a328000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fbf8a328000)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by xtensa-lx106-elf-gcc)
Error relocating xtensa-lx106-elf-gcc: __strcat_chk: symbol not found
Error relocating xtensa-lx106-elf-gcc: __snprintf_chk: symbol not found
Error relocating xtensa-lx106-elf-gcc: __vfprintf_chk: symbol not found
Error relocating xtensa-lx106-elf-gcc: __read_chk: symbol not found
Error relocating xtensa-lx106-elf-gcc: __printf_chk: symbol not found
Error relocating xtensa-lx106-elf-gcc: __fprintf_chk: symbol not found
Error relocating xtensa-lx106-elf-gcc: __sprintf_chk: symbol not found
fc3b9f224885:~/.platformio/packages/toolchain-xtensa-esp32s3/bin# ldd xtensa-esp32s3-elf-g++
/lib64/ld-linux-x86-64.so.2 (0x7f5d93469000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f5d931d0000)
libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f5d93469000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f5d93469000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f5d931ac000)
Error relocating xtensa-esp32s3-elf-g++: __strdup: symbol not found
Personally, I think the chances of Espressif and all other toolchain providers recompiling all their current and older packages to work with musl is near 0%. Simplest to just use the slightly bigger Ubuntu-based docker container to do the builds.