Re: Copr package build fails on python-nocaselist package

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, 18 September 2020 12:24:21 CEST Andreas R Maier wrote:
> Thanks for the quick help and for the mini-review.
> 
> I have updated the spec file as recommended, except for the %py_provides
> macro because COPR did not like that when running the rpkg command:
> 
> Running: rpkg srpm --outdir /tmp/copr-rpmbuild-vtejek5l --spec
> /tmp/copr-rpmbuild-vtejek5l/obtain-sources/nocaselist/packaging/fedora/pyth
> on-nocaselist.spec
> 
> cmd: ['rpkg', 'srpm', '--outdir', '/tmp/copr-rpmbuild-vtejek5l', '--spec',
> '/tmp/copr-rpmbuild-vtejek5l/obtain-sources/nocaselist/packaging/fedora/pyt
> hon-nocaselist.spec'] cwd:
> /tmp/copr-rpmbuild-vtejek5l/obtain-sources/nocaselist
> rc: 0
> stdout: Wrote: /tmp/copr-rpmbuild-vtejek5l/python-nocaselist.spec
> stderr: error: line 34: Unknown tag: %py_provides python3-nocaselist
> can't parse specfile
> 
> With the changed spec file (without %py_provides), the situation is still
> that Koji succeeds and COPR fails with the same error as before:
> Koji: https://koji.fedoraproject.org/koji/taskinfo?taskID=51724144
> <https://koji.fedoraproject.org/koji/taskinfo?taskID=51724144> COPR:
> https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build/1
> 673307/
> <https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build/
> 1673307/>
> 
> I understand what you said about the difference in the archives in the SRPM
> files, but I'm afraid I don't quite understand how I can influence how COPR
> obtains the archive. In fact, even after looking at the log files I don't
> understand where it gets the archive from.
> 
> In COPR, I am defining the package to be built from SCM, with rpkg for
> building the SRPM:
> https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/package
> /python-nocaselist/
> <https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/packag
> e/python-nocaselist/> Is that the way to do it?
> 
> Also, as far as I'm concerned we do not necessarily need to get the COPR
> build to succeed, as long as I can get the package review started by
> pointing to a Koji build. Please let me know.
> 
> Andy
> 
> > Begin forwarded message:
> > 
> > From: Robert-André Mauchin <zebob.m@xxxxxxxxx>
> > Subject: Re: Copr package build fails on python-nocaselist package
> > Date: 18. September 2020 at 11:34:31 CEST
> > To: Development discussions related to Fedora
> > <devel@xxxxxxxxxxxxxxxxxxxxxxx> Reply-To: Development discussions related
> > to Fedora <devel@xxxxxxxxxxxxxxxxxxxxxxx>> 
> > On Friday, 18 September 2020 09:19:48 CEST Andreas R Maier wrote:
> >> Hi,
> >> I am new to building packages, and I'm trying to build a new package
> >> 'python-nocaselist' on Copr, and it fails in the %prep stage when
> >> unpacking
> >> the SRPM file because it cannot cd into the directory it assumes got
> >> unpacked: Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6rjfBt
> >> + umask 022
> >> + cd /builddir/build/BUILD
> >> + cd /builddir/build/BUILD
> >> + rm -rf nocaselist-1.0.2
> >> + /usr/bin/gzip -dc /builddir/build/SOURCES/nocaselist-1.0.2.tar.gz
> >> + /usr/bin/tar -xof -
> >> + STATUS=0
> >> + '[' 0 -ne 0 ']'
> >> + cd nocaselist-1.0.2
> >> /var/tmp/rpm-tmp.6rjfBt: line 39: cd: nocaselist-1.0.2: No such file or
> >> directory I have configured copr to point to the Git repo and spec file.
> >> 
> >> The same spec file builds fine on Koji.
> >> 
> >> Spec file:
> >> https://github.com/pywbem/nocaselist/blob/andy/fedora-packaging/packaging
> >> /f
> >> edora/python-nocaselist.spec
> >> <https://github.com/pywbem/nocaselist/blob/andy/fedora-packaging/packagin
> >> g/
> >> <https://github.com/pywbem/nocaselist/blob/andy/fedora-packaging/packagi
> >> ng/> fedora/python-nocaselist.spec> Failing Copr build:
> >> https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build
> >> /1
> >> <https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/bui
> >> ld/1> 672638/
> >> <https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/buil
> >> d/
> >> <https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/bui
> >> ld/> 1672638/> Successful Koji build:
> >> https://koji.fedoraproject.org/koji/taskinfo?taskID=51713400
> >> <https://koji.fedoraproject.org/koji/taskinfo?taskID=51713400>
> >> <https://koji.fedoraproject.org/koji/taskinfo?taskID=51713400
> >> <https://koji.fedoraproject.org/koji/taskinfo?taskID=51713400>>
> >> 
> >> What am I doing wrong here?
> >> 
> >> Thanks for any help
> >> Andy
> > 
> > The archives in your SRPM are different:
> > - on COPR the root directory of your archive is
> > python-%{srcname}-%{version} 
> > - on Koji the root directory of your archive
> > is %{srcname}-%{version}
> > 
> > To download the true original archive from Pypi, use "spectool -g *.spec"
> > in the directory that contains your SPEC file.
> > Then open the archive and see that the root of the archive is named %
> > {srcname}-%{version} , like on Koji.
> > To regenerate the SRPM, use: fedpkg --release f34 srpm in the directory
> > that contains your SPEC file.
> > 
> > Mini review:
> > 
> > - %{?python_enable_dependency_generator} not needed anymore, it's the
> > default.
> > 
> > - %{python3} setup.py build → %py3_build
> > 
> > - Not needed: rm -rf %{buildroot}
> > 
> > - env PYTHONPATH=%{buildroot}/%{python3_sitelib} \
> > 
> >    %{python3} setup.py install -O1 --skip-build --root %{buildroot}
> >   
> >   → %py3_install
> > 
> > - The Python provide macro is not mandatory anymore on Rawhide and F33,
> > but
> > below F33, you should add: %py_provides python3-%{srcname} to the
> > python3-%
> > {srcname} subpackage.
> > 
> > _______________________________________________
> > devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
> > <mailto:devel@xxxxxxxxxxxxxxxxxxxxxxx> To unsubscribe send an email to
> > devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> > <mailto:devel-leave@xxxxxxxxxxxxxxxxxxxxxxx> Fedora Code of Conduct:
> > https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> > <https://docs.fedoraproject.org/en-US/project/code-of-conduct/> List
> > Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> > <https://fedoraproject.org/wiki/Mailing_list_guidelines> List Archives:
> > https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.o
> > rg
> > <https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.
> > org>

The archives in your SRPM are different:
 - on COPR the root directory of your archive is python-%{srcname}-%{version} 
 - on Koji the root directory of your archive is %{srcname}-%{version}

Check that you have deleted python-%{srcname}-%{version}.tar.gz before 
regenerating the SRPM.

Also I never use rpmbuild anymore, I do everything in the same directory with 
fedpkg:

## Building the Fedora package

### Build the source RPM locally:

    rm *.tar.gz *src.rpm
    spectool -g *.spec && fedpkg --release f34 srpm

### Build the binary RPM locally in a mock chroot:

    fedpkg --release f34  mockbuild --mock-config fedora-rawhide-x86_64 -N

Build logs and RPMs (if any) are in the results subdirectory

### Build the binary RPM with the Koji build system:

    fedpkg  --release f34 scratch-build --srpm --fail-fast

### COPR:

    copr-cli build python-nocaselist *.src.rpm



No idea where python-%{srcname}-%{version} in the .tar.gz is coming from, 
neither pypi or github have that archive. Maybe it's an artifact of building 
the SRPM with rpkg?

_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux