[Pkg-rust-maintainers] configure_me man page generation

Martin Habovštiak martin.habovstiak at gmail.com
Fri Oct 18 07:24:09 BST 2019


Hello,

I'm the author of configure_me (https://github.com/Kixunil/configure_me ),
a crate that helps with loading application configuration from config
files, env vars and arguments.

The crate is capable of generating man pages from the specification. I
would love to integrate it into Debian ecosystem! I'm now seeking for
advice on how to do it the best possible way.

Previously the man page was generated by the build script, but after some
discussion with Rust devs and my own thinking, I decided to redesign it and
provide a separate tool for generating the man page and other files (I plan
to do shell completions at some point and I also started experimenting with
debconf). The tool is nearly finished and I plan to release it soon
(hopefully today).

The ideal end result would be if the manpage was generated for all
dependent packages without any other interaction. I don't think it'd be
good to tie it to configure_me, but allow other crates to define their
integrations too. So my idea is this:

Whenever Cargo.toml contains:
[package.metadata.debcargo.postbuild-dep]
crate = foo
run = { "bar" = ["--arg"] }

(Alternatively, this could be in debcargo.toml, I'm not sure which is
better.)

All it's dependencies will get Build-Depends: foo

The rule to run bar with argument --arg after build is added to rules.

There's a special exception: if it would cause the dependency to depend on
itself (if foo itself depends on the crate which specified postbuild-dep on
foo) debcargo will require the maintainer to resolve the situation manually.

The exception resolves the problem that the man page generator itself uses
configure_me for its own configuration. This shouldn't be a huge issue as
for every tool it will happen at most once. In my case, I would just
include the generated man page in the overlay.

Note that running built binary from the package would break cross
compilation. If specifying something like Build-Depends: foo:build-arch
![build-arch] was possible, it could be completely automated, but my
understanding is that nothing like that is possible.

I hope it all makes sense to you, please let me know what do you think.

Have a nice day!

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-rust-maintainers/attachments/20191018/9850d3e7/attachment.html>


More information about the Pkg-rust-maintainers mailing list