Giter Club home page Giter Club logo

meta-homeassistant's Introduction

This README file contains information on the contents of the homeassistant layer. It contains recipes to run https://home-assistant.io/ on a OE target.

If you need help or like to discuss a topic please join the #meta-homeassistant:matrix.org room on matrix.org.

Please see the corresponding sections below for details.

Quickstart

git clone https://git.yoctoproject.org/git/poky
cd poky
git clone https://github.com/openembedded/meta-openembedded.git
git clone https://github.com/meta-homeassistant/meta-homeassistant.git

. ./oe-init-build-env

bitbake-layers add-layer ../meta-openembedded/meta-oe
bitbake-layers add-layer ../meta-openembedded/meta-python
bitbake-layers add-layer ../meta-openembedded/meta-networking
bitbake-layers add-layer ../meta-homeassistant

bitbake core-image-homeassistant

runqemu qemux86 nographic

You should now be able to access Home Assistant via web browser usually under the address: http://192.168.7.2:8123

Using kas

The project provides files to quickly get started using kas.

The two main entry points are kas/homeassistant-master.yml and kas/homeassistant-mickledore.yml.

To build against latest Yocto master use:

kas build kas/homeassistant-master.yml

To build against latest Yocto mickledore use:

kas build kas/homeassistant-michledore.yml

Dependencies

URI: https://git.yoctoproject.org/git/poky
branch: master
revision: HEAD

URI: https://github.com/openembedded/meta-openembedded.git
branch: master
revision: HEAD

Why are these needed?

  • meta-oe : contains meta-python
  • meta-python : contains many of the required python3 packages
  • meta-networking : contains several networking oriented python3 packages

Build configuration

Home Assistant requires specific versions of some of its python dependencies. The recipe makes sure those dependencies are satisfied at root filesystem generation time but that doesn't give any gurantees that bitbake will pick a version that satisfies the version restriction in RDEPENDS. In order for the build to select the right versions, your distro file should include the version selection in conf/distro/include/ha-versions.inc when you are building python3-homeassistant. A sample distro (that can also be used as such, is provided - see homeassistant.conf).

Also to note is that packages in HomeAssistant update very rapidly. This means that, in order to properly build this, the project is up to date with the layer branches on which this layer depends. All missing recipes are backported into this layer to ensure functionality from meta-openembedded and poky.

Configuring HA

Note that with python3-homeassistant.bb only the critical components are directly installed via RDEPENDS. Any optional component is installed via RRECOMMENDS. So if you are missing something you can enforce it by specifically adding it to an IMAGE_INSTALL.

Layer structure

The layer is structured in the following way:

  • recipes-homeassistant/homeassistant: contains the core recipe needed to run homeassistant via Yocto. Moreover it contains other recipe for components which are hosted here: https://github.com/home-assistant.
  • recipes-homeassistant/home-assistant-libs: contains recipes for components which are hosted by HA themselves at: https://github.com/home-assistant-libs
  • recipes-homeassistant/nabucasa: contains recipes for the HA cloud integration and which are hosted by HA at: https://github.com/NabuCasa/
  • recipes-homeassistant/images: contains sample images to build

The recipes-devtools folder then contains all Yocto python recipes which do not fit the above categories. Most often these are other python dependencies.

Contributing

Please submit any patches against the homeassistant as Pull Requests on Github.

Maintainers

meta-homeassistant's People

Contributors

andr2000 avatar andred avatar bachp avatar bluelightning avatar bufferoverflow avatar gerry546 avatar matthiasmichel avatar maxinbjohn avatar mkilivan avatar moto-timo avatar persuader72 avatar pieterpalmers avatar rzr avatar sajal-wr avatar sbabic avatar stefan-schmidt avatar vermaete avatar villemoes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meta-homeassistant's Issues

[RFC] Dunfell support

There is no current dunfell support for meta-homeassistant and the build won't succeed as multiple dependencies are not in place on the respective dunfell meta-oe branch (only in later revisions). The dunfell is an LTS version so supporting it would make sense as more products will tend to gravitate around this version.

Proposal: introduce the dunfell branch in meta-homeassistant that backports or introduces all the dependencies/functionality not available in the dunfell branches of the dependencies. eg. pytthon modules available in meta-python>dunfell but not in the dunfell branch.

I am available to push such work if the maintainers are willing to fork the current master as a dunfell branch.

Yocto 4.3 (mickledore) is EOL

This layer currently only supports mickledore on main.

However mickledore is EOL since December 2023.

I suggest we try to track master of poky in order to be ready for Yocto 5.0 which will be another LTS.

Expand parse-requirements.py to also parse HA requirements.txt

Currently the script to parse the requirements is a good start but we miss the requirements of HA itself which are defined in requirements.txt.

Suggestion is to expand parse-requirements.py to also parse this and include the results in the csv file.

Dependecies in master brach

Hi I pulled last master revision but I have problems with the following recipes in pyro. Can I add the corresponding backports?

requested python3-jinja2 (>= 2.9.6)
pyro python3-jinja2 (>= 2.9.5) \

requested python3-chardet (= 3.0.4)
pyro python3-chardet (= 3.0.2) \

requested python3-paho-mqtt (= 1.3.0)
pyro python3-paho-mqtt (= 1.2) \

requested python3-sqlalchemy (>= 1.1.13)
pyro python3-sqlalchemy (>= 1.1.9) \

The python3-python-telegram-bot recipe task failed

$ bitbake python3-python-telegram-bot

| Copying python_telegram_bot.egg-info to build/bdist.linux-x86_64/wheel/python_telegram_bot-11.1.0-py3.10.egg-info
| running install_scripts
| error: [Errno 2] No such file or directory: 'LICENSE.dual'
| ERROR: 'python3 setup.py bdist_wheel ' execution failed.
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/user/Documents/projects/meta-homeassistant/recipes-integrations/python/python3-python-telegram-bot_11.1.0.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1502 tasks of which 1484 didn't need to be rerun and 1 failed.

Tested branches: master, kirkstone

python3-gtts-2.2.4 gives do_unpack issue

Warning on main branch on clean build:

WARNING: python3-gtts-2.2.4-r0 do_unpack: QA Issue: python3-gtts: SRC_URI uses unstable GitHub/GitLab archives, convert recipe to use git protocol [src-uri-bad]

Update to recent version of homeassistant

Currently latest version of homeassistant which is build is a year old version and it errors during running when checking the cli output.

Proposal:
Update to more recent version of homeassistant and start with a clean(er?) slate this way.

RDEPENDS

Hi,
I'm having problem with dependencies in ha recipe.
In recipe ha have dependency:
${PYTHON_PN}-attrs (>=19.1.0) \

and in newest meta-python layers:
zeus: python-attrs - 19.2.0,
master: python-attrs - 19.3.0

everything is ok by the time you run it, then I have this error:
pkg_resources.DistributionNotFound: The 'attrs==19.1.0' distribution was not found and is required by homeassistant
so, that means ha requires python-attrs version equal 19.1.0, but layers have newer versions.

I see that now ha layer is only compatybile with warrior branch.
So meta-homeassistant require downgrade to warrior branch (meta-python)?

Regards

Not running on custom hardware

Hello

Iā€™m busy with building Home-Assistant on my own hardware (not RPI) now Iā€™m stuck.
I cloned the git of home-assistant and add IMAGE_INSTALL += " python3-homeassistant" to my local config file.
Add the BBlayer and stuff..
After building and booting I got a web GUI, when I try to login after configuration. I got error, Cannot save during onboarding initial setup.
How can I solve this problem?

python3-ha-av_10.0.0.bb:do_compile Failure

Hello,

I am building homeassistant with Yocto and everything compiles successfully apart from the python3-ha-av_10.0.0.
This appears to be an issue even for those installing the package manually as discussed and solved here: https://community.home-assistant.io/t/unable-to-install-package-ha-av/466286/31

I am using the Mickledore branch.
Has anyone successfully built this recently? and how can I solve this issue? The rest of the build has completed successfully.
Thanks

Problem with RDEPENDS

Hi, I'm having a weird problem with dependencies in python3-homeassistant_0.XX.Y.bb. I dont' know if the problem is in the way I configured my yocto build system.

In python3-homeassistant_0.51.2.bb Many packages declare a specific package version matched with an = operator (ex: python3-aiohttp (= 2.2.5)).

My packaging system (I using opkg) is adding a recipe revision (PR variable) at the end of each built package. In my case python3-aiohttp package is called as python3-aiohttp_2.2.5-r0.
This difference is causing the abort of the task do_rootfs complaining a 'nothing provides ...' error.
Ex. nothing provides python3-requests = 2.14.2 needed by python3-homeassistant-0.51.2

I temporarily solved the problem creating a parallel copy of the python3-homeassistant_0.51.2.bb recipe changing all operators from = to >=. Ex python3-aiohttp (= 2.2.5) has been changed in python3-aiohttp (>= 2.2.5)

Do you now if there is a way to configure the yocto build system in order to ignore the recipe revision field when is checking the package dependencies?

Regards

Add LAYERRECOMMENDS for swupdate

This coincidentally triggered a new update on layerindex which highlights that we should have LAYERRECOMMENDS for meta-swupdate:

https://layers.openembedded.org/layerindex/updates/38998/

ERROR: Unable to read /opt/workdir/https___github_com_bachp_meta-homeassistant_git/dynamic-layers/swupdate/recipes-images/swus/update-image-core-image-homeassistant.bb: Traceback (most recent call last): File "/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/command.py", line 91, in runCommand result = command_method(self, commandline) File "/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/command.py", line 571, in parseRecipeFile envdata = command.cooker.databuilder._parse_recipe(config_data, fn, appendfiles, mc)[''] File "/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/cookerdata.py", line 505, in _parse_recipe bb_data = bb.parse.handle(bbfile, bb_data) File "/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/parse/__init__.py", line 107, in handle return h['handle'](fn, data, include, baseconfig) File "/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/parse/parse_py/BBHandler.py", line 137, in handle statements.eval(d) File "/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/parse/ast.py", line 20, in eval statement.eval(data) File "/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/parse/ast.py", line 314, in eval bb.parse.BBHandler.inherit(self.classes, self.filename, self.lineno, data) File "/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/parse/parse_py/BBHandler.py", line 67, in inherit raise ParseError("Could not inherit file %s" % (file), fn, lineno) bb.parse.ParseError: ParseError at /opt/workdir/https___github_com_bachp_meta-homeassistant_git/dynamic-layers/swupdate/recipes-images/swus/update-image-core-image-homeassistant.bb:6: Could not inherit file classes/swupdate.bbclass

I have added meta-swupdate to the meta-homeassistant:mickledore LayerBranch to avoid it throwing an error on the next update run, but if we added the LAYERRECOMMENDS it would be automatically detected I believe.

https://layers.openembedded.org/layerindex/branch/mickledore/layer/meta-homeassistant/

Originally posted by @moto-timo in #99 (comment)

[nanbield] Is `usrmerge` DISTRO_FEATURE now required for `udev` (eudev)?

2024-01-18 18:41:00 - ERROR - Command "/home/runner/work/meta-homeassistant/meta-homeassistant/build$ /home/runner/work/meta-homeassistant/meta-homeassistant/poky/bitbake/bin/bitbake -c build core-image-homeassistant" failed --- Error summary --- ERROR: Nothing RPROVIDES 'udev' (but /home/runner/work/meta-homeassistant/meta-homeassistant/build/../poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb RDEPENDS on or otherwise requires it) systemd RPROVIDES udev but was skipped: missing required distro feature 'usrmerge' (not in DISTRO_FEATURES) eudev RPROVIDES udev but was skipped: conflicting distro feature 'systemd' (in DISTRO_FEATURES) ERROR: Required build target 'core-image-homeassistant' has no buildable providers. Missing or unbuildable dependency chain was: ['core-image-homeassistant', 'packagegroup-core-boot', 'udev']

https://github.com/moto-timo/meta-homeassistant/actions/runs/7574509854/job/20629038310

Layer structuring

Discussed in #76

Originally posted by Gerry546 July 27, 2023
I personally have a lot of trouble to keep track of all the individual recipes from python which are required as dependencies for HA to run.

Now python recipes are placed in two folders in the layer:

  • recipes-devtools/python
  • recipes-homeassistant/homeassistant

My suggestion is to structure this a bit different. Also to make it more easy to maintain the layer since it will be easier for people to understand the structuring of the layer.

My suggestion would be:

  • recipes-homeassistant/homeassistant:
    • for the recipe of home assistant itself
  • recipes-homeassistant/homeassistant-core-deps
    • there are several dependency recipes which are directly needed to be able to even boot HA. I would put them separate since they are also likely to change in version.
  • recipes-homeassistant/homeassistant-component-deps
    • most HA components actually use very specifically developed python modules, and are also prone to frequent updates.
  • recipes-devtools/python:
    • there are multiple python recipes which, in turn, have dependencies on other python recipes. Not all of these are provided in OE or Poky. I would place these secondary recipes in the regular layer ordering.

Dunfell

Dunfell doesn't support python3-requests-toolbelt. That recipe is supported only from Yocto 3.2.

https://layers.openembedded.org/layerindex/recipe/132815/

Could I insert this recipe on Yocto 3.1 Dunfell ?

ERROR: Nothing RPROVIDES 'python3-requests-toolbelt' (but /home/.../DIP-Yocto-Linux-Distro/.../sources/meta-homeassistant/recipes-devtools/python/python3-acme_0.39.0.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-requests-toolbelt' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-requests-toolbelt']

Warning: python3-gtts-2.2.4-r0

Currently python3-gtts-2.2.4-ro gives the following error:

WARNING: python3-gtts-2.2.4-r0 do_unpack: QA Issue: python3-gtts: SRC_URI uses unstable GitHub/GitLab archives, convert recipe to use git protocol [src-uri-bad]

Create a backports layers

When needing to support a non-master branch it becomes necessary to have a backports layer for (Python) recipes which are already in upstream master but not in the respective supported meta-homeassistant branch.

build failure - python3-ssdp

anyone proven this actually builds lately ?? if so what layers ?

build failure - python3-ssdp

WARNING: You have included the meta-security layer, but 'security' has not been enabled in your DISTRO_FEATURES. Some bbappend files and preferred version setting may not take effect. See the meta-security README for details on enabling security support.
Loading cache: 100% |###########################################################################################################################| Time: 0:00:00
Loaded 4185 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "2.2.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "neon-22.04"
TARGET_SYS = "x86_64-oe-linux"
MACHINE = "qemux86-64"
DISTRO = "nodistro"
DISTRO_VERSION = "nodistro.0"
TUNE_FEATURES = "m64 core2"
TARGET_FPU = ""
meta = "langdale:62b894d75fb3361ed4d5473ae69188bce390980a"
meta-oe
meta-python
meta-networking
meta-perl = "langdale:e7c754778edb25f35896137c8b174669392c492a"
meta-security = "langdale:2aa48e6f4e519abc7d6bd56da2c067309a303e80"
meta-homeassistant = "kirkstone:93ad02563c302d788d3d41086411b71ede259875"

Initialising tasks: 100% |######################################################################################################################| Time: 0:00:01
Sstate summary: Wanted 804 Local 0 Mirrors 0 Missed 804 Current 880 (0% match, 52% complete)
NOTE: Executing Tasks
ERROR: python3-anyio-3.5.0-r0 do_compile: ExecutionError('/home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-anyio/3.5.0-r0/temp/run.do_compile.3499078', 1, None, None)
ERROR: Logfile of failure stored in: /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-anyio/3.5.0-r0/temp/log.do_compile.3499078
Log data follows:
| DEBUG: Executing shell function do_compile
| Missing build dependencies:
| - setuptools_scm[toml] >= 3.4
| WARNING: /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-anyio/3.5.0-r0/temp/run.do_compile.3499078:157 exit 1 from 'nativepython3 -m picobuild --source /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-anyio/3.5.0-r0/anyio-3.5.0 --dest /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-anyio/3.5.0-r0/dist --wheel'
| WARNING: Backtrace (BB generated script):
| #1: python_pep517_do_compile, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-anyio/3.5.0-r0/temp/run.do_compile.3499078, line 157
| #2: do_compile, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-anyio/3.5.0-r0/temp/run.do_compile.3499078, line 152
| #3: main, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-anyio/3.5.0-r0/temp/run.do_compile.3499078, line 161
ERROR: Task (/home/dingo/HA/openembedded-core/meta-homeassistant/recipes-devtools/python/python3-anyio_3.5.0.bb:do_compile) failed with exit code '1'
ERROR: python3-aiodiscover-1.4.11-r0 do_compile: ExecutionError('/home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-aiodiscover/1.4.11-r0/temp/run.do_compile.3499020', 1, None, None)
ERROR: Logfile of failure stored in: /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-aiodiscover/1.4.11-r0/temp/log.do_compile.3499020
Log data follows:
| DEBUG: Executing shell function do_compile
| Missing build dependencies:
| - pytest-runner>=5.2
| WARNING: /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-aiodiscover/1.4.11-r0/temp/run.do_compile.3499020:157 exit 1 from 'nativepython3 -m picobuild --source /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-aiodiscover/1.4.11-r0/aiodiscover-1.4.11 --dest /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-aiodiscover/1.4.11-r0/dist --wheel'
| WARNING: Backtrace (BB generated script):
| #1: python_pep517_do_compile, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-aiodiscover/1.4.11-r0/temp/run.do_compile.3499020, line 157
| #2: do_compile, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-aiodiscover/1.4.11-r0/temp/run.do_compile.3499020, line 152
| #3: main, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-aiodiscover/1.4.11-r0/temp/run.do_compile.3499020, line 161
ERROR: Task (/home/dingo/HA/openembedded-core/meta-homeassistant/recipes-devtools/python/python3-aiodiscover_1.4.11.bb:do_compile) failed with exit code '1'
ERROR: python3-ssdp-1.0.1-r0 do_compile: 'python3 setup.py bdist_wheel ' execution failed.
ERROR: python3-ssdp-1.0.1-r0 do_compile: ExecutionError('/home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/temp/run.do_compile.3499121', 1, None, None)
ERROR: Logfile of failure stored in: /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/temp/log.do_compile.3499121
Log data follows:
| DEBUG: Executing shell function do_compile
| /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'author-email' will not be supported in future versions. Please use the underscore name 'author_email' instead
| warnings.warn(
| /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
| warnings.warn(
| /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'description-content-type' will not be supported in future versions. Please use the underscore name 'description_content_type' instead
| warnings.warn(
| /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'home-page' will not be supported in future versions. Please use the underscore name 'home_page' instead
| warnings.warn(
| /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py:262: UserWarning: Unknown distribution option: 'pbr'
| warnings.warn(msg)
| error: Multiple top-level packages discovered in a flat-layout: ['ssdp', 'patches'].
|
| To avoid accidental inclusion of unwanted files or directories,
| setuptools will not proceed with this build.
|
| If you are trying to create a single distribution with multiple packages
| on purpose, you should not rely on automatic discovery.
| Instead, consider the following options:
|
| 1. set up custom discovery (find directive with include or exclude)
| 2. use a src-layout
| 3. explicitly set py_modules or packages with a list of names
|
| To find more information, look for "package discovery" on setuptools docs.
| ERROR: 'python3 setup.py bdist_wheel ' execution failed.
| WARNING: /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/temp/run.do_compile.3499121:173 exit 1 from 'exit 1'
| WARNING: Backtrace (BB generated script):
| #1: bbfatal_log, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/temp/run.do_compile.3499121, line 173
| #2: setuptools3_do_compile, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/temp/run.do_compile.3499121, line 163
| #3: do_compile, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/temp/run.do_compile.3499121, line 152
| #4: main, /home/dingo/HA/openembedded-core/build/tmp-glibc/work/core2-64-oe-linux/python3-ssdp/1.0.1-r0/temp/run.do_compile.3499121, line 177
ERROR: Task (/home/dingo/HA/openembedded-core/meta-homeassistant/recipes-devtools/python/python3-ssdp_1.0.1.bb:do_compile) failed with exit code '1'

maturin? incorrectly names orjson .so

When building this layer against musl, the python3-orjson .so is incorrectly named:

  • orjson.cpython-311-aarch64-linux-musl.so
    whereas it should be
  • orjson.cpython-311-aarch64-linux-gnu.so
    according to how yocto configures python3

This mismatch means that the python3 interpreter can't import orjson of course.

<prefix>/python3-orjson/3.9.1-r0/recipe-sysroot/usr/lib/python-sysconfigdata and <prefix>/python3-orjson/3.9.1-r0/recipe-sysroot/usr/python-target-config/ and

import sysconfig
sysconfig.get_config_var('SOABI')

all seem to agree on the expected .cpython-311-aarch64-linux-gnu.so suffix.

The incorrect suffix is created during do_compile of python3-orjson, as that's what the generated <prefix>/python3-orjson/3.9.1-r0/build/target/wheels/orjson-3.9.1-cp311-cp311-linux_aarch64.whl contains.

Any ideas? (For now I'm just renaming the file as part of do_install, but of course that's not the real solution :-)

Quick Start instructions fail to build

Reproduce the issue

Follow the quick start instructions.

Expected result

Should successfully build the image.

Result

I got the following error.

ERROR: Layer homeassistant is not compatible with the core layer which only supports these series: gatesgarth (layer is compatible with warrior zeus)

Notes

Note that the quick start instructions check out the HEAD of the master branch. The current version of the openembedded layer is gatesgarth and as the error message states meta-homeassistant is not compatible with this version. See conf/layer.conf file

LAYERSERIES_COMPAT_homeassistant = "warrior zeus"

I have manually switched to the zeus branch and I got this error this time:

Parsing recipes: 100% |########################################################################################################################################| Time: 0:01:13
Parsing of 2411 .bb files complete (0 cached, 2411 parsed). 3600 targets, 119 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'python3-xmltodict' (but /git/home-assistant/openembedded-core/meta-homeassistant/recipes-homeassistant/homeassistant/python3-homeassistan
t_0.107.6.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-xmltodict' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-xmltodict']
NOTE: Runtime target 'python3-homeassistant' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-homeassistant', 'python3-xmltodict']
ERROR: Required build target 'core-image-homeassistant' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-homeassistant', 'python3-homeassistant', 'python3-xmltodict']

Workaround/Fix

Master branch of meta-homeassistant doesn't seem to be compatible with the older version of the core layer any more. But it successfully builds when gatesgarth was added to compatible layers list in conf/layer.conf.

LAYERSERIES_COMPAT_homeassistant = "gatesgarth"

Note I haven't tried using the dunfell branch.

Automate home-assistant recipe update

Currently updating the home-assistant recipe to a new version requires a lot of manual work.

The following steps should at least be automated:

  • Extract the dependencies from home assistant and try to map them to the corresponding OE packages
  • Check what dependencies don't meet their required versions

Parts that might not be automated:

  • Verify if home-assistant works with newer dependencies, if they are in OE, and submit a PR if yes

Inspiration

nixpkgs already has scripts for some of these tasks in place. We should look there for inspiration.

Rethink layer structure

Currently the structure is nicely followed for all the python dependencies that they are put into recipes-devtools/python.
However as a start for a bigger goal to make it more easier to maintain HA components I would propose to change that recipes are actually structured more into components (as in HA each individual component also it's own manifest.json).

I would like to know what other people think of this?

python3-aioshelly_6.0.0 throws error when homeassistant boots

Upgraded python3-aioshelly to 6.0.0 for 2023.9.0 release.
Throws an error in the background.

Places like here have reported a similar error like below.

Nov 06 21:42:12 reterminal hass[956]: 2023-11-06 21:42:12.133 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform homeassistant.components.shelly.config_flow
Nov 06 21:42:12 reterminal hass[956]: Traceback (most recent call last):
Nov 06 21:42:12 reterminal hass[956]: File "/usr/lib/python3.11/site-packages/homeassistant/loader.py", line 838, in get_platform
Nov 06 21:42:12 reterminal hass[956]: cache[full_name] = self._import_platform(platform_name)
Nov 06 21:42:12 reterminal hass[956]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 06 21:42:12 reterminal hass[956]: File "/usr/lib/python3.11/site-packages/homeassistant/loader.py", line 855, in _import_platform
Nov 06 21:42:12 reterminal hass[956]: return importlib.import_module(f"{self.pkg_path}.{platform_name}")
Nov 06 21:42:12 reterminal hass[956]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 06 21:42:12 reterminal hass[956]: File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module
Nov 06 21:42:12 reterminal hass[956]: return _bootstrap._gcd_import(name[level:], package, level)
Nov 06 21:42:12 reterminal hass[956]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 06 21:42:12 reterminal hass[956]: File "", line 1204, in _gcd_import
Nov 06 21:42:12 reterminal hass[956]: File "", line 1176, in _find_and_load
Nov 06 21:42:12 reterminal hass[956]: File "", line 1126, in _find_and_load_unlocked
Nov 06 21:42:12 reterminal hass[956]: File "", line 241, in _call_with_frames_removed
Nov 06 21:42:12 reterminal hass[956]: File "", line 1204, in _gcd_import
Nov 06 21:42:12 reterminal hass[956]: File "", line 1176, in _find_and_load
Nov 06 21:42:12 reterminal hass[956]: File "", line 1147, in _find_and_load_unlocked
Nov 06 21:42:12 reterminal hass[956]: File "", line 690, in _load_unlocked
Nov 06 21:42:12 reterminal hass[956]: File "", line 940, in exec_module
Nov 06 21:42:12 reterminal hass[956]: File "", line 241, in _call_with_frames_removed
Nov 06 21:42:12 reterminal hass[956]: File "/usr/lib/python3.11/site-packages/homeassistant/components/shelly/init.py", line 40, in
Nov 06 21:42:12 reterminal hass[956]: from .coordinator import (
Nov 06 21:42:12 reterminal hass[956]: File "/usr/lib/python3.11/site-packages/homeassistant/components/shelly/coordinator.py", line 11, in
Nov 06 21:42:12 reterminal hass[956]: from aioshelly.ble import async_ensure_ble_enabled, async_stop_scanner
Nov 06 21:42:12 reterminal hass[956]: File "/usr/lib/python3.11/site-packages/aioshelly/ble/init.py", line 8, in
Nov 06 21:42:12 reterminal hass[956]: from bluetooth_data_tools import BLEGAPAdvertisement, parse_advertisement_data
Nov 06 21:42:12 reterminal hass[956]: File "/usr/lib/python3.11/site-packages/bluetooth_data_tools/init.py", line 7, in
Nov 06 21:42:12 reterminal hass[956]: from .gap import (
Nov 06 21:42:12 reterminal hass[956]: File "src/bluetooth_data_tools/gap.py", line 99, in init bluetooth_data_tools.gap
Nov 06 21:42:12 reterminal hass[956]: TypeError: 'type' object is not subscriptable

meta-python-mixin URL change?

git clone https://booting.oniroproject.org/distro/meta-python-mixin.git does not seem to exist anymore.

Should it be https://gitlab.eclipse.org/eclipse/oniro-core/meta-python-mixin instead?

Package componenes as separate packages

I would keep everything in one recipe, we can keep the structure as you proposed, but create multiple packages.

One would be python3-homeassistant-cast. We can add dependeincies and maybe even specific files into this package via:

RDEPENDS:${PN}-cast += "..."
FILES:${PN}-cast += "..."

To make it easy for people to install the complete home assistant package we would add

RRECOMMENDS:${PN} += "${PN}-cast..."

So in the image if you specify:

IMAGE_INSTALL = "python3-homeassistant"

You get the complete home assistant installation including all components.

However if you set NO_RECOMMENDATIONS="1", you could manually install the components you want:

IMAGE_INSTALL = "python3-homeassistant python3-homeassistant-cast"

Originally posted by @bachp in #68 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.