criu/lib
Adrian Reber c1cea90043 pycriu: Fix FieldDescriptor.label removal in protobuf 7.x
Protobuf 7.x (shipped in Arch Linux) removed the `label` instance
attribute from `FieldDescriptor`.  Accessing `field.label` now
raises `AttributeError`, which breaks all CRIU tests at the
`check_pages_counts` step when pycriu tries to convert protobuf
stats images to dicts:

    File "test/pycriu/images/pb2dict.py", line 345, in pb2dict
        if field.label == FD.LABEL_REPEATED:
    AttributeError: 'FieldDescriptor' object has no attribute 'label'

Protobuf 7.x replaced `field.label` with boolean properties
`field.is_repeated` and `field.is_required`.  These properties
do not exist in protobuf 3.x/4.x.

Add a `_is_repeated()` compatibility helper that checks for the
`label` attribute first (protobuf <= 5.x) and falls back to
`is_repeated` (protobuf >= 7.x), keeping pycriu working across
both old and new protobuf versions.

Assisted-by: Claude Code (claude-opus-4-6):claude-opus-4-6@default
Signed-off-by: Adrian Reber <areber@redhat.com>
2026-04-22 12:15:02 +01:00
..
c libcriu: enable setting of RPC config file 2025-11-05 15:41:34 -08:00
pycriu pycriu: Fix FieldDescriptor.label removal in protobuf 7.x 2026-04-22 12:15:02 +01:00
.gitignore lib: use separate packages for pycriu and crit 2023-11-27 16:47:16 -08:00
Makefile make: improve check for externally managed Python 2024-09-11 16:02:11 -07:00
pyproject.toml pycriu: add missing protobuf dependency 2025-11-05 15:41:34 -08:00
setup.cfg pycriu: add missing protobuf dependency 2025-11-05 15:41:34 -08:00
setup.py lib: use separate packages for pycriu and crit 2023-11-27 16:47:16 -08:00