bcc icon indicating copy to clipboard operation
bcc copied to clipboard

build fails with python 3.12.1

Open fefe17 opened this issue 2 years ago • 6 comments

$ 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 avatar Feb 08 '24 11:02 fefe17

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.

fefe17 avatar Feb 08 '24 11:02 fefe17

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

yonghong-song avatar Feb 12 '24 16:02 yonghong-song

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'

fefe17 avatar Feb 12 '24 17:02 fefe17

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.

yonghong-song avatar Feb 15 '24 03:02 yonghong-song

Got a similar issue after compiling from the tar file downloaded from assets, and ended up with a bad version string in ./build/src/python/bcc-python3/setup.py :

      version='EAD-HASH-NOTFOUND+GITDIR-N',

Fixed it by starting over and cloning directly from github instead. Apparently the build process tried to figure out some stuff by querying git, which doesn't work if there's no .git directory. I wonder why these tar assets are prodived at all if they don't work.

AlainKnaff avatar Oct 12 '25 17:10 AlainKnaff

O yes, I needed setuptools too, but that was easy to install using pip install setuptools

AlainKnaff avatar Oct 12 '25 17:10 AlainKnaff