question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rebasehelper doesn't like kernel.spec file

See original GitHub issue

On packitos-0.2.1.dev10+g074675c.d20190322, the rebasehelper module to parse the kernel.spec file doesn’t seem to parse it correctly:

$ packit srpm ERROR
Unexpected exception occurred, please fill an issue here: https://github.com/packit-service/packit/issues [labbott@labbott-redhat kernel-packit-experimental]$ packit -d srpm 16:44:17.864 packit_base.py DEBUG logging set to DEBUG 16:44:17.864 local_project.py DEBUG working_dir is set and git_repo is not: let’s discover… 16:44:17.865 local_project.py DEBUG it’s a git repo! 16:44:17.868 local_project.py DEBUG remote url of the repo is ssh://git@pagure.io/kernel-packit-experimental.git 16:44:17.868 local_project.py DEBUG namespace from url is 16:44:17.868 local_project.py DEBUG namespace from url is 16:44:17.868 local_project.py DEBUG namespace from url is 16:44:17.868 config.py DEBUG Local package config found: /home/labbott/kernel-packit-experimental/.packit.yaml 16:44:17.870 config.py DEBUG Package config: { “specfile_path”: “fedora/kernel.spec”, “synced_files”: [ “Makefile” ], “upstream_project_name”: “kernel”, “downstream_package_name”: “kernel” } 16:44:17.871 utils.py DEBUG cmd = [‘git’, ‘describe’, ‘–tags’, ‘–match’, ‘.’] 16:44:17.946 upstream.py DEBUG version = v4.20.14-115-g47bf7598cc03 16:44:17.946 upstream.py DEBUG sanitized version = v4.20.14.115.g47bf7598cc03 16:44:17.947 local_project.py DEBUG working_dir is set and git_repo is not: let’s discover… 16:44:17.947 local_project.py DEBUG it’s a git repo! 16:44:17.951 local_project.py DEBUG remote url of the repo is ssh://git@pagure.io/kernel-packit-experimental.git 16:44:17.951 local_project.py DEBUG namespace from url is 16:44:17.951 local_project.py DEBUG namespace from url is 16:44:17.951 local_project.py DEBUG namespace from url is ERROR
Traceback (most recent call last): File “/home/labbott/.local/lib/python3.7/site-packages/rebasehelper/specfile.py”, line 272, in _update_data self.spc = RpmHelper.parse_spec(self.path, flags=rpm.RPMSPEC_ANYARCH) File “/home/labbott/.local/lib/python3.7/site-packages/rebasehelper/helpers/rpm_helper.py”, line 178, in parse_spec result = rpm.spec(tmp.name, flags) if flags is not None else rpm.spec(tmp.name) ValueError: can’t parse specfile

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/home/labbott/.local/lib/python3.7/site-packages/rebasehelper/specfile.py”, line 276, in _update_data self.spc = RpmHelper.parse_spec(self.path) File “/home/labbott/.local/lib/python3.7/site-packages/rebasehelper/helpers/rpm_helper.py”, line 178, in parse_spec result = rpm.spec(tmp.name, flags) if flags is not None else rpm.spec(tmp.name) ValueError: can’t parse specfile

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/home/labbott/.local/lib/python3.7/site-packages/packit/cli/utils.py”, line 35, in covered_func func(config=config, *args, **kwargs) File “/home/labbott/.local/lib/python3.7/site-packages/packit/cli/srpm.py”, line 30, in srpm srpm_path = api.create_srpm(output_file=output) File “/home/labbott/.local/lib/python3.7/site-packages/packit/api.py”, line 284, in create_srpm spec_version = up.get_specfile_version() File “/home/labbott/.local/lib/python3.7/site-packages/packit/upstream.py”, line 288, in get_specfile_version version = self.specfile.get_full_version() File “/home/labbott/.local/lib/python3.7/site-packages/packit/upstream.py”, line 66, in specfile changelog_entry=None, File “/home/labbott/.local/lib/python3.7/site-packages/rebasehelper/specfile.py”, line 212, in init self._update_data() File “/home/labbott/.local/lib/python3.7/site-packages/rebasehelper/specfile.py”, line 278, in _update_data raise RebaseHelperError(“Problem with parsing SPEC file ‘%s’” % self.path) rebasehelper.exceptions.RebaseHelperError

diff --git a/fedora/kernel.spec b/fedora/kernel.spec
index 5495bd1611b8..dcc6d1ee1446 100644
--- a/fedora/kernel.spec
+++ b/fedora/kernel.spec
@@ -54,7 +54,7 @@ Summary: The Linux kernel
 %if 0%{?released_kernel}
 
 # Do we have a -stable update to apply?
-%define stable_update 14
+%define stable_update 14.115.g47bf7598cc03
 # Set rpm version accordingly
 %if 0%{?stable_update}
 %define stablerev %{stable_update}
@@ -368,8 +368,8 @@ Summary: The Linux kernel
 Name: kernel%{?variant}
 License: GPLv2 and Redistributable, no modification permitted
 URL: https://www.kernel.org/
-Version: %{rpmversion}
-Release: %{pkg_release}
+Version: v4.20.14.115.g47bf7598cc03
+Release: 1%{?dist}
 # DO NOT CHANGE THE 'ExclusiveArch' LINE TO TEMPORARILY EXCLUDE AN ARCHITECTURE BUILD.
 # SET %%nobuildarches (ABOVE) INSTEAD
 ExclusiveArch: %{all_x86} x86_64 s390x %{arm} aarch64 ppc64le
@@ -676,14 +676,6 @@ Obsoletes: kernel-bootwrapper\
 %define variant_summary The Linux kernel compiled for PAE capable machines
 %kernel_variant_package %{pae}
 %description %{pae}-core
-This package includes a version of the Linux kernel with support for up to
-64GB of high memory. It requires a CPU with Physical Address Extensions (PAE).
-The non-PAE kernel can only address up to 4GB of memory.
-Install the kernel-PAE package if your machine has more than 4GB of memory.
-%else
-%define variant_summary The Linux kernel compiled for Cortex-A15
-%kernel_variant_package %{pae}
-%description %{pae}-core
 This package includes a version of the Linux kernel with support for
 Cortex-A15 devices with LPAE and HW virtualisation support
 %endif
@@ -1760,6 +1752,9 @@ fi
 #
 #
 %changelog
+* Tue Mar 19 2019 Laura Abbott <labbott@redhat.com>
+- Development snapshot
+
 * Tue Mar 05 2019 Justin M. Forbes <jforbes@fedoraproject.org> - 4.20.14-200
 - Linux v4.20.14

From this diff and looking at rebasehelper, it doesn’t look like the parser likes the word ‘version’ and behaves strangely (see also deleting the block starting with “This package includes…”). I also don’t think the stable_update should have been updated either.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
TomasTomecekcommented, Mar 27, 2019

We can also use rpmdev-bumpspec to change the version, @labbott I will try that and see what are the results.

I am currently working on the hooks/configurable-scripts across the packit workflows and it is not a problem with being able to set a custom script in the config file. (And have a good default.)

+1

But this is still a valid bug report 😃

0reactions
TomasTomecekcommented, Oct 1, 2019

Since this is 5 months old and there have been numerous updates to rebase-helper and packit, I’m going to close. Please reopen or report a new one if you run into more issues. Thanks for the report!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rebasing and merging in kernel repositories - LWN.net
It is natural to want to merge the master branch into a repository; this type of merge is often called a "back merge"....
Read more >
git-rebase Documentation - Git
git/rebase-apply working files, use the command git rebase --abort instead. Assume the following history exists and the current branch is "topic": A---B---C ...
Read more >
git rebase (Al Viro; Linus Torvalds; Theodore Tso) - Yarchive
With merge window in question normally taking a few days. From: Linus Torvalds <torvalds@linux-foundation.org> Newsgroups: fa.linux.kernel Subject: Re: Announce ...
Read more >
Welcome to rebase-helper - GitHub
This tool helps you rebase your package to the latest version - GitHub ... After installation, execute rebase-helper from a directory containing SPEC...
Read more >
Kernel rebase notes - The Chromium Projects
A kernel rebase consists of moving sets (ie, topics) of patches from one version to ... I highly recommending closely examining 'git rebase...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found