[opensuse-factory] Source RPMs in OBS
When I build packages in OBS, I get a source RPM for each architecture (e.g., i586, x86_64). I am curious what the differences might be in these source RPMs. I would guess there are two possible sources of differences: the package's .spec file and the OBS macros used when making the source RPMs. Are there directives in either of these that are resolved when the source RPM is built, resulting in a different source RPMs on a specific platform? I ask because I am considering making a local copy of the source RPMs I have in OBS so that, in an emergency, they can be used to rpmbuild --rebuild the package locally. This is working fantastic for me. But I have been using the source rpm for each platform. Do I really need to do this? The built binary RPMs I build locally are, of course, for the platform on which I run rpmbuild. Does this question make sense? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 05/10/2016 09:01, Roger Oberholtzer wrote:
When I build packages in OBS, I get a source RPM for each architecture (e.g., i586, x86_64). I am curious what the differences might be in these source RPMs. I would guess there are two possible sources of differences: the package's .spec file and the OBS macros used when making the source RPMs. Are there directives in either of these that are resolved when the source RPM is built, resulting in a different source RPMs on a specific platform?
I ask because I am considering making a local copy of the source RPMs I have in OBS so that, in an emergency, they can be used to rpmbuild --rebuild the package locally. This is working fantastic for me. But I have been using the source rpm for each platform. Do I really need to do this? The built binary RPMs I build locally are, of course, for the platform on which I run rpmbuild.
Does this question make sense?
The only time a source rpm can differ between i586 and x86_64 is if it contains a binary package like flash-player for instance. Otherwise they are identical. Dave P -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Hello, On Oct 5 09:38 Dave Plater wrote (excerpt):
... a source rpm can differ ...
At least in the past it was possible that the source rpm could be even corrupted by a bad spec file when there are commands run by the spec file that modify the source files (e.g. something like "sed -i -e ... %{SOURCE123}"), then the modified source files get packaged as source rpm. Of course one should not do that but at least in the past it was possible to get a broken source rpm by a bad spec file. See https://bugzilla.opensuse.org/show_bug.cgi?id=463464#c11 and https://bugzilla.opensuse.org/show_bug.cgi?id=463464#c22 Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, Oct 05, 2016 at 09:38:29AM +0200, Dave Plater wrote:
On 05/10/2016 09:01, Roger Oberholtzer wrote:
When I build packages in OBS, I get a source RPM for each architecture (e.g., i586, x86_64). I am curious what the differences might be in these source RPMs. I would guess there are two possible sources of differences: the package's .spec file and the OBS macros used when making the source RPMs. Are there directives in either of these that are resolved when the source RPM is built, resulting in a different source RPMs on a specific platform?
I ask because I am considering making a local copy of the source RPMs I have in OBS so that, in an emergency, they can be used to rpmbuild --rebuild the package locally. This is working fantastic for me. But I have been using the source rpm for each platform. Do I really need to do this? The built binary RPMs I build locally are, of course, for the platform on which I run rpmbuild.
Does this question make sense?
The only time a source rpm can differ between i586 and x86_64 is if it contains a binary package like flash-player for instance. Otherwise they are identical.
Not always true. Consider having: %ifarch x86_64 Patch: x86_64.patch %endif %ifarch x86_64 %patch %endif Then x86_64.patch will only be in the x86_64 src rpm. (That's why it's considered bad styly to have %ifs in the Source/Patch section and your package will be rejected for Factory.) Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, 2016-10-05 at 10:49 +0200, Michael Schroeder wrote:
On Wed, Oct 05, 2016 at 09:38:29AM +0200, Dave Plater wrote:
On 05/10/2016 09:01, Roger Oberholtzer wrote:
When I build packages in OBS, I get a source RPM for each architecture (e.g., i586, x86_64). I am curious what the differences might be in these source RPMs. I would guess there are two possible sources of differences: the package's .spec file and the OBS macros used when making the source RPMs. Are there directives in either of these that are resolved when the source RPM is built, resulting in a different source RPMs on a specific platform?
I ask because I am considering making a local copy of the source RPMs I have in OBS so that, in an emergency, they can be used to rpmbuild --rebuild the package locally. This is working fantastic for me. But I have been using the source rpm for each platform. Do I really need to do this? The built binary RPMs I build locally are, of course, for the platform on which I run rpmbuild.
Does this question make sense?
The only time a source rpm can differ between i586 and x86_64 is if it contains a binary package like flash-player for instance. Otherwise they are identical.
Not always true. Consider having:
%ifarch x86_64 Patch: x86_64.patch %endif
%ifarch x86_64 %patch %endif
Then x86_64.patch will only be in the x86_64 src rpm. (That's why it's considered bad styly to have %ifs in the Source/Patch section and your package will be rejected for Factory.)
And that's actually a case the review team tries to spot and decline. The idea IS to get re-usable src.rpms... you can APPLY the patch conditionally - but please don't add it to the src.rpm conditionally. Cheers, Dominique
On Wed, Oct 5, 2016 at 10:53 AM, Dominique Leuenberger / DimStar
you can APPLY the patch conditionally - but please don't add it to the src.rpm conditionally.
And to do this, the Patch: directives are not conditional. So far okay. But how to make the later %patch calls conditional without using %ifarch (which seems to be resolved when the source RPM is created)? Is there is a web resource describing this? I don't mean RPM in general. But specifically how OBS is dealing with this. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Okt 05 2016, Roger Oberholtzer
But how to make the later %patch calls conditional without using %ifarch (which seems to be resolved when the source RPM is created)?
No, it isn't. When building a source RPM none of the sections are executed. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, 2016-10-05 at 12:17 +0200, Roger Oberholtzer wrote:
On Wed, Oct 5, 2016 at 10:53 AM, Dominique Leuenberger / DimStar
wrote: you can APPLY the patch conditionally - but please don't add it to the src.rpm conditionally.
And to do this, the Patch: directives are not conditional. So far okay.
But how to make the later %patch calls conditional without using %ifarch (which seems to be resolved when the source RPM is created)?
No; the %prep / %build / %install phases are pristine in the .spec file and are thus considered by rpmbuild; in fact, the .spec file is never modified before added to the .spec file (except the cases which Johannes listed already - but those are evil to start with) With this part of the .spec Name: FOO %ifarch x86_64 Patch0: x86_64.patch %else Patch0: i586.patch %endif [...] %prep %setup %patch0 you result in the probblem that the .src.rpm contains only ONE of the patches (depending on the arch it was built on) - but the .spec file inside the .src.rpm retains the logic to switch; result: it fails to build on the other arch for missing files
Is there is a web resource describing this? I don't mean RPM in general. But specifically how OBS is dealing with this.
OBS doesn't do anything special here - this is pure rpmbuild and users tripping over it. Cheer, Dominique
On Wed, Oct 5, 2016 at 12:24 PM, Dominique Leuenberger / DimStar
On Wed, 2016-10-05 at 12:17 +0200, Roger Oberholtzer wrote:
On Wed, Oct 5, 2016 at 10:53 AM, Dominique Leuenberger / DimStar
wrote: you can APPLY the patch conditionally - but please don't add it to the src.rpm conditionally.
And to do this, the Patch: directives are not conditional. So far okay.
But how to make the later %patch calls conditional without using %ifarch (which seems to be resolved when the source RPM is created)?
No; the %prep / %build / %install phases are pristine in the .spec file and are thus considered by rpmbuild; in fact, the .spec file is never modified before added to the .spec file (except the cases which Johannes listed already - but those are evil to start with)
With this part of the .spec
Name: FOO %ifarch x86_64 Patch0: x86_64.patch %else Patch0: i586.patch %endif
[...]
%prep %setup %patch0
So if I wanted to accomplish this so the tests happened in my local rpmbuild --rebuild, would I do this: Name: FOO Patch0: x86_64.patch Patch1: i586.patch [...] %prep %setup %ifarch x86_64 %patch0 %else %patch1 %endif Not that I would do this sort of thing. But just so I understand. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, 2016-10-05 at 15:38 +0200, Roger Oberholtzer wrote:
On Wed, Oct 5, 2016 at 12:24 PM, Dominique Leuenberger / DimStar
wrote: On Wed, 2016-10-05 at 12:17 +0200, Roger Oberholtzer wrote:
On Wed, Oct 5, 2016 at 10:53 AM, Dominique Leuenberger / DimStar
wrote: you can APPLY the patch conditionally - but please don't add it to the src.rpm conditionally.
And to do this, the Patch: directives are not conditional. So far okay.
But how to make the later %patch calls conditional without using %ifarch (which seems to be resolved when the source RPM is created)?
No; the %prep / %build / %install phases are pristine in the .spec file and are thus considered by rpmbuild; in fact, the .spec file is never modified before added to the .spec file (except the cases which Johannes listed already - but those are evil to start with)
With this part of the .spec
Name: FOO %ifarch x86_64 Patch0: x86_64.patch %else Patch0: i586.patch %endif
[...]
%prep %setup %patch0
So if I wanted to accomplish this so the tests happened in my local rpmbuild --rebuild, would I do this:
Name: FOO Patch0: x86_64.patch Patch1: i586.patch
[...]
%prep %setup %ifarch x86_64 %patch0 %else %patch1 %endif
Not that I would do this sort of thing. But just so I understand.
Right - with this approach, the .src.rpm turns out to be usable across archs in any case and is the way the review team asks for it to be submitted. Cheers, Dominique
On Wed, Oct 5, 2016 at 10:49 AM, Michael Schroeder
The only time a source rpm can differ between i586 and x86_64 is if it contains a binary package like flash-player for instance. Otherwise they are identical.
Not always true. Consider having:
%ifarch x86_64 Patch: x86_64.patch %endif
%ifarch x86_64 %patch %endif
It was this kind of thing I was wondering about. If %ifarch commands can have an effect on the source RPM that gets built (and not just be left in the .spec file for later evaluation), how about things that check for the SUSE release? The later is so common with BuildRequires as the various releases sometimes have different names for the required item. Those are resolved when the source RPM is built and not when I use it in my later rpmbuild --rebuild? So any %<some conditional test> in a .spec file can be a potential problem, I guess. And, even if my .spec file is clean from all these things, the macros in OBS may introduce differences? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (6)
-
Andreas Schwab
-
Dave Plater
-
Dominique Leuenberger / DimStar
-
Johannes Meixner
-
Michael Schroeder
-
Roger Oberholtzer