Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

configure_me cooperation #106

Open
Kixunil opened this issue Sep 22, 2019 · 3 comments
Open

configure_me cooperation #106

Kixunil opened this issue Sep 22, 2019 · 3 comments

Comments

@Kixunil
Copy link

Kixunil commented Sep 22, 2019

Your crate looks great, I look forward into trying it out! I'm going to package some services and I was thinking about integrating my crate configure_me with your crate.

First, I'd like to integrate man pages - they are already automatically generated from the configuration specification file.

Second, I was thinking about adding debconf support to configure_me, so it can automatically generate templates and postinst script (possibly another binary, though)

Thirdly I'd love to support bash completions at some point - another thing worth integrating.

I'm not sure how to do all this, but I was thinking that cargo-deb could set some environment variables e.g. MAN_OUTDIR, DEBCONF_TEMPLATE_OUT (needs append I think), and BASH_COMPLETION_OUTDIR for bash completions.

What do you think?

@kornelski
Copy link
Collaborator

kornelski commented Sep 22, 2019

Placement of generated files is an unsolved problem for Cargo: rust-lang/cargo#5457

I don't want to invent a method for finding these files without coordination with the rest of the ecosystem, so I've made a post seeking feedback about this:

https://users.rust-lang.org/t/pre-rfc-generating-assets-products-during-cargo-build/32824

@Kixunil
Copy link
Author

Kixunil commented Sep 22, 2019

That's very reasonable, thanks for writing that post! I replied there about more general stuff. I have an idea that we could already play with some solution for now and clearly document it as an unstable experiment. (Putting it behind a feature flag sounds like a good idea.) That way it'd be easier to figure out what works. Similarly to how famous try!() macro got converted to ? operator.

I'm willing to make a PR, but I'd like to know which approach seems like the best for now, so that I start straight away with that. I'm leaning to env var approach, but you seem to prefer cargo directive. If you can point me at a good documentation on reading cargo directives from cargo tools and a reason for chosing that approach, I can do it.

I know about at least two projects that might want to use this, so we already have some real-life code to test it on.

@kornelski
Copy link
Collaborator

kornelski commented Oct 4, 2019

From the user forum discussion this approach seems most promising:

https://matklad.github.io/2018/01/03/make-your-own-make.html

given that it can be made to work with plain Cargo without 3rd party tools.

So I think we could establish some convention:

  1. If there's tools/Cargo.toml try running cargo run -p tools --bin postbuild

  2. Expect output in target/assets/<crate-name>/ (workspaces share target dir between crates)

I could put that in a lightweight crate to ensure handling is consistent between tools.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants