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

Jonas Smedegaard dr at jones.dk
Sat Nov 4 18:51:26 UTC 2017


Quoting Josh Triplett (2017-11-04 19:00:33)
> 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.

Thanks for acknowledging.

For the record, the "some packaging helpers" includes dpkg-source.


>> 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.

For a Debian source package solely using dh-cargo with no overrides, 
that may be true.

I learned that by inspecting the resulting package.

Might make sense to document that, since it is not obvious for someone 
familiar with debhelper but not with these delicate needs of crates.


> 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.

I recommend clarifying in long description and README that dh-cargo need 
a clean root directory late during build, since that is uncommon among 
debhelper tools.


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private



More information about the Pkg-rust-maintainers mailing list