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.

packit mutates the spec in an unexpected way

See original GitHub issue

I’m trying out packit rev daad3f8 with a packit.yaml that worked as of ~2 weeks ago. Running packit srpm fails, because rpmbuild complains about missing source file. This appears to be caused by how packit mutates the spec file.

Below is the diff of the snapd tree after packit has finished running:

diff --git a/packaging/fedora/snapd.spec b/packaging/fedora/snapd.spec
index 812618080..565867144 100644
--- a/packaging/fedora/snapd.spec
+++ b/packaging/fedora/snapd.spec
@@ -91,12 +91,12 @@
 %endif
 
 Name:           snapd
-Version:        2.40
-Release:        0%{?dist}
+Version:        2.40.516.gaa3edc1a7
+Release:        1%{?dist}
 Summary:        A transactional software package manager
 License:        GPLv3
 URL:            https://%{provider_prefix}
-Source0:        https://%{provider_prefix}/releases/download/%{version}/%{name}_%{version}.no-vendor.tar.xz
+Source0:        snapd-2.40.516.gaa3edc1a7.tar.gz
 Source1:        https://%{provider_prefix}/releases/download/%{version}/%{name}_%{version}.only-vendor.tar.xz
 
 %if 0%{?with_goarches}
@@ -866,6 +866,9 @@ fi
 
 
 %changelog
+* Sat Aug 10 2019 Maciej Borzecki <maciej.zenon.borzecki@canonical.com> - 2.40.516.gaa3edc1a7-1
+- Development snapshot (aa3edc1a)
+
 * Fri Jul 12 2019 Michael Vogt <mvo@ubuntu.com>
 - New upstream release 2.40
  - overlord/patch: simplify conditions for re-applying sublevel

For simplicity the spec uses the same naming scheme as snapd upstream, so that source tarball can be obtained directly from github releases page.

.packit.yaml I use:

specfile_path: packaging/fedora/snapd.spec
synced_files:
  - .packit.yaml
  - packaging/fedora/snapd.spec
upstream_project_name: snapd
downstream_package_name: snapd
create_tarball_command: ["packaging/fedora/pack-source", "-o", "packaging/fedora", "-g"]
current_version_command: ["git", "describe"]

The tarball command generates a source file inside packaging/fedora directory within the snapd source tree, the files are named to match the source lines in the spec.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bboozzoocommented, Sep 3, 2019

Nice, thank you for digging into that!

I’m sure @Conan-Kudo will be happy when we’ll be able to hook up packit in snapd 😄

1reaction
TomasTomecekcommented, Sep 3, 2019

@bboozzoo howdy! finally managed to create a SRPM

https://github.com/TomasTomecek/snapd/tree/fedora-packit

I had to tweak the srpm code in packit quite a bit - I also added support for one more action type which allows anyone to bypass the spec file munging process and replace it with your own, you can see it in action below:

14:52:29.463 utils.py          DEBUG  cmd = 'packaging/fedora/fix-spec'                                                                                                      
STDERR: + p=packaging/fedora         
++ ls -1 ./snapd_2.32.2.11362.g80ac822a4.no-vendor.tar.xz                             
++ xargs basename                                                                     
+ no_vendor=snapd_2.32.2.11362.g80ac822a4.no-vendor.tar.xz                            
++ ls -1 ./snapd_2.32.2.11362.g80ac822a4.only-vendor.tar.xz                           
++ xargs basename                                                                     
+ vendor=snapd_2.32.2.11362.g80ac822a4.only-vendor.tar.xz
+ sed -i packaging/fedora/snapd.spec -e 's/https.*no-vendor.tar.xz/snapd_2.32.2.11362.g80ac822a4.no-vendor.tar.xz/'
+ sed -i packaging/fedora/snapd.spec -e 's/https.*only-vendor.tar.xz/snapd_2.32.2.11362.g80ac822a4.only-vendor.tar.xz/'
14:52:29.509 upstream.py       DEBUG  present srpms = set()                                                                                                                  
14:52:29.509 utils.py          DEBUG  cmd = 'rpmbuild -bs --define _sourcedir . --define _specdir /home/tt/g/bboozzoo/snapd/packaging/fedora --define _srcrpmdir /home/tt/g/b
boozzoo/snapd --define _topdir /home/tt/g/bboozzoo/snapd/packaging/fedora --define _builddir /home/tt/g/bboozzoo/snapd/packaging/fedora --define _rpmdir /home/tt/g/bboozzoo/
snapd/packaging/fedora --define _buildrootdir /home/tt/g/bboozzoo/snapd/packaging/fedora packaging/fedora/snapd.spec'
14:52:29.971 utils.py          DEBUG  STDOUT: Wrote: /home/tt/g/bboozzoo/snapd/snapd-2.41-0.fc30.src.rpm
14:52:29.971 upstream.py       DEBUG  Wrote: /home/tt/g/bboozzoo/snapd/snapd-2.41-0.fc30.src.rpm
SRPM is /home/tt/g/bboozzoo/snapd/snapd-2.41-0.fc30.src.rpm
SRPM: /home/tt/g/bboozzoo/snapd/snapd-2.41-0.fc30.src.rpm
Read more comments on GitHub >

github_iconTop Results From Across the Web

__init__() unexpected argument 'uri': when building project ...
Im getting an error on every pio run command in VSCode Using Platformio 5.2.5 I tried removing platformio extension and .platformio folder ...
Read more >
Fatal - Unexpected Message returned with OpenSSL 3.0
Since migrating to OpenSSL 3.0 we are experiencing intermittent issues in TLS handshakes. Old env: Ubuntu 21.10 / Postfix 3.5.6 / OpenSSL ...
Read more >
Optimizing Server Performance - Ookla Support
There are hardware configurations which can directly alter network performance in potentially unexpected ways.
Read more >
Chapter 1. Reliable, Scalable, and Maintainable Applications
The application performs the function that the user expected. It can tolerate the user making mistakes or using the software in unexpected ways....
Read more >
RFC 2205: Resource ReSerVation Protocol (RSVP)
The flowspec is used to set parameters in the node's packet scheduler or other link ... When a route changes, the next Path...
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