Hello,
I have a spec here where I use a simple conditional to toggle py2 builds---so that I can use the same spec and provide py2 for F < 30 releases.
https://github.com/sanjayankur31/rpm-specs/blob/libneurosim/libneurosim.spec
However, when I flip that variable to enable py2 builds to 1:
%global with_py2 1
the build fails with this error:
error: Empty %files file /builddir/build/BUILD/libneurosim-57b76e222dd3196fa3c97ddfa2f8132627814c23/debugsourcefiles.list
I've checked, and the file is indeed empty, but I've not been able to figure out why. Would anyone have any clues please?
On Thu, Oct 18, 2018 23:11:56 +0100, Ankur Sinha wrote:
<snip>
https://github.com/sanjayankur31/rpm-specs/blob/libneurosim/libneurosim.spec
However, when I flip that variable to enable py2 builds to 1:
%global with_py2 1
the build fails with this error:
error: Empty %files file /builddir/build/BUILD/libneurosim-57b76e222dd3196fa3c97ddfa2f8132627814c23/debugsourcefiles.list
After some random tinkering, I find that if I install the py3 build later (the build that uses the "main" copy of the source), the build no longer fails:
https://github.com/sanjayankur31/rpm-specs/commit/26aa6d6e0b3816fee7c762113e...
I'm still at a loss to why this is so. Would someone be able to shed some light on this please?
On 19.10.2018 00:28, Ankur Sinha wrote:
On Thu, Oct 18, 2018 23:11:56 +0100, Ankur Sinha wrote:
<snip>
https://github.com/sanjayankur31/rpm-specs/blob/libneurosim/libneurosim.spec
However, when I flip that variable to enable py2 builds to 1:
%global with_py2 1
the build fails with this error:
error: Empty %files file /builddir/build/BUILD/libneurosim-57b76e222dd3196fa3c97ddfa2f8132627814c23/debugsourcefiles.list
After some random tinkering, I find that if I install the py3 build later (the build that uses the "main" copy of the source), the build no longer fails:
https://github.com/sanjayankur31/rpm-specs/commit/26aa6d6e0b3816fee7c762113e...
I'm still at a loss to why this is so. Would someone be able to shed some light on this please?
The debugsourcefiles.list is constructed from files in the current folder the build is in. In your case, that's the %{name}-%{commit} folder from %autosetup.
Anything you create outside that folder is not included.
You do this:
cd ../ ... cp -a %{name}-%{commit} %{name}-%{commit}-py2
And ../%{name}-%{commit}-py2 is not included.
If you really need to do this, create those as subfolders:
%autosetup -c -n %{name}-%{commit} cp -a %{name}-%{commit} %{name}-%{commit}-py2 ..
Note the -c and the lack of cd ../.
On 19.10.2018 00:28, Ankur Sinha wrote:
I'm still at a loss to why this is so. Would someone be able to shed some light on this please?
That’s https://github.com/rpm-software-management/rpm/issues/551
for bad old historical reasons the main directory rpmbuild works in is a side-effect of %setup (which %autoseup calls behin the scenes), there’s no way to override or even read in it %prep, and *many* bits of rpm automation will look for stuff in this directory only.
Regards,
On Fri, Oct 19, 2018 10:16:48 +0200, Nicolas Mailhot wrote:
On 19.10.2018 00:28, Ankur Sinha wrote:
I'm still at a loss to why this is so. Would someone be able to shed some light on this please?
That’s https://github.com/rpm-software-management/rpm/issues/551
for bad old historical reasons the main directory rpmbuild works in is a side-effect of %setup (which %autoseup calls behin the scenes), there’s no way to override or even read in it %prep, and *many* bits of rpm automation will look for stuff in this directory only.
That's quite an informative ticket. Thanks for the link!
The method Miro suggested works well enough, so I'll just use that convention for the time being.
On Fri, Oct 19, 2018 00:52:51 +0200, Miro Hrončok wrote:
<snip>
The debugsourcefiles.list is constructed from files in the current folder the build is in. In your case, that's the %{name}-%{commit} folder from %autosetup.
Anything you create outside that folder is not included.
Ah, right---I suspected it was something of this sort but wasn't able to find any docs to confirm.
You do this:
cd ../ ... cp -a %{name}-%{commit} %{name}-%{commit}-py2
And ../%{name}-%{commit}-py2 is not included.
If you really need to do this, create those as subfolders:
%autosetup -c -n %{name}-%{commit} cp -a %{name}-%{commit} %{name}-%{commit}-py2 ..
Note the -c and the lack of cd ../.
That is *much* cleaner. I'll use this and see how it goes. Thanks.