pkolaczk / fclones

Efficient Duplicate File Finder
MIT License
1.99k stars 79 forks source link

Package as RPM for Fedora #216

Closed maximiliankolb closed 1 year ago

maximiliankolb commented 1 year ago

Hi all,

I have tried to package fclones for Fedora but ran into some issues. I am unfamiliar with rust/cargo and hope someone can share some insights.

What I did so far

# on my local machine running Fedora 38
$ podman run --rm -it -v $(pwd):/data:Z fedora:38

# within the container
$ dnf install -y vim rust2rpm rpmdevtools rpmlint

# creates three files: "fclones-fix-metadata-auto.diff", "rust-fclones.spec", and "rust-fclones.spec"
$ rust2rpm -s fclones

# build ".src.rpm" package (works)
$ rpmbuild -bs rust-fclones.spec

# build ".rpm" package (fails)
$ rpmbuild -bb ~/rpmbuild/SPECS/rust-fclones.spec

Build issues due to missing build dependencies

$ rpmbuild -bb ~/rpmbuild/SPECS/rust-fclones.spec
setting SOURCE_DATE_EPOCH=1687564800
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.yNz8kR
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf fclones-0.32.1
+ /usr/lib/rpm/rpmuncompress -x /root/rpmbuild/SOURCES/fclones-0.32.1.crate
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd fclones-0.32.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/lib/rpm/rpmuncompress /root/rpmbuild/SOURCES/fclones-fix-metadata-auto.diff
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ set -eu
+ /usr/bin/mkdir -p .cargo
+ cat
+ /usr/bin/rm -f Cargo.lock
+ /usr/bin/rm -f Cargo.toml.orig
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.yfTEyJ
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd fclones-0.32.1
+ /usr/bin/cargo2rpm --path Cargo.toml buildrequires --with-check
+ RPM_EC=0
++ jobs -p
+ exit 0
error: Failed build dependencies:
    (crate(atomic-counter/default) >= 1.0.0 with crate(atomic-counter/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(bincode/default) >= 1.3.0 with crate(bincode/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(blake3/default) >= 1.3.0 with crate(blake3/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(byte-unit/default) >= 4.0.0 with crate(byte-unit/default) < 5.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(byteorder/default) >= 1.4.0 with crate(byteorder/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(bytesize/default) >= 1.1.0 with crate(bytesize/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(chrono) >= 0.4.0 with crate(chrono) < 0.5.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(chrono/clock) >= 0.4.0 with crate(chrono/clock) < 0.5.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(chrono/serde) >= 0.4.0 with crate(chrono/serde) < 0.5.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(chrono/std) >= 0.4.0 with crate(chrono/std) < 0.5.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(clap/cargo) >= 4.0.0 with crate(clap/cargo) < 5.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(clap/default) >= 4.0.0 with crate(clap/default) < 5.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(clap/derive) >= 4.0.0 with crate(clap/derive) < 5.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(clap/wrap_help) >= 4.0.0 with crate(clap/wrap_help) < 5.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(console/default) >= 0.15.0 with crate(console/default) < 0.16.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(crossbeam-utils/default) >= 0.8.0 with crate(crossbeam-utils/default) < 0.9.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(csv/default) >= 1.1.0 with crate(csv/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(dashmap/default) >= 5.2.0 with crate(dashmap/default) < 6.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(dirs/default) >= 5.0.1 with crate(dirs/default) < 6.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(dtparse/default) >= 1.2.0 with crate(dtparse/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(dunce/default) >= 1.0.0 with crate(dunce/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(fallible-iterator/default) >= 0.3.0 with crate(fallible-iterator/default) < 0.4.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(fiemap/default) >= 0.1.0 with crate(fiemap/default) < 0.2.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(file-owner/default) >= 0.1.0 with crate(file-owner/default) < 0.2.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(filetime/default) >= 0.2.0 with crate(filetime/default) < 0.3.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(hex/default) >= 0.4.0 with crate(hex/default) < 0.5.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(ignore/default) >= 0.4.18 with crate(ignore/default) < 0.5.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(indexmap/default) >= 1.8.0 with crate(indexmap/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(indicatif/default) >= 0.17.0 with crate(indicatif/default) < 0.18.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(itertools/default) >= 0.10.0 with crate(itertools/default) < 0.11.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(lazy-init/default) >= 0.5.0 with crate(lazy-init/default) < 0.6.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(lazy_static/default) >= 1.4.0 with crate(lazy_static/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(libc/default) >= 0.2.0 with crate(libc/default) < 0.3.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(maplit/default) >= 1.0.0 with crate(maplit/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(metrohash/default) >= 1.0.0 with crate(metrohash/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(nix/default) >= 0.26.0 with crate(nix/default) < 0.27.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(nom-regex/default) >= 0.2.0 with crate(nom-regex/default) < 0.3.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(nom/default) >= 7.0.0 with crate(nom/default) < 8.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(num_cpus/default) >= 1.13.0 with crate(num_cpus/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(priority-queue/default) >= 1.2.0 with crate(priority-queue/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(rayon/default) >= 1.5.0 with crate(rayon/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(reflink/default) >= 0.1.0 with crate(reflink/default) < 0.2.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(regex/default) >= 1.5.0 with crate(regex/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(serde/default) >= 1.0.0 with crate(serde/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(serde/derive) >= 1.0.0 with crate(serde/derive) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(serde_json/default) >= 1.0.0 with crate(serde_json/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(serde_test/default) >= 1.0.0 with crate(serde_test/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(sha2/default) >= 0.10.0 with crate(sha2/default) < 0.11.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(sha3/default) >= 0.10.0 with crate(sha3/default) < 0.11.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(sled/default) >= 0.34.0 with crate(sled/default) < 0.35.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(smallvec/default) >= 1.8.0 with crate(smallvec/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(stfu8/default) >= 0.2.0 with crate(stfu8/default) < 0.3.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(sysinfo/default) >= 0.29.0 with crate(sysinfo/default) < 0.30.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(tempfile/default) >= 3.0.0 with crate(tempfile/default) < 4.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(thread_local/default) >= 1.1.0 with crate(thread_local/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(typed-sled/default) >= 0.2.0 with crate(typed-sled/default) < 0.3.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(uuid/default) >= 1.1.0 with crate(uuid/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(uuid/v4) >= 1.1.0 with crate(uuid/v4) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(xattr/default) >= 1.0.0 with crate(xattr/default) < 2.0.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(xxhash-rust/default) >= 0.8.0 with crate(xxhash-rust/default) < 0.9.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
    (crate(xxhash-rust/xxh3) >= 0.8.0 with crate(xxhash-rust/xxh3) < 0.9.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64
Wrote: /root/rpmbuild/SRPMS/rust-fclones-0.32.1-1.fc38.buildreqs.nosrc.rpm

Steps to resolve dependency issues

# output from "rpmbuild"
(crate(hex/default) >= 0.4.0 with crate(hex/default) < 0.5.0~) is needed by rust-fclones-0.32.1-1.fc38.x86_64

# available RPM package on Fedora 38
$ dnf search rust-hex
...
rust-hex+default-devel
...

My question: I currently cannot build the RPM package due to 63 missing build dependencies. Is there any way to not find, define, and install them by hand? Am I missing an obvious solution to come from Cargo.toml to "installable packages on Fedora"?

Thanks.