Skip to content

Conversation

@HoyeonRhee
Copy link
Contributor

@HoyeonRhee HoyeonRhee commented Oct 24, 2025

bcc's GitHub workflow has been failing for a while when building from
a shallow clone (git clone --depth 1). In this case, git_describe()
from CMake returns an invalid version string (128-NOTFOUND-deadbeef).

Older setuptools versions used in Fedora 38 tolerated this format, but
newer setuptools in Ubuntu 24.04 enforces PEP 440 compliance and treats
it as an error, breaking the CI build.

This updates cmake/version.cmake to detect this case and fall back to a
compliant 0.0.0+<hash> version when tags are missing. The commit hash is
kept for traceability, and behavior with full clones remains unchanged.

/usr/lib/python3/dist-packages/setuptools/command/egg_info.py:131: SetuptoolsDeprecationWarning: Invalid version: '128-NOTFOUND+bb1a55f3'.
!!

        ********************************************************************************
        Version '128-NOTFOUND+bb1a55f3' is not valid according to PEP 440.

        Please make sure to specify a valid version for your package.
        Also note that future releases of setuptools may halt the build process
        if an invalid version is given.

        This deprecation is overdue, please update your project and remove deprecated
        calls to avoid build errors in the future.

        See https://peps.python.org/pep-0440/ for details.
        ********************************************************************************

!!
  return _normalization.best_effort_version(tagged)
Traceback (most recent call last):
  File "/bcc/build/src/python/bcc-python3/setup.py", line 11, in <module>
    setup(name='bcc',
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1233, in run_command
    super().run_command(command)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/sdist.py", line 55, in run
    self.run_command('egg_info')
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1233, in run_command
    super().run_command(command)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 225, in finalize_options
    parsed_version = packaging.version.Version(self.egg_version)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/setuptools/_vendor/packaging/version.py", line 198, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
setuptools.extern.packaging.version.InvalidVersion: Invalid version: '128-NOTFOUND-bb1a55f3'

bcc's GitHub workflow has been failing for a while when building from
a shallow clone (git clone --depth 1). In this case, git_describe()
from CMake returns an invalid version string (128-NOTFOUND-deadbeef).

Older setuptools versions used in Fedora 38 tolerated this format, but
with Ubuntu 24.04's newer setuptools enforces PEP 440 compliance and
treats it as an error, breaking the CI build.

This updates cmake/version.cmake to detect this case and fall back to a
compliant 0.0.0+<hash> version when tags are missing. Commit hash is
kept for traceability and behavior with full clone hasn't changed.

Signed-off-by: Hoyeon Lee <[email protected]>
@ekyooo
Copy link
Collaborator

ekyooo commented Oct 26, 2025

LGTM, Thank you.

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

Successfully merging this pull request may close these issues.

2 participants