iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.59k stars 3.88k forks source link

build fails with python 3.12.1 #4906

Open fefe17 opened 9 months ago

fefe17 commented 9 months ago

$ make Building sdist for python3 Traceback (most recent call last): File "/src/cvs/ebpf/bcc/build/src/python/bcc-python3/setup.py", line 11, in setup(name='bcc', File "/usr/lib/python3.12/site-packages/setuptools/init.py", line 103, in setup return distutils.core.setup(attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 147, in setup _setup_distribution = dist = klass(attrs) ^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 314, in init self.metadata.version = self._normalize_version(self.metadata.version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 350, in _normalize_version normalized = str(Version(version)) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/setuptools/_vendor/packaging/version.py", line 198, in init raise InvalidVersion(f"Invalid version: '{version}'") setuptools.extern.packaging.version.InvalidVersion: Invalid version: '0.29.1+refs/hea' make[2]: ** [src/python/CMakeFiles/bcc_py_python3.dir/build.make:84: src/python/bcc-python3/dist/bcc-0.29.1+refs/hea.tar.gz] Error 1 make[1]: [CMakeFiles/Makefile2:1047: src/python/CMakeFiles/bcc_py_python3.dir/all] Error 2 make: *** [Makefile:146: all] Error 2

fefe17 commented 9 months ago

the problem seems to be src/python/bcc-python3/setup.py:

11 setup(name='bcc', 12 version='0.29.1+refs/hea',

this is in my build dir, which means it was generated by the build process, which is apparently broken somewhere. Removing the +refs/hea part makes it build.

yonghong-song commented 9 months ago

Yes, you may need to completely remove contends of build directory and do a rebuild.

fefe17 commented 9 months ago

I removed the build dir, did a git pull, and got this error:

[ 15%] Building sdist for python3 Traceback (most recent call last): File "/cvs/bcc/b/src/python/bcc-python3/setup.py", line 3, in from setuptools import setup ModuleNotFoundError: No module named 'setuptools'

yonghong-song commented 9 months ago

I don't know the reason. My system has python 3.9 and cannot reproduce your failure. Hopefully you can help debug since you have the environment.