[Pkg-rust-maintainers] Bug#880689: Bug#880689: dh-cargo: installs too much for libpkg

Josh Triplett josh at joshtriplett.org
Sat Nov 4 18:00:33 UTC 2017


retitle 880689 dh-cargo: Should not install top-level .pc directory (generated by Debian packaging)
tags 880689 + confirmed
thanks

On Sat, Nov 04, 2017 at 11:51:00AM +0100, Jonas Smedegaard wrote:
> Quoting Josh Triplett (2017-11-04 10:10:52)
> > On Fri, Nov 03, 2017 at 10:00:03PM +0100, Jonas Smedegaard wrote:
> >> dh-cargo installs into library packages everything in source package 
> >> except directories .git and debian.
> >>
> >> That is too much: .gitignore files or .travis.yml files make no sense 
> >> to install, and neither does .pc directory.
> >
> > Very intentional and not a bug. I discussed this with the Debian Rust 
> > team when I was first creating dh-cargo, and the intent is for the 
> > code in /usr/share/cargo/registry to *exactly* match the source as 
> > shipped in crates.io, with no omissions. The directory registry 
> > mechanism is intended for providing sources that substitute for the 
> > upstream sources.
> > 
> > (Among other things, I *have* encountered packages before that 
> > actually *used* .gitignore as part of a package build.)
> > 
> > That said, upstream crates should not be shipping .pc directories, and 
> > if that happens, we should be reporting that upstream to get fixed.
> 
> Thanks for the clarification of intent.
> 
> I challenge your conclusion that this is not a bug, however: From 
> looking at its code, it seems to me dh-cargo currently does _not_ 
> install only "the source as shipped in crates,io".
> 
> Apparently it installs everything lying around in the source package at 
> the time dh-cargo gets triggered, except root directories ".git" and 
> "debian".
> 
> The ".pc" directory, created during build by a packaging helper tool, 
> should certainly not be installed.

In general, I think anything generated by packaging helpers belongs in
debian/ rather than in the top-level source directory. But
unfortunately, I do understand that some packaging helpers create a
top-level .pc directory. Excluding that (only at the top level) seems
fine, for the same reason as excluding a top-level .git directory.

> I believe that from your own rule, stuff generated during build by 
> upstream build tools - typically but not necessarily listed in upstream 
> .gitignore - should hot be installed either.

None of those should get generated during the course of assembling the
Debian package.

If we do end up making an opt-in mechanism for library crates where we
can build and run the test suite from what's in the .crate, then we
should clean before installing the sources.



More information about the Pkg-rust-maintainers mailing list