[Pkg-rust-maintainers] Bug#1017681: dh-cargo and debcargo cannot effectively build a cdylib crate

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Aug 18 23:58:42 BST 2022


Package: dh-cargo
Version: 28
Control: affects -1 + src:rust-sequoia-octopus-librnp
Control: clone -1 -2
Control: reassign -2 debcargo 2.5.0-3+b4

I'm trying to build a version of the Sequoia project's "octopus", which
creates a shared object (dynamic library) that can replace librnp.so.0
for all the ways that thunderbird uses it.

The library is implmented in Rust, as a crate named
sequoia-octopus-librnp, and it can be found at
https://gitlab.com/sequoia-pgp/sequoia-octopus-librnp/

Note that the crate has no "bin" section, but its library is of type
"cdylib", which means that (at least on GNU systems) it builds a .so
that can be used by the C dynamic linker.

A few things to note:

 - when building this should effectively run "cargo build --release",
   but the dh-cargo dh buildsystem doesn't do so during the auto_build
   phase of dh

 - i believe the produced shared object will end up in
   target/release/libsequoia_octopus_librnp.so, so it needs to be
   retrieved from there and shipped in /usr/lib/$(DEB_HOST_MULTIARCH)/

 - when debcargo generates the build-deps, it needs to mark the
   dependencies *without* <!nocheck>, since they are needed to actually
   run the build

I'll try to do this manually with this crate for now, and store it in
the debcargo-conf repository with a lot of .debcargo.hint files, but
it'd be great to avoid these kinds of hacks by having debcargo and
dh-cargo do the right thing in the future.

        --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-rust-maintainers/attachments/20220818/df32fd08/attachment.sig>


More information about the Pkg-rust-maintainers mailing list