It looks like the "examples" folder is automatically detected as %doc content now. This folder is already included verbatim with the crate's sources, and including it as %doc just results in the same files getting installed twice with the same package. Additionally, since users are never expected to actually install any rust-foo-devel packages on their systems, including examples in the *-devel packages is useless.
rust-foo-devel
*-devel
If we want to do something like that, we should rather work on including rust-foo-doc packages that do not ship source code but rustdoc documentation and examples.
rust-foo-doc
CC @eclipseo
It will probably cause issues if the manifest has an explicit [[example]] section and those files are missing. By default examples are dynamically discovered, but they can also be specified: https://doc.rust-lang.org/cargo/reference/cargo-targets.html#examples
[[example]]
@jistone that's not what I mean. This issue is about additionally including the "examples" directory with %doc examples, which causes them to be installed twice - once to the crate's source directory /usr/share/cargo/whatever/%{crate}/examples, and once to /usr/share/doc/%{name}/examples- this is redundant and useless, since users never install those packages.
%doc examples
/usr/share/cargo/whatever/%{crate}/examples
/usr/share/doc/%{name}/examples
Additionally, since users are never expected to actually install any rust-foo-devel packages on their systems, including examples in the *-devel packages is useless.
I was more responding to this, if you're suggesting that examples might someday only go in %doc or *-doc subpackages instead of *-devel.
%doc
*-doc
Oh, no that was not my intention. Sorry about that. Sometimes English is hard for me, especially when I'm tired.
Examples should obviously be kept in the crate sources to keep compilation of crates working. But copying them over to %_docdir is superfluous (as is copying over any *.md files, for that matter - they also get copied verbatim to /usr/share/cargo/registry/%{crate}/ .... )
%_docdir
Commit b284d61 fixes this issue
Login to comment on this ticket.