NVIDIA / cuda-python

CUDA Python Low-level Bindings
https://nvidia.github.io/cuda-python/
Other
809 stars 63 forks source link

Build issues with cuda-python 12.3.0 #57

Closed jakirkham closed 4 months ago

jakirkham commented 5 months ago

We are seeing build issues with cuda-python version 12.3.0 in conda-forge. Here is a snippet taken from CI:

Traceback (most recent call last):
  File "/home/conda/feedstock_root/build_artifacts/cuda-python_1706498566763/work/setup.py", line 245, in <module>
    version=versioneer.get_version(),
  File "/home/conda/feedstock_root/build_artifacts/cuda-python_1706498566763/work/versioneer.py", line 1800, in get_version
    return get_versions()["version"]
  File "/home/conda/feedstock_root/build_artifacts/cuda-python_1706498566763/work/versioneer.py", line 1732, in get_versions
    cfg = get_config_from_root(root)
  File "/home/conda/feedstock_root/build_artifacts/cuda-python_1706498566763/work/versioneer.py", line 394, in get_config_from_root
    with open(setup_cfg) as cfg_file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/conda/feedstock_root/build_artifacts/cuda-python_1706498566763/work/setup.cfg'

It looks like versioneer is being relied upon to set the version. However versioneer expects to find setup.cfg, which is no longer in the repo. Looks like this was dropped as part of the 12.3 upgrade

jakirkham commented 5 months ago

On further inspection see that pyproject.toml was added in 12.3. It appears to configured to use setuptools-scm (a different versioning library) instead

Am a little unclear on whether setuptools-scm or versioneer are intended to be used here. If the former, the versioneer bits would need to be removed and replaced by what setuptools-scm needs. If the latter, versioneer would need an upgrade using a --no-vendor install (potentially with some cleanup after)

In either case the current configuration appears to have some issues that need correction. Exactly how to do that would depend on which approach (setuptools-scm or versioneer) is preferred

jakirkham commented 5 months ago

Workaround suggested by Vlad offline is to add tomli as a build dependency for Python pre-3.11, which works

Discussing with Vlad offline on how to address more generally

vzhurba01 commented 4 months ago

Cleaned up versioneer usage with the latest CUDA Python 12.4.0 release. Closing.