#1017682 dh-cargo and debcargo cannot effectively build a cdylib crate

Package:
debcargo
Source:
debcargo
Description:
Create a Debian package from a Cargo crate
Submitter:
Daniel Kahn Gillmor
Date:
2024-06-09 09:33:02 UTC
Severity:
normal
#1017682#5
Date:
2022-08-18 22:58:42 UTC
From:
To:
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.