[Pkg-rust-maintainers] Bug#953907: dh-cargo: installs various non-rust files to /usr/share/cargo
Blair Noctis
ncts at debian.org
Wed Mar 26 12:26:11 GMT 2025
On Sat, 14 Mar 2020 10:54:02 -0700 Sean Whitton <spwhitton at spwhitton.name> wrote:
> Package: dh-cargo
> Version: 23
>
> Hello,
>
> During review of rust packages in NEW, I noticed that many of them
> install many files to /usr/share/cargo which should probably not be
> installed to the binary package at all, and certainly not to
> /usr/share/cargo:
>
> -rw-r--r-- root/root 31 2019-07-08 23:10 ./usr/share/cargo/registry/maybe-uninit-2.0.0/.gitignore
> -rw-r--r-- root/root 180 2019-07-10 13:07 ./usr/share/cargo/registry/maybe-uninit-2.0.0/.travis.yml
> -rw-r--r-- root/root 10847 2019-07-08 23:11 ./usr/share/cargo/registry/maybe-uninit-2.0.0/LICENSE-APACHE
> -rw-r--r-- root/root 1071 2019-07-08 23:11 ./usr/share/cargo/registry/maybe-uninit-2.0.0/LICENSE-MIT
> -rw-r--r-- root/root 996 2019-07-10 13:13 ./usr/share/cargo/registry/maybe-uninit-2.0.0/README.md
>
> I don't know where this needs to be fixed, but maybe in dh-cargo, so
> filing a bug here. Thanks!
This one's over five years,
and you have probably already known the reason,
but I'll try to provide a reason to close this bug.
Due to the static linking nature of Rust,
(dynamic linking exists, in the form of "dylib" and "cdylib", but is rare)
Rust libraries are currently just copies of source files,
to be used by compilation of dependent packages.
That explains those "non-Rust" files:
they are part of the upstream source.
(distributed on crates.io, specifically)
They are in a way not installed to /usr/share/cargo,
as files belonging to the cargo package,
but to /usr/share/cargo/registry,
which is a de facto [cargo source] for those Debian packaged libraries.
I don't know if there is a better place.
It's not like Rust sources are allowed in /usr/lib or /usr/include.
[cargo source]: https://doc.rust-lang.org/cargo/reference/source-replacement.html
--
Sdrager,
Blair Noctis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-rust-maintainers/attachments/20250326/bddafde9/attachment.sig>
More information about the Pkg-rust-maintainers
mailing list