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

Build failure: All branches are failing due to latest PyGObject 3.52.1 now requiring gitrepository-2.0 #21984

Open
aaronpayment opened this issue Mar 10, 2025 · 3 comments
Assignees
Labels
Triaged this issue has been triaged

Comments

@aaronpayment
Copy link
Contributor

aaronpayment commented Mar 10, 2025

The build fails as sonic-host-services setup.py just pulls in an unversioned 'PyGObject' and on March 9, 2025 PyGObject v3.52.1 was released that now requires gitrepository-2.0 which is not present.

One option is to change sonic-host-servics to pin to a prior working 'PyGObject==3.50.0' in setup.py or we change the bookworm sonic-buildimage to include a gitrepository-2.0

@jemifdo
Copy link
Contributor

jemifdo commented Mar 11, 2025

The below patch should work.

Path from sonic-buildimage is src/sonic-host-services/setup.py

diff --git a/setup.py b/setup.py
index 9cb0ff3..e296b75 100644
--- a/setup.py
+++ b/setup.py
@@ -47,7 +47,7 @@ setup(
         'dbus-python',
         'systemd-python',
         'Jinja2>=2.10',
-        'PyGObject',
+        'PyGObject==3.50.0',
         'pycairo==1.26.1',
         'psutil'
     ] + sonic_dependencies,

In case any of you facing the above issue and want to proceed with the same clone, then after applying the patch you may need to clean compile the following targets,

  • sonic_host_services-1.0-py3-none-any.whl
  • sonic-host-services-data_1.0-1_all.deb
  • sonic-<platform>.bin <-- platform/arch specific

@aparkhomenko-xsight
Copy link

patch for 202305 and 202311 branches

diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2
index 0402c86db..1e00be88e 100644
--- a/files/build_templates/sonic_debian_extension.j2
+++ b/files/build_templates/sonic_debian_extension.j2
@@ -264,7 +264,9 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install system
SONIC_HOST_SERVICES_PY3_WHEEL_NAME=$(basename {{sonic_host_services_py3_wheel_path}})
sudo cp {{sonic_host_services_py3_wheel_path}} $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install pycairo==1.26.0
-sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install --no-build-isolation pygobject
+sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install meson-python
+sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install ninja
+sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install --no-build-isolation "pygobject<3.51.0"
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SONIC_HOST_SERVICES_PY3_WHEEL_NAME
sudo rm -rf $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME

@cpackham-atlnz
Copy link

I hit the same issue on 202411 and fixed it with

diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2
index d92cb54c4..267024706 100644
--- a/files/build_templates/sonic_debian_extension.j2
+++ b/files/build_templates/sonic_debian_extension.j2
@@ -263,6 +263,7 @@ if [[ $CONFIGURED_ARCH == armhf ]]; then
 fi
 
 # Install SONiC host services package
+sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "pygobject==3.50.0"
 SONIC_HOST_SERVICES_PY3_WHEEL_NAME=$(basename {{sonic_host_services_py3_wheel_path}})
 sudo cp {{sonic_host_services_py3_wheel_path}} $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME
 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SONIC_HOST_SERVICES_PY3_WHEEL_NAME

Although it looks like the fix suggested by @jemifdo would have also worked. Is anyone looking at submitting a PR for this?

cpackham-atlnz added a commit to cpackham-atlnz/sonic-host-services that referenced this issue Mar 11, 2025
Newer versions of PyGObject depend on libgirepository-2.0-dev which
isn't packaged for Debian. This leads to build failures like

  Collecting PyGObject
  Downloading pygobject-3.52.1.tar.gz (1.2 MB)
  ...

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      ...

      ../meson.build:31:9: ERROR: Dependency 'girepository-2.0' is required but not found.

Pin the version of PyGObject to 3.50.0 which is the latest version known
to work.

Fixes sonic-net/sonic-buildimage#21984
@arlakshm arlakshm added the Triaged this issue has been triaged label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triaged this issue has been triaged
Projects
None yet
Development

No branches or pull requests

5 participants