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

homeassistant: fix tradfri integration #5869

Merged
merged 5 commits into from
Sep 7, 2023

Conversation

hgy59
Copy link
Contributor

@hgy59 hgy59 commented Sep 6, 2023

Description

Fixes #5856

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix

- add dtlssocket wheel (runtime dependecy of tradfri)
@hgy59
Copy link
Contributor Author

hgy59 commented Sep 7, 2023

@th0ma7 I need your assistance. cross/dtlssocket fails to build for spk/homeassistant (spk/python311 was built before):

===>  Setting-up toolchain
env make --no-print-directory cmake_vars > /spksrc/toolchain/syno-x64-7.1/work/tc_vars.cmake 2>/dev/null;
env make --no-print-directory meson_vars > /spksrc/toolchain/syno-x64-7.1/work/tc_vars.meson 2>/dev/null;
env make --no-print-directory tc_vars > /spksrc/toolchain/syno-x64-7.1/work/tc_vars.mk 2>/dev/null;
===>  Processing dependencies of homeassistant
===>  Makefile Makefile - Kopie PLIST build-x64-7.1.log src work-x64-7.1
===>  Makefile Makefile - Kopie PLIST build-x64-7.1.log src work-x64-7.1 Use existing shared objects from python 3.11
===>  Makefile Makefile - Kopie PLIST build-x64-7.1.log src work-x64-7.1 PATH: /spksrc/spk/python311/work-x64-7.1
===>  Makefile Makefile - Kopie PLIST build-x64-7.1.log src work-x64-7.1
# EXCEPTION: Ensure zlib is always built locally
# EXCEPTION: Do not symlink cross/* wheel builds
grep: ../../===>: No such file or directory
grep: Setting-up: No such file or directory
grep: toolchain/Makefile: No such file or directory
rm -fr work-*/DTLSSocket*
       work-*/.DTLSSocket-*
make[3]: Entering directory '/spksrc/cross/dtlssocket'
===>  Downloading files for DTLSSocket
===>    File DTLSSocket-0.1.15.tar.gz already downloaded
===>  Verifying files for DTLSSocket
===>    Checking sha1sum of file DTLSSocket-0.1.15.tar.gz
===>    Checking sha256sum of file DTLSSocket-0.1.15.tar.gz
===>    Checking md5sum of file DTLSSocket-0.1.15.tar.gz
/spksrc/cross/dtlssocket/../../distrib/DTLSSocket-0.1.15.tar.gz
===>  Processing dependencies of DTLSSocket
make[4]: Entering directory '/spksrc/cross/cython'
===>  Downloading files for cython
===>    File cython-0.29.24.tar.gz already downloaded
===>  Verifying files for cython
===>    Checking sha1sum of file cython-0.29.24.tar.gz
===>    Checking sha256sum of file cython-0.29.24.tar.gz
===>    Checking md5sum of file cython-0.29.24.tar.gz
/spksrc/cross/cython/../../distrib/cython-0.29.24.tar.gz
===>  Processing dependencies of cython
===>  Extracting for cython
tar -xzpf /spksrc/cross/cython/../../distrib/cython-0.29.24.tar.gz -C /spksrc/spk/homeassistant/work-x64-7.1
===>  Patching for cython
===>  Configuring for cython
===>  - Configure ARGS:
===>  - Install prefix: /var/packages/homeassistant/target
===>  - Install prefix [var]: /var/packages/homeassistant/var
===>  Compiling for cython
Unable to find pgen, not compiling formal grammar.
running build_ext
Compiling /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Plex/Scanners.py because it changed.
Compiling /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Plex/Actions.py because it changed.
Compiling /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Compiler/Scanning.py because it changed.
Compiling /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Compiler/Visitor.py because it changed.
Compiling /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Compiler/FlowControl.py because it changed.
Compiling /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Runtime/refnanny.pyx because it changed.
Compiling /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Compiler/FusedNode.py because it changed.
Compiling /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Tempita/_tempita.py because it changed.
[1/8] Cythonizing /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Compiler/FlowControl.py
[2/8] Cythonizing /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Compiler/FusedNode.py
[3/8] Cythonizing /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Compiler/Scanning.py
[4/8] Cythonizing /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Compiler/Visitor.py
[5/8] Cythonizing /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Plex/Actions.py
[6/8] Cythonizing /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Plex/Scanners.py
[7/8] Cythonizing /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Runtime/refnanny.pyx
[8/8] Cythonizing /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Tempita/_tempita.py
building 'Cython.Plex.Scanners' extension
creating build
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/spksrc
creating build/temp.linux-x86_64-cpython-311/spksrc/spk
creating build/temp.linux-x86_64-cpython-311/spksrc/spk/homeassistant
creating build/temp.linux-x86_64-cpython-311/spksrc/spk/homeassistant/work-x64-7.1
creating build/temp.linux-x86_64-cpython-311/spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24
creating build/temp.linux-x86_64-cpython-311/spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython
creating build/temp.linux-x86_64-cpython-311/spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Plex
/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/include -I/spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L /spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/lib -I /spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/include -I/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/include -I/spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L /spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/lib -I /spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/include -I/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/include -I/spksrc/spk/homeassistant/work-x64-7.1/install/var/packages/homeassistant/target/include -I/spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/include -I/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/include -I/spksrc/spk/homeassistant/work-x64-7.1/install/var/packages/homeassistant/target/include -I/spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/include -fPIC -I/spksrc/spk/homeassistant/work-x64-7.1/install/var/packages/homeassistant/target/include -I/spksrc/spk/python311/work-x64-7.1/crossenv/cross/include -I/spksrc/spk/python311/work-x64-7.1/install/var/packages/python311/target/include/python3.11 -c /spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-cpython-311/spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Plex/Scanners.o
/spksrc/spk/homeassistant/work-x64-7.1/cython-0.29.24/Cython/Plex/Scanners.c:213:12: fatal error: longintrepr.h: No such file or directory
   #include "longintrepr.h"
            ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/spksrc/toolchain/syno-x64-7.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc' failed with exit code 1
make[4]: *** [../../mk/spksrc.python-module.mk:34: compile_python_module] Error 1
make[4]: Leaving directory '/spksrc/cross/cython'
make[3]: *** [../../mk/spksrc.depend.mk:54: depend_target] Error 2
make[3]: Leaving directory '/spksrc/cross/dtlssocket'
make[2]: *** [../../mk/spksrc.depend.mk:54: depend_target] Error 2
make[2]: Leaving directory '/spksrc/spk/homeassistant'
make[1]: *** [../../mk/spksrc.spk.mk:691: build-arch-x64-7.1] Error 1
make[1]: Leaving directory '/spksrc/spk/homeassistant'
make: *** [../../mk/spksrc.spk.mk:685: arch-x64-7.1] Error 2
user@homeassistant_tradfri:/spksrc/spk/homeassistant$

@th0ma7
Copy link
Contributor

th0ma7 commented Sep 7, 2023

I'll try to reproduce on my end. Although from the get go something's fishy with this (may just be missing 2>/dev/null):

# EXCEPTION: Do not symlink cross/* wheel builds
grep: ../../===>: No such file or directory
grep: Setting-up: No such file or directory
grep: toolchain/Makefile: No such file or directory
rm -fr work-*/DTLSSocket*
       work-*/.DTLSSocket-*

That portion of code ensures that no cross/* wheels are being symlink'ed from the python source to your build environemnt, which in turns ensures they get re-built locally so the resulting *.whl are built and packaged. This worked nicely for cryptography but clearly there is an error with DTLSSocket, weird. Wonder if there is more to it?

Let me reproduce this... I'll come back to you tomorrow.

@th0ma7
Copy link
Contributor

th0ma7 commented Sep 7, 2023

Have you invoked a build then do a make clean of somesort?

@th0ma7
Copy link
Contributor

th0ma7 commented Sep 7, 2023

Ok, found your issue. It isn't with DTLSSocket but rather with cython. Also I noticed a newer DTLSSocket version is out if homeassistant allows to update it (0.1.16) https://pypi.org/project/DTLSSocket/

Update it to the latest version and that should do the trick:

spksrc@spksrc:~/master/spksrc/cross/cython$ git diff .
diff --git a/cross/cython/Makefile b/cross/cython/Makefile
index 38227620..488792a2 100644
--- a/cross/cython/Makefile
+++ b/cross/cython/Makefile
@@ -1,5 +1,5 @@
 PKG_NAME = cython
-PKG_VERS = 0.29.24
+PKG_VERS = 0.29.36
 PKG_EXT = tar.gz
 PKG_DIST_NAME = $(PKG_VERS).$(PKG_EXT)
 PKG_DIST_SITE = https://github.com/$(PKG_NAME)/$(PKG_NAME)/archive
diff --git a/cross/cython/digests b/cross/cython/digests
index 479727f8..689ee377 100644
--- a/cross/cython/digests
+++ b/cross/cython/digests
@@ -1,3 +1,3 @@
-cython-0.29.24.tar.gz SHA1 36a2a5fe9730758cebf3de28c0ff7ae33595700f
-cython-0.29.24.tar.gz SHA256 a5efb97612f0f97164e87c54cc295b2e2d06c539487670079963adeab872de80
-cython-0.29.24.tar.gz MD5 6a7bd0c2d7a9f1630d82e957197ea6e8
+cython-0.29.36.tar.gz SHA1 5b7a3e929edb741b670f318475318c3242b28e62
+cython-0.29.36.tar.gz SHA256 bd8ee4208e1f2817914894eca8c4ca894f6c9a51803b0b815a9a3c03d01ab729
+cython-0.29.36.tar.gz MD5 18d560eee4bba6ef943d98a5499fb977

@hgy59
Copy link
Contributor Author

hgy59 commented Sep 7, 2023

@th0ma7 this is curious (from my log above):

===>  Processing dependencies of homeassistant
===>  Makefile Makefile - Kopie PLIST build-x64-7.1.log src work-x64-7.1
===>  Makefile Makefile - Kopie PLIST build-x64-7.1.log src work-x64-7.1 Use existing shared objects from python 3.11
===>  Makefile Makefile - Kopie PLIST build-x64-7.1.log src work-x64-7.1 PATH: /spksrc/spk/python311/work-x64-7.1
===>  Makefile Makefile - Kopie PLIST build-x64-7.1.log src work-x64-7.1

Makefile, Makefile - Kopie, PLIST, build-x64-7.1.log, src, work-x64-7.1 are all the files and folder-names in the spk/homeassistant folder at time of the build.

@hgy59 hgy59 requested a review from th0ma7 September 7, 2023 06:24
@th0ma7
Copy link
Contributor

th0ma7 commented Sep 7, 2023

Want to fix xz md5sum to confirm it builds ok?

Copy link
Contributor

@th0ma7 th0ma7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hgy59
Copy link
Contributor Author

hgy59 commented Sep 7, 2023

Want to fix xz md5sum to confirm it builds ok?

This is strange, a new download of xz-5.2.6.tar.xz does not have different digests,
I triggered the failed jobs to run again.
When it still fails, there must be something wrong with the download cache...

@hgy59
Copy link
Contributor Author

hgy59 commented Sep 7, 2023

There was a successfuly build before 5ffbf46
but this commit didn't change the build, only the Makefile output.

@hgy59 hgy59 merged commit dda111b into SynoCommunity:master Sep 7, 2023
@hgy59 hgy59 deleted the fix_homeassistant_tradfri branch September 7, 2023 18:14
@hgy59 hgy59 mentioned this pull request Sep 8, 2023
1 task
@hgy59 hgy59 added the status/published Published and activated (may take up to 48h until visible in DSM package manager) label Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/published Published and activated (may take up to 48h until visible in DSM package manager)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Home Assistant - Tradfri integration not working after upgrade to 2023.7.3
2 participants