[Pkg-rust-maintainers] Bug#907629: librsvg: Embedded code copies: assorted Rust libraries
Ximin Luo
infinity0 at debian.org
Tue Oct 16 16:15:00 BST 2018
Simon McVittie:
> On Tue, 16 Oct 2018 at 02:45:00 +0000, Ximin Luo wrote:
>> Hi, you are welcome to package the below dependencies as part of the Rust team
>
> Sorry, I don't know Rust, so having me try to maintain anything exclusively
> written in Rust would be a very bad idea :-)
>
Knowing Rust is not required to package Rust Debian packages, just understanding of how dependencies work and our tooling, all of which comes with a lot of documentation on exactly what to do. :)
>> It should be possible to use dh-cargo in librsvg's build, you might have to call it using something like:
>>
>> override_dh_auto_install:
>> # other stuff
>> dh_auto_install -S cargo -D <path/to/crate/src>
>
> librsvg runs `cargo build` during its own build: running `make` compiles
> C code, then calls `cargo build` to compile Rust code that depends on the
> C, then compiles some more C code that depends on the Rust. I don't think
> we can avoid that.
>
> It might be possible to patch Makefile.am to use dh_auto_build or
> dh_auto_install instead of `cargo build`, but that's "inside out" compared
> with a normal Debian package build, so I'd be far from confident about
> making that change myself.
>
I'd strongly recommend trying it at least, we add a bunch of flags in dh-cargo to do various nice things like honour Debian's LDFLAGS, pass in reproducible-builds flags, support cross-compilation, add debuginfo, support parallel building, avoid needing dev-dependencies, etc etc.
https://salsa.debian.org/rust-team/dh-cargo/blob/master/cargo.pm#L145
Actually I realise that one also needs to call `dh_auto_configure -S cargo` which will create the relevant cargo.toml in debian/cargo_home.
To build, the invocation is something like `cargo --verbose --verbose --target $(DEB_HOST_RUST_TYPE) -j$(parallel) -Zavoid-dev-deps` but dh_auto_test will do this for you.
X
--
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git
More information about the Pkg-rust-maintainers
mailing list