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

1.4.1: pep517 build is not producing DSO module #605

Open
kloczek opened this issue Oct 6, 2024 · 3 comments
Open

1.4.1: pep517 build is not producing DSO module #605

kloczek opened this issue Oct 6, 2024 · 3 comments

Comments

@kloczek
Copy link

kloczek commented Oct 6, 2024

Long story short

Looks like pep517 build is not producing DSO modle.
I'm not sure but it may be result of use cython 3.0.11.

Expected behaviour

pep571 build should build DSO module.

Actual behaviour

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
running egg_info
creating frozenlist.egg-info
writing frozenlist.egg-info/PKG-INFO
writing dependency_links to frozenlist.egg-info/dependency_links.txt
writing top-level names to frozenlist.egg-info/top_level.txt
writing manifest file 'frozenlist.egg-info/SOURCES.txt'
reading manifest file 'frozenlist.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.lib' found anywhere in distribution
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.a' found anywhere in distribution
warning: no previously-included files matching '*.obj' found anywhere in distribution
warning: no previously-included files found matching 'frozenlist/*.c'
warning: no previously-included files found matching 'frozenlist/*.html'
no previously-included directories found matching 'docs/_build'
adding license file 'LICENSE'
writing manifest file 'frozenlist.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build/lib/frozenlist
copying frozenlist/__init__.py -> build/lib/frozenlist
running egg_info
writing frozenlist.egg-info/PKG-INFO
writing dependency_links to frozenlist.egg-info/dependency_links.txt
writing top-level names to frozenlist.egg-info/top_level.txt
reading manifest file 'frozenlist.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.lib' found anywhere in distribution
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.a' found anywhere in distribution
warning: no previously-included files matching '*.obj' found anywhere in distribution
warning: no previously-included files found matching 'frozenlist/*.c'
warning: no previously-included files found matching 'frozenlist/*.html'
no previously-included directories found matching 'docs/_build'
adding license file 'LICENSE'
writing manifest file 'frozenlist.egg-info/SOURCES.txt'
copying frozenlist/__init__.pyi -> build/lib/frozenlist
copying frozenlist/_frozenlist.pyx -> build/lib/frozenlist
copying frozenlist/py.typed -> build/lib/frozenlist
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/frozenlist
copying build/lib/frozenlist/__init__.py -> build/bdist.linux-x86_64/wheel/./frozenlist
copying build/lib/frozenlist/__init__.pyi -> build/bdist.linux-x86_64/wheel/./frozenlist
copying build/lib/frozenlist/_frozenlist.pyx -> build/bdist.linux-x86_64/wheel/./frozenlist
copying build/lib/frozenlist/py.typed -> build/bdist.linux-x86_64/wheel/./frozenlist
running install_egg_info
Copying frozenlist.egg-info to build/bdist.linux-x86_64/wheel/./frozenlist-1.4.1-py3.10.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/frozenlist-1.4.1.dist-info/WHEEL
creating '/home/tkloczko/rpmbuild/BUILD/frozenlist-1.4.1/dist/.tmp-wgruouqy/frozenlist-1.4.1-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'frozenlist/__init__.py'
adding 'frozenlist/__init__.pyi'
adding 'frozenlist/_frozenlist.pyx'
adding 'frozenlist/py.typed'
adding 'frozenlist-1.4.1.dist-info/LICENSE'
adding 'frozenlist-1.4.1.dist-info/METADATA'
adding 'frozenlist-1.4.1.dist-info/WHEEL'
adding 'frozenlist-1.4.1.dist-info/top_level.txt'
adding 'frozenlist-1.4.1.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built frozenlist-1.4.1-py3-none-any.whl

Steps to reproduce

Use pip or build do perform pep517 build.

@Apteryks
Copy link

Apteryks commented Dec 8, 2024

It also doesn't even leave a .whl file to install in my case. Does it for you?

@Apteryks
Copy link

Apteryks commented Dec 8, 2024

@kloczek My current workaround is to stick to 1.3.3:

(define-public python-frozenlist
  (package
    (name "python-frozenlist")
    (version "1.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "frozenlist" version))
       (sha256
        (base32 "0sispcpras096fxrd0i35qs25fqy4r0x8v1d6f40pag845bwbg2q"))))
    (build-system python-build-system)
    (arguments
     (list #:phases #~(modify-phases %standard-phases
                        ;; XXX: The build fails to properly bootstrap itself.
                        (delete 'ensure-no-cythonized-files))))
    (native-inputs (list python-cython python-pytest))
    (home-page "https://github.com/aio-libs/frozenlist")
    (synopsis "List-like data structure for Python")
    (description "@code{frozenlist.FrozenList} is a list-like structure which
implements @code{collections.abc.MutableSequence}.  It can be made immutable
by calling @code{FrozenList.freeze}.")
    (license license:asl2.0)))

I had to keep the pre-generated C Cythonized files otherwise the build would fail.

@Apteryks
Copy link

Apteryks commented Dec 9, 2024

Update, I've found a more satisfying solution, by patching build_inplace=False into build_inplace=True in the _backend.py file:

(define-public python-frozenlist
  (package
    (name "python-frozenlist")
    (version "1.5.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "frozenlist" version))
       (sha256
        (base32 "05xqnkqq7k95v5nfgq1kck78v4i36wjl5m3nx148770vwqlszmc1"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:test-flags #~(list "-c" "/dev/null") ;avoid pytest-cov
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-pep517-backend
            (lambda _
              ;; Do not build the wheel in a temporary directory, which would
              ;; cause non-reproducibility in the Cython built shared library,
              ;; as well as break the install phase of pyproject-build-system
              ;; due to not finding the '.whl' file.
              (substitute* "packaging/pep517_backend/_backend.py"
                (("build_inplace=False")
                 "build_inplace=True")))))))
    (native-inputs
     (list python-cython
           python-expandvars
           python-pytest
           python-setuptools))
    (home-page "https://github.com/aio-libs/frozenlist")
    (synopsis "List-like data structure for Python")
    (description
     "@code{frozenlist.FrozenList} is a list-like structure which
implements @code{collections.abc.MutableSequence}.  It can be made immutable
by calling @code{FrozenList.freeze}.")
    (license license:asl2.0)))

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

No branches or pull requests

2 participants