packit / specfile

A library for parsing and manipulating RPM spec files
MIT License
24 stars 15 forks source link

RPMException: /tmp/tmpnv8a_vvm: line 8: Unknown option f in gometa(az:svi) #254

Closed sentry-io[bot] closed 1 year ago

sentry-io[bot] commented 1 year ago

Sentry Issue: PCKT-002-PACKIT-SERVICE-62S

ValueError: can't parse specfile

  File "specfile/spec_parser.py", line 206, in get_rpm_spec
    return rpm.spec(tmp.name, flags)

RPMException: /tmp/tmpnv8a_vvm: line 8: Unknown option f in gometa(az:svi)
(3 additional frame(s) were not displayed)
...
  File "packit/base_git.py", line 112, in specfile
    self._specfile = Specfile(
  File "specfile/specfile.py", line 71, in __init__
    self._parser.parse(str(self))
  File "specfile/spec_parser.py", line 360, in parse
    self.spec, self.tainted = self._do_parse(content, extra_macros)
  File "specfile/spec_parser.py", line 274, in _do_parse
    spec = get_rpm_spec(content, rpm.RPMSPEC_ANYARCH | rpm.RPMSPEC_FORCE)
  File "specfile/spec_parser.py", line 208, in get_rpm_spec
    raise RPMException(stderr=stderr) from e

@lbarcziova: example specfile where the error comes from: https://src.fedoraproject.org/rpms/git-credential-oauth/blob/rawhide/f/git-credential-oauth.spec

nforro commented 1 year ago

This is caused by an older version of go-srpm-macros in CentOS Stream 9, which is a bug, because the package is rebased to the latest upstream version (same as in Fedora), however a build is missing. Maintainer is working on a fix. Once the build makes it to the repos, updating the worker image should resolve this issue.

nforro commented 1 year ago

Updated go-srpm-macros package is now on workers in production, so this should no longer be an issue.