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

0.81.0: build fails #1230

Closed
kloczek opened this issue Aug 22, 2023 · 13 comments · Fixed by #1232
Closed

0.81.0: build fails #1230

kloczek opened this issue Aug 22, 2023 · 13 comments · Fixed by #1232

Comments

@kloczek
Copy link

kloczek commented Aug 22, 2023

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules

Here is build output:

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
* Building wheel...
Compiling src/zeroconf/_dns.py because it changed.
Compiling src/zeroconf/_cache.py because it changed.
Compiling src/zeroconf/_listener.py because it changed.
Compiling src/zeroconf/_protocol/incoming.py because it changed.
Compiling src/zeroconf/_protocol/outgoing.py because it changed.
Compiling src/zeroconf/_services/registry.py because it changed.
[1/6] Cythonizing src/zeroconf/_cache.py
[2/6] Cythonizing src/zeroconf/_dns.py
[3/6] Cythonizing src/zeroconf/_listener.py
[4/6] Cythonizing src/zeroconf/_protocol/incoming.py
[5/6] Cythonizing src/zeroconf/_protocol/outgoing.py
[6/6] Cythonizing src/zeroconf/_services/registry.py
running build
running build_py
creating /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build
creating /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib
creating /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/__init__.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_cache.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_core.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_dns.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_engine.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_exceptions.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_handlers.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_history.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_listener.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_logger.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_transport.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_updates.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/asyncio.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/const.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
creating /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_protocol
copying src/zeroconf/_protocol/__init__.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_protocol
copying src/zeroconf/_protocol/incoming.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_protocol
copying src/zeroconf/_protocol/outgoing.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_protocol
creating /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_services
copying src/zeroconf/_services/__init__.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_services
copying src/zeroconf/_services/browser.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_services
copying src/zeroconf/_services/info.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_services
copying src/zeroconf/_services/registry.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_services
copying src/zeroconf/_services/types.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_services
creating /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_utils
copying src/zeroconf/_utils/__init__.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_utils
copying src/zeroconf/_utils/asyncio.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_utils
copying src/zeroconf/_utils/name.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_utils
copying src/zeroconf/_utils/net.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_utils
copying src/zeroconf/_utils/time.py -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_utils
copying src/zeroconf/_cache.pxd -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_dns.pxd -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_listener.pxd -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/py.typed -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_cache.c -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_dns.c -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_listener.c -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf
copying src/zeroconf/_protocol/incoming.pxd -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_protocol
copying src/zeroconf/_protocol/outgoing.pxd -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_protocol
copying src/zeroconf/_protocol/incoming.c -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_protocol
copying src/zeroconf/_protocol/outgoing.c -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_protocol
copying src/zeroconf/_services/registry.pxd -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_services
copying src/zeroconf/_services/registry.c -> /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.81.0/build/lib/zeroconf/_services

Error compiling Cython file:
------------------------------------------------------------
...

    def async_get_infos_server(self, server: str) -> List[ServiceInfo]:
        """Return all ServiceInfo matching server."""
        return self._async_get_by_index(self.servers, server)

    def _async_get_by_index(self, records: Dict[str, List], key: str) -> List[ServiceInfo]:
                                                           ^
------------------------------------------------------------

src/zeroconf/_services/registry.py:79:60: Compiler crash in AnalyseDeclarationsTransform

File 'ModuleNode.py', line 124, in analyse_declarations: ModuleNode(registry.py:1:0,
    doc = ' Multicast DNS Service Discovery for Python, v0.14-wmcbrine\n    Copyright 2003 Paul Scott-Murphy, 2014 William McBrine\n\n    This module provides a framework for the use of DNS Service Discovery\n    using IP multicast.\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301\n    USA\n',
    full_module_name = 'zeroconf._services.registry')
File 'Nodes.py', line 431, in analyse_declarations: StatListNode(registry.py:23:0)
File 'Nodes.py', line 4817, in analyse_declarations: CClassDefNode(registry.py:29:0,
    class_name = 'ServiceRegistry',
    doc = 'A registry to keep track of services.\n\n    The registry must only be accessed from\n    the event loop as it is not thread safe.\n    ',
    visibility = 'private')
File 'Nodes.py', line 431, in analyse_declarations: StatListNode(registry.py:30:4)
File 'Nodes.py', line 2359, in analyse_declarations: CFuncDefNode(registry.py:79:4,
    doc = 'Return all ServiceInfo matching the index.',
    is_c_class_method = 1,
    modifiers = [...]/0,
    visibility = 'private')
File 'Nodes.py', line 681, in analyse: CFuncDeclaratorNode(registry.py:79:4,
    calling_convention = '')
File 'Nodes.py', line 909, in analyse: CArgDeclNode(registry.py:79:60,
    is_generic = 1,
    outer_attrs = [...]/2)

Compiler crash traceback from this point on:
  File "/usr/lib64/python3.8/site-packages/Cython/Compiler/Nodes.py", line 909, in analyse
    if self.annotation and env and env.directives['annotation_typing'] and self.base_type.name is None:
AttributeError: 'CAnalysedBaseTypeNode' object has no attribute 'name'
Successfully built zeroconf-0.81.0-cp38-cp38-manylinux_2_38_x86_64.whl

Here is list of installed modules in build env

Package                       Version
----------------------------- -------
alabaster                     0.7.13
async-timeout                 4.0.3
Babel                         2.12.1
build                         0.10.0
charset-normalizer            3.2.0
Cython                        0.29.36
distro                        1.8.0
docutils                      0.20.1
exceptiongroup                1.1.1
execnet                       2.0.2
gpg                           1.20.0
idna                          3.4
ifaddr                        0.2.0
imagesize                     1.4.1
importlib-metadata            6.8.0
iniconfig                     2.0.0
installer                     0.7.0
Jinja2                        3.1.2
libcomps                      0.1.19
MarkupSafe                    2.1.3
packaging                     23.1
pluggy                        1.2.0
poetry-core                   1.7.0
Pygments                      2.16.0
pyproject_hooks               1.0.0
pytest                        7.4.0
pytest-asyncio                0.21.1
pytest-xdist                  3.3.1
python-dateutil               2.8.2
pytz                          2023.2
requests                      2.31.0
setuptools                    68.0.0
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        7.0.1
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.3
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.9
tomli                         2.0.1
urllib3                       1.26.15
wheel                         0.41.1
zipp                          3.16.2

In the same build env 0.80.0 build is OK.

bdraco added a commit that referenced this issue Aug 22, 2023
@bdraco
Copy link
Member

bdraco commented Aug 22, 2023

We probably need to hide the str from cython for it to work in your env

@bdraco
Copy link
Member

bdraco commented Aug 22, 2023

Super annoying since I can't replicate the problem locally

Will push a fix shortly

@bdraco
Copy link
Member

bdraco commented Aug 22, 2023

Cython 0.29.36

Upgrading to 3.0.0 will make the issue go away as well

@bdraco
Copy link
Member

bdraco commented Aug 22, 2023

Is it going to be a problem for you if we pin Cython to >= 3.0.0 in the build deps?

@kloczek
Copy link
Author

kloczek commented Aug 22, 2023

Nope .. I'm using only cython 3.x 👍

@kloczek
Copy link
Author

kloczek commented Aug 22, 2023

Just tested 0.82.1 and all looks good now 😄
Thank you 👍

@bdraco
Copy link
Member

bdraco commented Aug 22, 2023

The modules you have listed in your build env have 0.29.6

@kloczek
Copy link
Author

kloczek commented Aug 22, 2023

Sorry my mistake.
I forgot that that I've postponed week or two upgrade to 3.x because many modules are not ready to 3.x.
Nevertheless 0.82.1 works with cython 0.29.6.

@bdraco
Copy link
Member

bdraco commented Aug 23, 2023

I'll hold off on bumping the min cython to 3.0 for a month of so

@bdraco
Copy link
Member

bdraco commented Aug 23, 2023

I can keep doing workarounds if it breaks on 0.29.6 if we cython anything else in the mean time. Let me know if you see another failure w/0.29.x and we will get it sorted

@kloczek
Copy link
Author

kloczek commented Aug 23, 2023

I'll hold off on bumping the min cython to 3.0 for a month of so

Thank you 👍
I think that it will be enough to solve all cython 3.x related issues 😋

@kloczek
Copy link
Author

kloczek commented Aug 27, 2023

Just sorted out last cython 3.x issue with other modules (zeroconf builds correctly with cython 3.0.2) so if you have been holding workarounds because what I've been reporting feel free to remove those workarounds at any time.

Thank you for your time 👍

@bdraco
Copy link
Member

bdraco commented Aug 27, 2023

Great. I'll pin it next time we cython something that will have trouble with other cython

thanks for following up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants