esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
289 stars 36 forks source link

Cannot compile with 2022.12.0 #3904

Closed SVH-Powel closed 1 year ago

SVH-Powel commented 1 year ago

The problem

Compile fails with "sh: 1: xtensa-esp32-elf-g++: not found"

Which version of ESPHome has the issue?

2022.12.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2022.12.5

What platform are you using?

ESP32

Board

esp32dev

Component causing the issue

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Platform Manager: Installing platformio/espressif32 @ 5.2.0
INFO Installing platformio/espressif32 @ 5.2.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: espressif32@5.2.0 has been installed!
INFO espressif32@5.2.0 has been installed!
Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
INFO Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa-esp32@8.4.0+2021r2-patch3 has been installed!
INFO toolchain-xtensa-esp32@8.4.0+2021r2-patch3 has been installed!
Tool Manager: Installing platformio/framework-arduinoespressif32 @ ~3.20005.0
INFO Installing platformio/framework-arduinoespressif32 @ ~3.20005.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: framework-arduinoespressif32@3.20005.220925 has been installed!
INFO framework-arduinoespressif32@3.20005.220925 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.40201.0
INFO Installing platformio/tool-esptoolpy @ ~1.40201.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy@1.40201.0 has been installed!
INFO tool-esptoolpy@1.40201.0 has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
Compiling /data/luftkvalitet1/.pioenvs/luftkvalitet1/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/luftkvalitet1/.pioenvs/luftkvalitet1/src/esphome/components/api/api_connection.cpp.o] Error 127
========================= [FAILED] Took 371.07 seconds =========================

Additional information

No response

lazlykama commented 1 year ago

I read somewhere to try this:

I know, sounds stupid but worked for me, now I can compile my ESP32 nodes again.

ndfred commented 1 year ago

I tried to shell into the container and the link trick above was already done properly:

root@bagend:/config# ls -l /lib/ld-linux.so.3
lrwxrwxrwx 1 root root 38 May 17 01:21 /lib/ld-linux.so.3 -> /lib/arm-linux-gnueabihf/ld-linux.so.3

I then looked into disabling my arm64 kernel to see if that would help (also means I will max out at 4GB on my 8GB Pi I guess?), followed this guide and added arm_64bit=0 to the [pi4] section of /boot/config.txt and restarting. After a bit of a stressful reboot we are in 32 bit mode:

fred@bagend:~ $ uname -a
Linux bagend 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux

Got the ESPHome Docker container up and tried to update one of my nodes, that then downloads a new version of the toolchain and builds / installs no problem.

So that means the issue really is the kernel, and this pretty involved workaround works. I guess I will update all my nodes, and upgrade my system to Raspberry Pi OS 64 bit, however scary that sounds. I can say that this used to work for sure, so something broke recently, either in ESPHome or in the toolchains.