#164 drop %doc files from -devel files entirely, only keep them in binary packages
Closed: Fixed 2 years ago by zbyszek. Opened 2 years ago by decathorpe.

  • these files are already included in those packages under %{cargo_registry}/%{crate}-%{version_no_tilde}/ / /usr/share/cargo/registry/%{crate}-%{version_no_tilde}
  • they take up additional space in those packages, since they are included twice, and also make package metadata bigger and installation in buildroots slower
  • the -devel packages are never supposed to land on users' systems, including docs with them is futile
  • lots of files marked as %doc are already completely irrelevant for downstream packages, like CODE_OF_CONDUCT.md, so only including them with binary packages is better too (where it makes more sense to have them, and people who install those applications actually get those files in that case)

these files are already included in those packages under %{cargo_registry}/%{crate}-%{version_no_tilde}/ / /usr/share/cargo/registry/%{crate}-%{version_no_tilde}

Wouldn't it make sense to mark those with %doc / %license? That way, we would properly indicate them, strip from buildroot when people use --nodocs.

You mean mark them as doc in-place, instead of copying them to %_docdir ? That would be a good solution as well.

As an example, from nix:

%files
(...)
%doc README.md CONVENTIONS.md CONTRIBUTING.md CHANGELOG.md

Proposed version:

%files
(...)
%doc %{cargo_registry}/%{crate}-%{version_no_tilde}/README.md
%doc %{cargo_registry}/%{crate}-%{version_no_tilde}/CONVENTIONS.md
%doc %{cargo_registry}/%{crate}-%{version_no_tilde}/CONTRIBUTING.md
%doc %{cargo_registry}/%{crate}-%{version_no_tilde}/CHANGELOG.md

@ignatenkobrain does that look like what you were thinking of?

This would be a good improvement over the status quo IMO.

With the proposed %crate_instdir macro, that would be even shorter.
c.f. https://pagure.io/fedora-rust/rust2rpm/issue/41

If the files are installed by the create, e.g. /usr/share/cargo/registry/nix-0.22.2/CHANGELOG.md, I think we have to assume that the package might used them for compilation. E.g. the package could load the file to provide a longer text description as part of a --help text. We might also miscategorize a file that is not a documentation file but similarly named. (Miscategorization otherwise would be harmless, because adding an extra file in /usr/share/doc hardly matters.) So I don't think we want to mark files under /usr/share/cargo/registry/<package> as %doc, because doc files are supposed to be irrelevant for operation, and here we can't be certain, and among the thousands of packages, it's likely that some strange things are done.

And I think it is worth keeping the %doc files where they are: if I install a package, it is convenient to look in /usr/share/doc.

So... is the duplication an actual problem? The %doc files are generally tiny, and the few extra lines in the rpm manifest hardly matter.

I still don't understand why we should place %doc files in an "expected" location for packages that nobody is supposed to ever install on their system?

People will occasionally install them, even for package development.

People will occasionally install them, even for package development.

But ... that's just not supported on so many levels already:

  • we don't add obsoletes for removed +feature-devel subpackages
  • we don't handle upgrade path for compat packages
  • etc.

OK. Can we just drop everything that is installed as %doc?

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #167 Merged 2 years ago