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

AttributeError when building 2.2.7 on Ubuntu 24.10 #16860

Open
Tony763 opened this issue Dec 12, 2024 · 12 comments
Open

AttributeError when building 2.2.7 on Ubuntu 24.10 #16860

Tony763 opened this issue Dec 12, 2024 · 12 comments
Labels
Component: Packaging custom packages Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@Tony763
Copy link

Tony763 commented Dec 12, 2024

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version 24.10
Kernel Version 6.9.8 Xanmod
Architecture x86-64
OpenZFS Version 2.2.7

Describe the problem you're observing

Assertion Error occure while building packages for DKMS.

Describe how to reproduce the problem

sudo apt-get install dh-dkms
cd zfs
./configure
make native-deb-utils

Include any warning/errors/backtraces from the system logs

WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).
loading translations [en]... done

Exception occurred:
  File "/usr/lib/python3/dist-packages/numpy/lib/function_base.py", line 4993, in <module>
    assert not hasattr(trapz, "__code__")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/cmd/build.py", line 332, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 248, in __init__
    self.setup_extension(extension)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 428, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/lib/python3/dist-packages/sphinx/registry.py", line 453, in load_extension
    mod = import_module(extname)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/sphinx/builders/epub3.py", line 16, in <module>
    from sphinx.builders import _epub_base
  File "/usr/lib/python3/dist-packages/sphinx/builders/_epub_base.py", line 18, in <module>
    from sphinx.builders.html import BuildInfo, StandaloneHTMLBuilder
  File "/usr/lib/python3/dist-packages/sphinx/builders/html/__init__.py", line 49, in <module>
    from sphinx.writers.html import HTMLWriter
  File "/usr/lib/python3/dist-packages/sphinx/writers/html.py", line 7, in <module>
    from docutils.writers.html4css1 import Writer
  File "/usr/lib/python3/dist-packages/docutils/writers/html4css1/__init__.py", line 22, in <module>
    from docutils.writers import _html_base
  File "/usr/lib/python3/dist-packages/docutils/writers/_html_base.py", line 32, in <module>
    from docutils.parsers.rst.directives.images import PIL
  File "/usr/lib/python3/dist-packages/docutils/parsers/rst/directives/images.py", line 14, in <module>
    import PIL.Image
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 68, in <module>
    from ._typing import StrOrBytesPath, TypeGuard
  File "/usr/lib/python3/dist-packages/PIL/_typing.py", line 8, in <module>
    import numpy.typing as npt
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 149, in <module>
    from . import lib
  File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 23, in <module>
    from . import index_tricks
  File "/usr/lib/python3/dist-packages/numpy/lib/index_tricks.py", line 13, in <module>
    from .function_base import diff
  File "/usr/lib/python3/dist-packages/numpy/lib/function_base.py", line 4993, in <module>
    assert not hasattr(trapz, "__code__")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/sphinx-build", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3/dist-packages/sphinx/cmd/build.py", line 384, in main
    return build_main(argv)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sphinx/cmd/build.py", line 340, in build_main
    handle_exception(app, args, exc, args.error)
  File "/usr/lib/python3/dist-packages/sphinx/cmd/build.py", line 86, in handle_exception
    tbpath = save_traceback(app, exception)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sphinx/util/exceptions.py", line 40, in save_traceback
    f.write(f"""\
    ^^^^^^^
  File "/usr/lib/python3.12/tempfile.py", line 641, in __getattr__
    func_wrapper._closer = self._closer
    ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'builtin_function_or_method' object has no attribute '_closer'
make[2]: *** [debian/rules:183: override_dh_installdocs] Error 1
@Tony763 Tony763 added the Type: Defect Incorrect behavior (e.g. crash, hang) label Dec 12, 2024
@satmandu
Copy link
Contributor

Seeing the same thing with 2.3.0-rc4 on 24.10.

@behlendorf behlendorf added the Component: Packaging custom packages label Dec 13, 2024
@behlendorf
Copy link
Contributor

Do you know if this can only be reproduced with ubuntu 24.10.

@satmandu
Copy link
Contributor

satmandu commented Dec 14, 2024

I think there's some python package installed that is causing these problems. I would note that the errors come from files connected to numpy, which perhaps some other install pulled in for me.

I just built a slightly modified zfs 2.3.0-rc4 for Ubuntu 24.10/oracular using the ubuntu ppa builder, and had no issues using their builder, which I assume does a clean install in a container during a build to generate binary packages:

Build log:
https://launchpadlibrarian.net/763525523/buildlog_ubuntu-oracular-amd64.zfs-linux_2.3.0+rc4-oracular1_BUILDING.txt.gz

Binaries:
https://launchpad.net/~satadru-umich/+archive/ubuntu/zfs-experimental/+sourcepub/16686438/+listing-archive-extra

https://launchpad.net/~satadru-umich/+archive/ubuntu/zfs-experimental/+packages

@szubersk
Copy link
Contributor

@Tony763 @satmandu
It might be a Sphinx change. Please try the patch https://lore.kernel.org/all/[email protected]/ patch and let us know if it worked.

@satmandu
Copy link
Contributor

satmandu commented Dec 14, 2024 via email

@digiphaze
Copy link

I had the same issue. I removed the python3-numpy package and the build worked.

@satmandu
Copy link
Contributor

Is that an upstream error with numpy we need to report?

@szubersk
Copy link
Contributor

This is not an issue with numpy but a breaking change in Sphinx

#10062: Change the default language to 'en' if any language is not set in conf.py

https://www.sphinx-doc.org/en/master/changes/5.0.html#incompatible-changes

@satmandu
Copy link
Contributor

So then

language = None
is the issue?

@Tony763
Copy link
Author

Tony763 commented Dec 16, 2024

language = None

Hi @szubersk, it is probably different. I changed line above to language = 'en' and rebuild.
Error with sphinx is gone:

Running Sphinx v7.4.7
loading translations [en]... done

Assertion error is still there:

Exception occurred:
  File "/usr/lib/python3/dist-packages/numpy/lib/function_base.py", line 4993, in <module>
    assert not hasattr(trapz, "__code__")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/cmd/build.py", line 332, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 248, in __init__
    self.setup_extension(extension)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 428, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/lib/python3/dist-packages/sphinx/registry.py", line 453, in load_extension
    mod = import_module(extname)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/sphinx/builders/epub3.py", line 16, in <module>
    from sphinx.builders import _epub_base
  File "/usr/lib/python3/dist-packages/sphinx/builders/_epub_base.py", line 18, in <module>
    from sphinx.builders.html import BuildInfo, StandaloneHTMLBuilder
  File "/usr/lib/python3/dist-packages/sphinx/builders/html/__init__.py", line 49, in <module>
    from sphinx.writers.html import HTMLWriter
  File "/usr/lib/python3/dist-packages/sphinx/writers/html.py", line 7, in <module>
    from docutils.writers.html4css1 import Writer
  File "/usr/lib/python3/dist-packages/docutils/writers/html4css1/__init__.py", line 22, in <module>
    from docutils.writers import _html_base
  File "/usr/lib/python3/dist-packages/docutils/writers/_html_base.py", line 32, in <module>
    from docutils.parsers.rst.directives.images import PIL
  File "/usr/lib/python3/dist-packages/docutils/parsers/rst/directives/images.py", line 14, in <module>
    import PIL.Image
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 68, in <module>
    from ._typing import StrOrBytesPath, TypeGuard
  File "/usr/lib/python3/dist-packages/PIL/_typing.py", line 8, in <module>
    import numpy.typing as npt
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 149, in <module>
    from . import lib
  File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 23, in <module>
    from . import index_tricks
  File "/usr/lib/python3/dist-packages/numpy/lib/index_tricks.py", line 13, in <module>
    from .function_base import diff
  File "/usr/lib/python3/dist-packages/numpy/lib/function_base.py", line 4993, in <module>
    assert not hasattr(trapz, "__code__")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

@satmandu
Copy link
Contributor

Then this looks like a numpy issue to report upstream?

@szubersk
Copy link
Contributor

szubersk commented Dec 18, 2024

Then this looks like a numpy issue to report upstream?

I need to say that I couldn't reproduce the issue in Ubuntu 24.10 (Docker).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Packaging custom packages Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

5 participants