Skip to content

python3Packages.pycairo is broken on darwin #128266

@sternenseemann

Description

@sternenseemann

pycairo fails on Hydra on darwin: https://hydra.nixos.org/build/146162989. This is serious because it breaks pygobject3 on darwin. This seems to be a result of #127151.

Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing pytest-check-hook
Using pytestCheckPhase
unpacking sources
unpacking source archive /nix/store/db6xig497k1pyyb0l53ccwiyxv1jf93x-source
source root is source
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/tests/test_typing.py
patching sources
configuring
meson flags: --buildtype=plain         --libdir=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib --libexecdir=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/libexec         --bindir=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/bin --sbindir=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/sbin         --includedir=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/include         --mandir=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/share/man --infodir=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/share/info         --localedir=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/share/locale         -Dauto_features=enabled         -Dwrap_mode=nodownload         --prefix=/nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1 -Dpython=/nix/store/lcm6qi612273hm48pbfma3026fdizcc0-python3-3.8.9/bin/python3.8 
The Meson build system
Version: 0.57.1
Source dir: /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source
Build dir: /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source/build
Build type: native build
Project name: pycairo
Project version: 1.20.1
C compiler for the host machine: clang (clang 7.1.0 "clang version 7.1.0 (tags/RELEASE_710/final)")
C linker for the host machine: clang ld64 530
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/nix/store/lcm6qi612273hm48pbfma3026fdizcc0-python3-3.8.9/bin/python3.8)
Compiler for C supports arguments -Wall: YES 
Compiler for C supports arguments -Warray-bounds: YES 
Compiler for C supports arguments -Wcast-align: YES 
Compiler for C supports arguments -Wconversion: YES 
Compiler for C supports arguments -Wextra: YES 
Compiler for C supports arguments -Wformat=2: YES 
Compiler for C supports arguments -Wformat-nonliteral: YES 
Compiler for C supports arguments -Wformat-security: YES 
Compiler for C supports arguments -Wimplicit-function-declaration: YES 
Compiler for C supports arguments -Winit-self: YES 
Compiler for C supports arguments -Winline: YES 
Compiler for C supports arguments -Wmissing-format-attribute: YES 
Compiler for C supports arguments -Wmissing-noreturn: YES 
Compiler for C supports arguments -Wnested-externs: YES 
Compiler for C supports arguments -Wold-style-definition: YES 
Compiler for C supports arguments -Wpacked: YES 
Compiler for C supports arguments -Wpointer-arith: YES 
Compiler for C supports arguments -Wreturn-type: YES 
Compiler for C supports arguments -Wshadow: YES 
Compiler for C supports arguments -Wsign-compare: YES 
Compiler for C supports arguments -Wstrict-aliasing: YES 
Compiler for C supports arguments -Wundef: YES 
Compiler for C supports arguments -Wunused-but-set-variable: NO 
Compiler for C supports arguments -Wswitch-default: YES 
Compiler for C supports arguments -Wno-missing-field-initializers: YES 
Compiler for C supports arguments -Wno-unused-parameter: YES 
Compiler for C supports arguments -fno-strict-aliasing: YES 
Compiler for C supports arguments -fvisibility=hidden: YES 
Configuring pycairo-1.20.1.egg-info using configuration
Found pkg-config: /nix/store/azb40fb4ib9kj7g5i8vb9wr2wci7cgl7-pkg-config-wrapper-0.29.2/bin/pkg-config (0.29.2)
Dependency python found: YES (pkgconfig)
Run-time dependency cairo found: YES 1.16.0
Build targets in project: 2

Option buildtype is: plain [default: debugoptimized]
Found ninja-1.10.2 at /nix/store/fz01nfk8ai1cscy4blbb6mjj6bmv9wis-ninja-1.10.2/bin/ninja
meson: enabled parallel building
building
build flags: -j1 -l1
[21/21] Linking target tests/cmod.cpython-38-darwin.so[Kp/cmodule_cmodulelib.c.o
glibPreInstallPhase
installing
install flags: install
[0/1] Installing files.
Installing cairo/_cairo.cpython-38-darwin.so to /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib/python3.8/site-packages/cairo
Installing /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source/build/cairo/py3cairo.h to /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib/python3.8/site-packages/cairo/include
Installing /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source/build/cairo/py3cairo.h to /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/include/pycairo
Installing /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source/build/pycairo-1.20.1.egg-info to /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib/python3.8/site-packages
Installing /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source/cairo/__init__.py to /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib/python3.8/site-packages/cairo
Installing /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source/cairo/__init__.pyi to /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib/python3.8/site-packages/cairo
Installing /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source/cairo/py.typed to /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib/python3.8/site-packages/cairo
Installing /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source/build/meson-private/py3cairo.pc to /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib/pkgconfig
glibPreFixupPhase
post-installation fixup
strip is /nix/store/bk80xfmnyv85jv4cvz81kgd77h7vljnl-cctools-binutils-darwin-949.0.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1/lib 
patching script interpreter paths in /nix/store/7d0ndlq5jzqg64fdhhn882s1mg38s7my-python3.8-pycairo-1.20.1
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
running install tests
no Makefile or custom installCheckPhase, doing nothing
pythonCatchConflictsPhase
pythonRemoveBinBytecodePhase
pythonImportsCheckPhase
Executing pythonImportsCheckPhase
pytestCheckPhase
Executing pytestCheckPhase
============================= test session starts ==============================
platform darwin -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /private/tmp/nix-build-python3.8-pycairo-1.20.1.drv-0/source
collected 262 items / 3 skipped / 259 selected                                 

tests/test_api.py .................                                      [  6%]
tests/test_cmod.py .                                                     [  6%]
tests/test_context.py .................................................. [ 25%]
.................                                                        [ 32%]
tests/test_device.py ...........                                         [ 36%]
tests/test_enums.py .......                                              [ 39%]
tests/test_error.py ....                                                 [ 40%]
tests/test_font.py ..............................                        [ 52%]
tests/test_glyph.py ..                                                   [ 53%]
tests/test_matrix.py ...........                                         [ 57%]
tests/test_path.py ....                                                  [ 58%]
tests/test_pattern.py ..............................                     [ 70%]
tests/test_rectangle.py ...                                              [ 71%]
tests/test_region.py ...........                                         [ 75%]
tests/test_surface.py .....s............................................ [ 94%]
..........                                                               [ 98%]
tests/test_textcluster.py .                                              [ 98%]
tests/test_textextents.py ..                                             [ 99%]
tests/test_typing.py F                                                   [100%]

=================================== FAILURES ===================================
_________________________________ test_typing __________________________________

    def test_typing():
        mod = types.ModuleType("cairo")
        stub = os.path.join(cairo.__path__[0], "__init__.pyi")
        with io.open(stub, "r", encoding="utf-8") as h:
            code = compile(h.read(), stub, "exec")
            exec(code, mod.__dict__)
    
        def collect_names(t):
            names = set()
            for key, value in vars(t).items():
                if key in ["XlibSurface", "XCBSurface", "Win32PrintingSurface",
                           "Win32Surface"]:
                    continue
                if key.startswith("_"):
                    continue
                if key.startswith("__") and key.endswith("__"):
                    continue
                if getattr(value, "__module__", "") == "typing" or key == "Text":
                    continue
                if isinstance(value, type):
                    names.add(key)
    
                    for k, v in vars(value).items():
                        name = key + "." + k
                        if k.startswith("_"):
                            continue
                        names.add(name)
                else:
                    names.add(key)
            return names
    
        # We expose all potential API in the typing stubs, so only check
        # if it exactly matches the Python module with a new enough cairo
        cairo_version = tuple(map(int, cairo.cairo_version_string().split(".")))
        if cairo_version >= (1, 16, 0):
>           assert collect_names(cairo) == collect_names(mod)
E           AssertionError: assert {'ANTIALIAS_B...AS_NONE', ...} == {'ANTIALIAS_B...AS_NONE', ...}
E             Extra items in the right set:
E             'TeeSurface'
E             'TeeSurface.remove'
E             'TeeSurface.index'
E             'TeeSurface.add'
E             Use -v to get the full diff

tests/test_typing.py:43: AssertionError
=========================== short test summary info ============================
FAILED tests/test_typing.py::test_typing - AssertionError: assert {'ANTIALIAS...
=================== 1 failed, 260 passed, 4 skipped in 1.51s ===================
builder for '/nix/store/bv79lp6vjfgzsjvv1c0d3rkf35qw69sx-python3.8-pycairo-1.20.1.drv' failed with exit code 1

cc @mweinelt @jonringer @NixOS/darwin-maintainers

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: darwinRunning or building packages on Darwin6.topic: pythonPython is a high-level, general-purpose programming language.
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions