SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.02k stars 1.23k forks source link

Home Assistant: Use Build in Python 3.x #4978

Closed Xembalo closed 2 years ago

Xembalo commented 2 years ago

Setup

Package Name: Home Assistant Package Version: v2021.9.7

NAS Model: DS217j NAS Architecture: Arm7 DSM version: 7.0.1

Actual behavior

Home Assistant has dependency to Python3.8 package. But DSM 7.0.1 has build in python 3.9

root@nas:/# which python3
/opt/bin/python3
root@nas:/# /opt/bin/python3 -V
Python 3.9.6

Expected behavior

Get rid of redundant python and use build in version

hgy59 commented 2 years ago

The newest DSM is v7.0.1 and comes with Python 3.8.8. The python in DSM is located in /usr/bin. You must have installed python from another source that installs packages to /opt/bin.

~$ which python
/bin/python
~$ python --version
Python 3.8.8

~$ sudo ls -la /opt/
Password:
total 12
drwx--x--x  3 root root 4096 Nov  4 23:14 .
drwxr-xr-x 23 root root 4096 Nov  4 23:16 ..
drwx--x--x  4 root root 4096 Nov  4 23:14 containerd

We alredy have released Python 3.10. So next homeassistant core package will hopefully come under python 3.10.x.

Synology is known to rarely update included packages.

Xembalo commented 2 years ago

You are right, of corse 7.0.1 But where does /opt/bin/python3 comes from? Maybe entware oPKG? (no answer needed ;-))

This means that there are good reasons to have your own Python package because included one in DSM outdated very quickly?

hgy59 commented 2 years ago

yes entware (i.e. ipkg) is known to install packages in /opt folder.

The reason is not only that DSM packages of synology are often outdated, we also bundle some packages (modules, wheels) with our python packages that must not be delivered with python dependent packages (synology initially had "python module" package for Python 2 for similar reasons).