Copr: error: Empty %files file debugsourcefiles.list

Hi,

I am trying to package, in Copr, the Rust crate lazy_format because it is a dependency of a program that I am trying to package: mirafetch.

Using the repo GitHub - osalbahr/mirafetch (which contains the spec file, generated using rust2rpm –-path .), the build failed, with the following error:

Provides: rust-lazy_format = 2.0.3-1.fc42 rust-lazy_format(x86-64) = 2.0.3-1.fc42
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Processing files: rust-lazy_format-debugsource-2.0.3-1.fc42.x86_64
error: Empty %files file /builddir/build/BUILD/rust-lazy_format-2.0.3-build/lazy_format-2.0.3/debugsourcefiles.list

RPM build errors:
    Empty %files file /builddir/build/BUILD/rust-lazy_format-2.0.3-build/lazy_format-2.0.3/debugsourcefiles.list
Finish: rpmbuild rust-lazy_format-2.0.3-1.fc42.src.rpm
Finish: build phase for rust-lazy_format-2.0.3-1.fc42.src.rpm
INFO: chroot_scan: 1 files copied to /var/lib/copr-rpmbuild/results/chroot_scan
INFO: /var/lib/mock/fedora-42-x86_64-1759414895.621611/root/var/log/dnf5.log
INFO: chroot_scan: creating tarball /var/lib/copr-rpmbuild/results/chroot_scan.tar.gz
/bin/tar: Removing leading `/' from member names
ERROR: Exception(/var/lib/copr-rpmbuild/results/rust-lazy_format-2.0.3-1.fc42.src.rpm) Config(fedora-42-x86_64) 0 minutes 11 seconds
INFO: Results and/or logs in: /var/lib/copr-rpmbuild/results
INFO: Cleaning up build root ('cleanup_on_failure=True')
Start: clean chroot
INFO: unmounting tmpfs.
Finish: clean chroot
ERROR: Command failed: 
 # /usr/bin/systemd-nspawn -q -M 178d9f67fb4c4fd98c9a4e8e5adcebc2 -D /var/lib/mock/fedora-42-x86_64-1759414895.621611/root -a -u mockbuild --capability=cap_ipc_lock --rlimit=RLIMIT_NOFILE=10240 --capability=cap_ipc_lock --bind=/tmp/mock-resolv.91ubxutx:/etc/resolv.conf --bind=/dev/btrfs-control --bind=/dev/mapper/control --bind=/dev/fuse --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin '--setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007"' '--setenv=PS1=<mock-chroot> \s-\v\$ ' --setenv=LANG=C.UTF-8 --resolv-conf=off bash --login -c '/usr/bin/rpmbuild -ba --noprep  --target x86_64 /builddir/build/originals/rust-lazy_format.spec'

Copr build error: Build failed

How can I fix this?

Full log: https://download.copr.fedorainfracloud.org/results/osalbahr/mirafetch/fedora-42-x86_64/09639769-rust-lazy_format/builder-live.log.gz

I am not sure if it is the correct solution but I’ve seen a lot of rust packages that put this at the very top of the specfile

%global debug_package %{nil}

I think it should fix your issue.

This should already be present if the spec file was generated by rust2rpm, it is only omitted if the package would be wrong without it. :slight_smile:

It looks like the package in question is a library-only crate, in which case yes, this line should be present.

But the spec file used for the package builds looks very strange, basically it’s upside down from what it should be.

So, are you sure you ran rust2rpm -s lazy_format and didn’t try to do something else? It looks like you manually downloaded the sources from GitHub, uncompressed then, and pointed rust2rpm at the uncompressed sources.

What I did was clone the repo and run rust2rpm --path . so that I use the source from GitHub, which typically includes . I don’t know whether in Fedora using crates.io is preferred, but in Arch Linux it’s not.

When packaging library crates for Fedora, using sources from crates.io is actually a hard “MUST” requirement, see Rust Packaging Guidelines.