Bug 2266320

Summary: Review Request: rust-k8s-openapi - Bindings for the Kubernetes client API
Product: [Fedora] Fedora Reporter: Alberto Faria <afaria>
Component: Package ReviewAssignee: Fabio Valentini <decathorpe>
Status: ASSIGNED --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: code, decathorpe, package-review
Target Milestone: ---Flags: decathorpe: fedora-review?
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://crates.io/crates/k8s-openapi
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2266336    

Comment 1 Fedora Review Service 2024-02-27 15:27:15 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/7065195
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2266320-rust-k8s-openapi/fedora-rawhide-x86_64/07065195-rust-k8s-openapi/fedora-review/review.txt

Please take a look if any issues were found.


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 2 Fabio Valentini 2024-02-29 15:34:22 UTC
Oof, this package contains so much duplicated identical files ... it's 35 MB of source code, of which ~23 MB are duplicate files. 😧

It looks like most of these are generated. Do you think it would be possible to de-duplicate at least some of these files? Otherwise the package is going to be gigantic compared to "regular" Rust packages.

Comment 3 Ben Beasley 2024-05-11 13:14:23 UTC
The COPR URLs are now expired and give a 404 error.

Comment 4 Ben Beasley 2024-05-11 13:31:57 UTC
(In reply to Fabio Valentini from comment #2)
> Oof, this package contains so much duplicated identical files ... it's 35 MB
> of source code, of which ~23 MB are duplicate files. 😧
> 
> It looks like most of these are generated. Do you think it would be possible
> to de-duplicate at least some of these files? Otherwise the package is going
> to be gigantic compared to "regular" Rust packages.

May I recommend something like the following rust2rpm.toml snippet?

[requires]
build = [
    "hardlink",
]

[scripts.install]
post = [
    "# Hardlink duplicate files to greatly reduce the size of the -devel RPM",
    "hardlink -t %{buildroot}%{crate_instdir}",
]


Note that I didn’t review the result, only verified that it built and the hardlinking had the intended effect. The rust-k8s-openapi-devel-0.22.0-1.fc41.noarch.rpm is around 1 MiB compressed in both cases because the compression algorithm is able to exploit the redundancy in the duplicate files quite effectively, but with hardlinking the extracted size goes from about 50 MB to about 4 MB, which seems worthwhile.

Comment 5 Fabio Valentini 2024-05-13 14:56:08 UTC
Alternatively, you could use the "%fdupes" macro from the fdupes package:
https://src.fedoraproject.org/rpms/fdupes/blob/rawhide/f/macros.fdupes

IIUC by default, it creates hardlinks for duplicate files.