8000 Too many names error for parsing · Issue #475 · packit/specfile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Too many names error for parsing #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks
fmarco76 opened this issue May 19, 2025 · 3 comments · Fixed by #476
Closed
2 tasks

Too many names error for parsing #475

fmarco76 opened this issue May 19, 2025 · 3 comments · Fixed by #476
Assignees
Labels
kind/bug An unexpected problem or behavior

Comments

@fmarco76
Copy link

What happened? What is the problem?

Building Dogtag PKI package with packit provide the folloing error:

2025-05-16 15:17:53.588 logging.py        DEBUG  v11.6.0-301-gef79d8fa0c
2025-05-16 15:17:53.690 utils.py          ERROR  Preparation of the repository for creation of an SRPM failed: line 1648: Too many names: %files -n dogtag-pki -f\\ .mfiles
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 233, in get_rpm_spec
    return rpm.spec(tmp.name, flags)
           ~~~~~~~~^^^^^^^^^^^^^^^^^
ValueError: can't parse specfile


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/packit/api.py", line 1979, in prepare_sources
    self.up.prepare_upstream_for_srpm_creation(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        upstream_ref=upstream_ref,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        env=self.common_env(),
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/packit/upstream.py", line 1052, in prepare_upstream_for_srpm_creation
    SRPMBuilder(upstream=self, ref=upstream_ref).prepare(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        update_release=update_release,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        env=env,
        ^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/packit/upstream.py", line 1552, in prepare
    self._fix_specfile_to_use_local_archive(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        archive=created_archive,
        ^^^^^^^^^^^^^^^^^^^^^^^^
        update_release=update_release,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        release_suffix=release_suffix,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/packit/upstream.py", line 1522, in _fix_specfile_to_use_local_archive
    new_release = self.upstream.get_spec_release(release_suffix)
  File "/usr/lib/python3.13/site-packages/packit/upstream.py", line 889, in get_spec_release
    original_release_number = self.specfile.expanded_release.split(".", 1)[0]
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/specfile.py", line 768, in expanded_release
    return self.expand(self.release, extra_macros=[("dist", "")])
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/specfile.py", line 307, in expand
    self._parser.parse(str(self), extra_macros)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 387, in parse
    self.spec, self.tainted = self._do_parse(content, extra_macros)
                              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 301, in _do_parse
    spec = get_rpm_spec(content, rpm.RPMSPEC_ANYARCH | rpm.RPMSPEC_FORCE)
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 235, in get_rpm_spec
    raise RPMException(stderr=stderr) from e
specfile.exceptions.RPMException: line 1648: Too many names: %files -n dogtag-pki -f\\ .mfiles

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/packit/cli/utils.py", line 47, in covered_func
    func(config=config, *args, **kwargs)  # noqa: B026
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/packit/cli/utils.py", line 143, in covered_func
    func(*args, **decorated_func_kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/packit/cli/prepare_sources.py", line 193, in prepare_sources
    api.prepare_sources(
    ~~~~~~~~~~~~~~~~~~~^
        upstream_ref=upstream_ref,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        create_symlinks=create_symlinks,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/packit/api.py", line 1988, in prepare_sources
    raise PackitSRPMException(
        f"Preparation of the repository for creation of an SRPM failed: {ex}",
    ) from ex
packit.exceptions.PackitSRPMException: Preparation of the repository for creation of an SRPM failed: line 1648: Too many names: %files -n dogtag-pki -f\\ .mfiles
2025-05-16 15:17:53.694 local_project.py  DEBUG  Cleaning: /tmp/tmp938844s_

What did you expect to happen?

It should properly generate the source package because the spec file is valid and works properly.

Example URL(s)

The error can be seen in all Packit build of DogtagPKI.

Steps to reproduce

Approach 1:
1. Try to reproduce packit build from the above

Approach 2 (it produce the same errror):
1. Getting the pki project from the repository https://github.com/dogtagpki/pki
2. open python interpreter
3. Run the following commands:

>>> from  specfile import Specfile
>>> spec = Specfile(path="/home/mfargetta/Projects/upstream/pki/pki.spec")
>>> print(spec.expanded_version)
11.7.0
>>> print(spec.expanded_name)
pki
>>> print(spec.expanded_version)
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 233, in get_rpm_spec
    return rpm.spec(tmp.name, flags)
           ~~~~~~~~^^^^^^^^^^^^^^^^^
ValueError: can't parse specfile


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<python-input-4>", line 1, in <module>
    print(spec.expanded_version)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/specfile.py", line 692, in getter
    return getattr(tags, name).expanded_value
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/tags.py", line 287, in expanded_value
    return self._context.expand(self.value)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/specfile.py", line 307, in expand
    self._parser.parse(str(self), extra_macros)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 387, in parse
    self.spec, self.tainted = self._do_parse(content, extra_macros)
                              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 301, in _do_parse
    spec = get_rpm_spec(content, rpm.RPMSPEC_ANYARCH | rpm.RPMSPEC_FORCE)
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 235, in get_rpm_spec
    raise RPMException(stderr=stderr) from e
specfile.exceptions.RPMException: line 1648: Too many names: %files -n dogtag-pki -f\\ .mfiles

Workaround

  • There is an existing workaround that can be used until this issue is fixed.

Participation

  • I am willing to submit a pull request for this issue. (Packit team is happy to help!)
@fmarco76 fmarco76 added the kind/bug An unexpected problem or behavior label May 19, 2025
@nforro
Copy link
Member
nforro commented May 20, 2025

Thanks for the reproducer, it should be fixed soon.

@nforro nforro self-assigned this May 20, 2025
@nforro nforro moved this from new to in-progress in Packit Kanban Board May 20, 2025
@nforro nforro moved this from in-progress to in-review in Packit Kanban Board May 20, 2025
@nforro
Copy link
Member
nforro commented May 20, 2025

@fmarco76 After the linked PR is merged, fixed specfile build will be available in our development Copr repo and the fix will be deployed to Packit Service production on Monday next week. Is it ok or do you need the fix sooner?

@fmarco76
Copy link
Author

@nforro The time for moving to production is OK. Thanks for the quick solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug An unexpected problem or behavior
Projects
Status: done
Development

Successfully merging a pull request may close this issue.

2 participants
0