Re: pylibfdt breakage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Feb 02, 2023 at 09:00:05AM -0600, Rob Herring wrote:
> On Thu, Feb 2, 2023 at 8:15 AM Rob Herring <robh@xxxxxxxxxx> wrote:
> >
> > On Wed, Oct 19, 2022 at 3:09 AM David Gibson
> > <david@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > >
> > > Hi Simon,
> > >
> > > I probably should have contacted you sooner about this.  For some
> > > time, I've been unable to compile and test the pylibfdt components on
> > > my system (Fedora 36).  I get this error:
> > >
> > > $ make
> > >         CHK version_gen.h
> > > make[1]: Entering directory '/home/dwg/src/dtc'
> > >         CHK version_gen.h
> > >          PYMOD pylibfdt/_libfdt.so
> > > /usr/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
> > >   warnings.warn(
> > > /home/dwg/src/dtc/.eggs/setuptools_scm-7.0.5-py3.10.egg/setuptools_scm/version.py:84: UserWarning: tag 'path-ref-fixup-staging' no version found
> >
> > I think the problem is you have a git tag 'path-ref-fixup-staging'
> > which doesn't match any version pattern (e.g. v1.0.0). The default
> > pattern is:

Hrm.  I don't have a tag called 'path-ref-fixup-staging'.  I do have
one called 'path-ref-fixup-v1' (generated by git publish).  I'm not
sure why setuptools would be looking at tags unrelated to my current
branch anyway.

> > DEFAULT_TAG_REGEX =
> > r"^(?:[\w-]+-)?(?P<version>[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$"
> >
> > https://github.com/pypa/setuptools_scm/blob/main/src/setuptools_scm/config.py#L28
> 
> I tried adding non-version tags and still don't reproduce this.
> 
> What does this give you: python setup.py --version

So... that alone is enough to crash..

$ python setup.py --version
/usr/lib/python3.11/site-packages/setuptools_scm/version.py:84: UserWarning: tag 'path-ref-fixup-staging' no version found
  warnings.warn(f"tag {tag!r} no version found")
Traceback (most recent call last):
  File "/home/dwg/src/dtc/setup.py", line 50, in <module>
    setup(
  File "/usr/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 139, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 477, in __init__
    _Distribution.__init__(
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 275, in __init__
    self.finalize_options()
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 901, in finalize_options
    ep(self)
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 922, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/usr/lib/python3.11/site-packages/setuptools_scm/integration.py", line 90, in version_keyword
    _assign_version(dist, config)
  File "/usr/lib/python3.11/site-packages/setuptools_scm/integration.py", line 59, in _assign_version
    maybe_version = _get_version(config)
                    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/__init__.py", line 154, in _get_version
    parsed_version = _do_parse(config)
                     ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/__init__.py", line 101, in _do_parse
    version = _version_from_entrypoints(config) or _version_from_entrypoints(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/_entrypoints.py", line 66, in _version_from_entrypoints
    version: ScmVersion | None = _call_entrypoint_fn(root, config, ep.load())
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/_entrypoints.py", line 40, in _call_entrypoint_fn
    return fn(root, config=config)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/git.py", line 181, in parse
    return _git_parse_inner(
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/git.py", line 224, in _git_parse_inner
    return meta(
           ^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/version.py", line 226, in meta
    parsed_version = _parse_tag(tag, preformatted, config)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/version.py", line 203, in _parse_tag
    assert version is not None
AssertionError

> Can you run the build with "SETUPTOOLS_SCM_DEBUG=1".

$ SETUPTOOLS_SCM_DEBUG=1 python setup.py --version
version keyword {'name': 'libfdt', 'version': None, 'author': 'Simon Glass', 'author_email': 'sjg@xxxxxxxxxxxx', 'maintainer': None, 'maintainer_email': None, 'url': 'https://git.kernel.org/pub/scm/utils/dtc/dtc.git', 'license': 'BSD', 'description': 'Python binding for libfdt', 'long_description': '# Device Tree Compiler and libfdt\n\nThe source tree contains the Device Tree Compiler (dtc) toolchain for\nworking with device tree source and binary files and also libfdt, a\nutility library for reading and manipulating the binary format.\n\ndtc and libfdt are maintained by:\n\n* [David Gibson `<david@xxxxxxxxxxxxxxxxxxxxx>`](mailto:david@xxxxxxxxxxxxxxxxxxxxx)\n\n## Python library\n\nA Python library wrapping libfdt is also available. To build this you\nwill need to install `swig` and Python development files. On Debian\ndistributions:\n\n```\n$ sudo apt-get install swig python3-dev\n```\n\nThe library provides an `Fdt` class which you can use like this:\n\n```\n$ PYTHONPATH=../pylibfdt python3\n>>> import libfdt\n>>> fdt = libfdt.Fdt(open(\'test_tree1.dtb\', mode=\'rb\').read())\n>>> node = fdt.path_offset(\'/subnode@1\')\n>>> print(node)\n124\n>>> prop_offset = fdt.first_property_offset(node)\n>>> prop = fdt.get_property_by_offset(prop_offset)\n>>> print(\'%s=%s\' % (prop.name, prop.as_str()))\ncompatible=subnode1\n>>> node2 = fdt.path_offset(\'/\')\n>>> print(fdt.getprop(node2, \'compatible\').as_str())\ntest_tree1\n```\n\nYou will find tests in `tests/pylibfdt_tests.py` showing how to use each\nmethod. Help is available using the Python help command, e.g.:\n\n```\n$ cd pylibfdt\n$ python3 -c "import libfdt; help(libfdt)"\n```\n\nIf you add new features, please check code coverage:\n\n```\n$ sudo apt-get install python3-coverage\n$ cd tests\n# It\'s just \'coverage\' on most other distributions\n$ python3-coverage run pylibfdt_tests.py\n$ python3-coverage html\n# Open \'htmlcov/index.html\' in your browser\n```\n\nThe library can be installed with pip from a local source tree:\n\n```\n$ pip install . [--user|--prefix=/path/to/install_dir]\n```\n\nOr directly from a remote git repo:\n\n```\n$ pip install git+git://git.kernel.org/pub/scm/utils/dtc/dtc.git@main\n```\n\nThe install depends on libfdt shared library being installed on the\nhost system first. Generally, using `--user` or `--prefix` is not\nnecessary and pip will use the default location for the Python\ninstallation which varies if the user is root or not.\n\nYou can also install everything via make if you like, but pip is\nrecommended.\n\nTo install both libfdt and pylibfdt you can use:\n\n```\n$ make install [PREFIX=/path/to/install_dir]\n```\n\nTo disable building the python library, even if swig and Python are available,\nuse:\n\n```\n$ make NO_PYTHON=1\n```\n\nMore work remains to support all of libfdt, including access to numeric\nvalues.\n\n## Mailing lists\n\n* The [devicetree-compiler](mailto:devicetree-compiler@xxxxxxxxxxxxxxx)\n  list is for discussion about dtc and libfdt implementation.\n* Core device tree bindings are discussed on the\n  [devicetree-spec](mailto:devicetree-spec@xxxxxxxxxxxxxxx) list.\n\n', 'keywords': None, 'platforms': None, 'classifiers': ['Programming Language :: Python :: 3', 'License :: OSI Approved :: BSD License', 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', 'Operating System :: OS Independent'], 'download_url': None, 'provides': None, 'requires': None, 'obsoletes': None}
abs root {'root': '/home/dwg/src/dtc', 'relative_to': None}
root '/home/dwg/src/dtc'
relative_to None
dist name: libfdt
version_from_ep setuptools_scm.parse_scm /home/dwg/src/dtc
looking for ep setuptools_scm.parse_scm /home/dwg/src/dtc
found ep EntryPoint(name='.git', value='setuptools_scm.git:parse', group='setuptools_scm.parse_scm') in /home/dwg/src/dtc
----
cmd:
     git --git-dir /home/dwg/src/dtc/.git rev-parse --show-prefix
 in: /home/dwg/src/dtc
out:
 

real root /home/dwg/src/dtc
----
cmd:
     git --git-dir /home/dwg/src/dtc/.git describe --dirty --tags --long --match "*[0-9]*"
 in: /home/dwg/src/dtc
out:
     path-ref-fixup-staging-10-g2022bb1

err:
     warning: tag 'path-ref-fixup-v1' is externally known as 'path-ref-fixup-staging'

----
cmd:
     git --git-dir /home/dwg/src/dtc/.git rev-parse --abbrev-ref HEAD
 in: /home/dwg/src/dtc
out:
     main

----
cmd:
     git --git-dir /home/dwg/src/dtc/.git -c log.showSignature=false log -n 1 HEAD --format=%cI
 in: /home/dwg/src/dtc
out:
     2023-02-02T17:46:54+11:00

tag path-ref-fixup-staging
tag 'path-ref-fixup-staging' parsed to None
/usr/lib/python3.11/site-packages/setuptools_scm/version.py:84: UserWarning: tag 'path-ref-fixup-staging' no version found
  warnings.warn(f"tag {tag!r} no version found")
Traceback (most recent call last):
  File "/home/dwg/src/dtc/setup.py", line 50, in <module>
    setup(
  File "/usr/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 139, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 477, in __init__
    _Distribution.__init__(
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 275, in __init__
    self.finalize_options()
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 901, in finalize_options
    ep(self)
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 922, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/usr/lib/python3.11/site-packages/setuptools_scm/integration.py", line 90, in version_keyword
    _assign_version(dist, config)
  File "/usr/lib/python3.11/site-packages/setuptools_scm/integration.py", line 59, in _assign_version
    maybe_version = _get_version(config)
                    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/__init__.py", line 154, in _get_version
    parsed_version = _do_parse(config)
                     ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/__init__.py", line 101, in _do_parse
    version = _version_from_entrypoints(config) or _version_from_entrypoints(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/_entrypoints.py", line 66, in _version_from_entrypoints
    version: ScmVersion | None = _call_entrypoint_fn(root, config, ep.load())
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/_entrypoints.py", line 40, in _call_entrypoint_fn
    return fn(root, config=config)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/git.py", line 181, in parse
    return _git_parse_inner(
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/git.py", line 224, in _git_parse_inner
    return meta(
           ^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/version.py", line 226, in meta
    parsed_version = _parse_tag(tag, preformatted, config)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools_scm/version.py", line 203, in _parse_tag
    assert version is not None
AssertionError

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux