Yesterday I decided to switch my Raspberry Pi 4 from buster to bulleye.
I then installed the new operating system on a new sd card and after installing Home Assistant Core I realized that the Nest integration was not working.
I therefore decided to do a fresh installation of Core with a clean configuration file to eliminate possible conflicts and to be able to better read the log file.
The problem appears to be related to rustc / cargo compiling the “libcst” library.
I tried to install bulleye on a Raspberry Pi 3b too, but the result was the same.
All tests were carried out with Home Assistant Core 2021.12.10.
I also tried to install libcst directly with pip, but the compilation always stops.
The tests were done with both the official bulleye rustc package and the manual installation (“curl --proto ‘= https’ --tlsv1.2 -sSf https://sh.rustup.rs | sh”) .
After countless attempts, I couldn’t figure it out.
Below is the installation log:
2022-01-23 08:14:37 ERROR (SyncWorker_3) [homeassistant.util.package] Unable to install package google-nest-sdm==0.4.9: ERROR: Command errored out with exit status 1:
command: /srv/homeassistant/bin/python3.9 /srv/homeassistant/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp5qtll_02
cwd: /tmp/pip-install-9gq7wbtl/libcst
Complete output (419 lines):
...
...
Compiling libcst v0.1.0 (/tmp/pip-install-9gq7wbtl/libcst/native/libcst)
Running `rustc --crate-name libcst_native --edition=2018 libcst/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --crate-type rlib --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no --crate-type cdylib --cfg 'feature="default"' -C metadata=652054040f09fe98 --out-dir /tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps -L dependency=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps --extern chic=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libchic-b8f6abd9baa55c18.rlib --extern itertools=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libitertools-d71849f56d81c638.rlib --extern libcst_derive=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/liblibcst_derive-657f36087bfbd1f9.so --extern once_cell=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libonce_cell-afa4fce135686c24.rlib --extern paste=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libpaste-4d37a7c78de6fe6f.so --extern peg=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libpeg-8dc7507a03b678a5.rlib --extern pyo3=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libpyo3-98ce5ebd790580fe.rlib --extern regex=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libregex-24b6fd23a6579ee9.rlib --extern thiserror=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libthiserror-3d9b7581a7ecde1f.rlib`
error[E0658]: or-patterns syntax is experimental
--> libcst/src/parser/grammar.rs:3413:14
|
3413 | e @ (Expression::Integer(_) | Expression::Float(_)) => Ok(e),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information
error[E0658]: use of unstable library feature 'split_inclusive'
--> libcst/src/tokenizer/whitespace_parser.rs:84:26
|
84 | lines: input.split_inclusive(default_newline).collect(),
| ^^^^^^^^^^^^^^^
|
= note: see issue #72360 <https://github.com/rust-lang/rust/issues/72360> for more information
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.
error: could not compile `libcst`.
Caused by:
process didn't exit successfully: `rustc --crate-name libcst_native --edition=2018 libcst/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --crate-type rlib --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no --crate-type cdylib --cfg 'feature="default"' -C metadata=652054040f09fe98 --out-dir /tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps -L dependency=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps --extern chic=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libchic-b8f6abd9baa55c18.rlib --extern itertools=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libitertools-d71849f56d81c638.rlib --extern libcst_derive=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/liblibcst_derive-657f36087bfbd1f9.so --extern once_cell=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libonce_cell-afa4fce135686c24.rlib --extern paste=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libpaste-4d37a7c78de6fe6f.so --extern peg=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libpeg-8dc7507a03b678a5.rlib --extern pyo3=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libpyo3-98ce5ebd790580fe.rlib --extern regex=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libregex-24b6fd23a6579ee9.rlib --extern thiserror=/tmp/pip-install-9gq7wbtl/libcst/native/target/release/deps/libthiserror-3d9b7581a7ecde1f.rlib` (exit code: 1)
error: cargo failed with code: 101
----------------------------------------
ERROR: Failed building wheel for libcst
ERROR: Could not build wheels for libcst which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 20.2.4; however, version 21.3.1 is available.
You should consider upgrading via the '/srv/homeassistant/bin/python3.9 -m pip install --upgrade pip' command.
2022-01-23 08:29:21 ERROR (MainThread) [homeassistant.setup] Setup failed for nest: Requirements for nest not found: ['google-nest-sdm==0.4.9'].
I had the same issue just recently, turning on debug in the config, I found that an issue was occurring with the google_nest_adm package along with what you caught. I went to my older backup of the previous install and copied the /srv/homeassistant/lib/python3.9/site-packages/google* , libcst* files over along with libcst folder and rerunning the integration. I may have also installed the rust compiler, but not sure if this is actually needed when the other actions. By no means is the a solve all, but was a work around.
Thanks for sharing your solution. Using this work around, however, would cause me anxiety about a possible update of google-nest-sdm or libcst in future releases of Home Assistant, which would most likely cause the problem to recur.
The only stable solution I found on bulleye was to use the installation in docker, this way no problem arises.
However, since it is not the type of solution suitable for my needs, at the moment I preferred to go back to debian buster, waiting to find a definitive solution for bulleye.
I will continue to do some tests on a second raspberry pi 4 to see if I can manage it.
I agree, I switched to OS to rebuild my Raspberry Pi 4 since I wasn’t doing much that can’t be done there and it worked without any workarounds. It appears to be with the latest patches by the Raspberry team, as I tested on the available images for buster and bullseye in 32/64 full and lite version and Python version 3.9.2, 3.9.5, 3.10.2, with version of HA 2021.12.1, .9, .10, and dev with and without pre patching. All had the same errors. Hopefully there is a winning combination or a patch to correct it by either HA or Raspberry team.
I suspect the problem here is related to building grpcio – which is stuck to a very old version in home assistant, which I have been fixing and should be included in the next release. When we get home assistant running on a modern grpc, you likely should be able to install grpc from a binary wheel, hopefully. The problem is the grpcio wheels were built before python 3.9 was supported for example.
In the mean time… since you’re talking about hacking things, you can likely edit package_constraints.txt and remove the grpc stuff and pip3 install grpcio-1.43.0.
I removed grpcio from the package_constraints.txt file and installed grpcio-1.43.0 via pip3. Unfortunately, compiling libcst always fails in the same place. Trying to install libcst via pip3 the result is the same, rustc / cargo fail to compile.
As further proof, I created a venv environment in which I installed wheel and then libcst-0.4.0 via pip3. Also in this case the compilation stops at the same point (the same in the first post).
Ok I was thinking it might somehow skip that dependency if installing from a wheel. Does libcst dep come from pip install or after? I haven’t looked yet but curious what depends on libcst exactly
running ‘pip3 install libcst’ starts the compilation with rustc (on my raspberry pi 4 takes about 15 minutes) which fails on ‘libcst / src / parser / grammar.rs’ and ‘libcst / src / tokenizer / whitespace_parser.rs’.
Honestly I don’t know why google-nest-sdm depends on this library, I’ll try to understand why with the same Python version (3.9.5) on bullseys the compilation fails, while on Buster it works.
Currently I only have one version of rustc installed, the one present in the bullseye repositories. libcst 0.3.23 installation via pip3 is successful, without rustc compiling anything. I also installed google-nest-sdm without any problems. But when I start home assistant, try again to install the latest version of libcst to start google-nest-sdm, failing to compile
I modified package_constraints.txt and gen_requirements_all.py by copying the grpcio and libcst pin. Now I have no compilation errors, but the integration is not working anyway I report the log below:
2022-01-25 17:46:41 ERROR (MainThread) [homeassistant.setup] Setup failed for nest: Unable to import component: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /srv/homeassistant/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-arm-linux-gnueabihf.so)
ERROR: Command errored out with exit status 1: /srv/homeassistant/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gweqse1v/rpi-gpio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gweqse1v/rpi-gpio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-btdgey5k/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.9/RPi.GPIO Check the logs for full command output.
WARNING: You are using pip version 20.2.4; however, version 21.3.1 is available.
You should consider upgrading via the '/srv/homeassistant/bin/python3.9 -m pip install --upgrade pip' command.
2022-01-25 17:50:01 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/data_entry_flow.py", line 203, in async_init
flow, result = await task
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/data_entry_flow.py", line 221, in _async_init
flow = await self.async_create_flow(handler, context=context, data=data)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/config_entries.py", line 715, in async_create_flow
await async_process_deps_reqs(self.hass, self._hass_config, integration)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/setup.py", line 353, in async_process_deps_reqs
await requirements.async_get_integration_with_requirements(
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/requirements.py", line 85, in async_get_integration_with_requirements
await _async_process_integration(hass, integration, done)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/requirements.py", line 101, in _async_process_integration
await async_process_requirements(
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/requirements.py", line 164, in async_process_requirements
await _async_process_requirements(
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/requirements.py", line 196, in _async_process_requirements
raise RequirementsNotFound(name, [req])
homeassistant.requirements.RequirementsNotFound: Requirements for zha not found: ['zigpy-zigate==0.7.3'].
I should probably check the pins of other packages, but at this point I will wait for the next stable release to make other attempts, February is near.
Thank you so much for the support