Skip to content

does not build on bookworm due to recent update to PyGobject #249

@kalebris

Description

@kalebris

When using the sonic-buildimage I get error message:

++ basename target/python-wheels/bookworm/sonic_host_services-1.0-py3-none-any.whl
+ SONIC_HOST_SERVICES_PY3_WHEEL_NAME=sonic_host_services-1.0-py3-none-any.whl
+ sudo cp target/python-wheels/bookworm/sonic_host_services-1.0-py3-none-any.whl ./fsroot-vs/sonic_host_services-1.0-py3-none-any.whl
+ sudo https_proxy= LANG=C chroot ./fsroot-vs pip3 install sonic_host_services-1.0-py3-none-any.whl
Processing /sonic_host_services-1.0-py3-none-any.whl
Requirement already satisfied: Jinja2>=2.10 in /usr/lib/python3/dist-packages (from sonic-host-services==1.0) (3.1.2)
Collecting PyGObject
  Downloading pygobject-3.52.3.tar.gz (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 4.3 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      + meson setup /tmp/pip-install-7z8tehmd/pygobject_36a2d29d6f334c29957433c40baf9754 /tmp/pip-install-7z8tehmd/pygobject_36a2d29d6f334c29957433c40baf9754/.mesonpy-i5csgzxc -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dtests=false -Dwheel=true --wrap-mode=nofallback --native-file=/tmp/pip-install-7z8tehmd/pygobject_36a2d29d6f334c29957433c40baf9754/.mesonpy-i5csgzxc/meson-python-native-file.ini
      The Meson build system
      Version: 1.8.0
      Source dir: /tmp/pip-install-7z8tehmd/pygobject_36a2d29d6f334c29957433c40baf9754
      Build dir: /tmp/pip-install-7z8tehmd/pygobject_36a2d29d6f334c29957433c40baf9754/.mesonpy-i5csgzxc
      Build type: native build
      Project name: pygobject
      Project version: 3.52.3
      C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
      C linker for the host machine: cc ld.bfd 2.40
      Host machine cpu family: x86_64
      Host machine cpu: x86_64
      Program python3 found: YES (/usr/bin/python3)
      Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
      Run-time dependency python found: YES 3.11
      Did not find CMake 'cmake'
      Found CMake: NO
      Run-time dependency girepository-2.0 found: NO (tried pkgconfig and cmake)
      Not looking for a fallback subproject for the dependency girepository-2.0 because:
      Use of fallback dependencies is disabled.

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

      A full log can be found at /tmp/pip-install-7z8tehmd/pygobject_36a2d29d6f334c29957433c40baf9754/.mesonpy-i5csgzxc/meson-logs/meson-log.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

After some digging it seems the girpository-2.0 isn't available on bookworm. I have locally fixed this problem by the diff below:

--- ./src/sonic-host-services/setup.py  2025-05-05 12:59:06.826212319 +0000
+++ new.py      2025-05-05 12:58:52.475721684 +0000
@@ -47,7 +47,7 @@
         'dbus-python',
         'systemd-python',
         'Jinja2>=2.10',
-        'PyGObject',
+        'PyGObject==3.50.0',
         'pycairo==1.26.1',
         'psutil'
     ] + sonic_dependencies,

Given that this is a fairly recent update to PyGObject, thought fixing to previous version is acceptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions