rustyhorde / vergen

Generate cargo instructions at compile time in build scripts for use with the env! or option_env! macros
Apache License 2.0
384 stars 57 forks source link

Goal of vergen is unclear from the readme. #350

Closed gl-yziquel closed 2 months ago

gl-yziquel commented 3 months ago

Hi.

I've been trying to build redox from source, and it failed when trying to compile cosmic-files, which uses vergen.

https://github.com/pop-os/cosmic-files/issues/250

I ended up here trying to debug that build. Unfortunately, the readme file is not written with someone like me in mind, who tries to get into a build system from the outside. It is pretty unclear what vergen does, and the readme file does seem to assume a pretty big deal of implicit knowledge when it comes to the way vergen is to be used and the use case it is trying to solve.

Please add one or two paragraphs in the readme clarifying the rôle of this crate.

CraZySacX commented 2 months ago

That's a good point. Just so it's documented here (I will also update the README), vergen and the associated other tools allow you to embed environment variables determined at build time into your code with the env! or option_env! macros. The vast majority of my use is to include git related data into the projects I build.

CraZySacX commented 2 months ago

Additionally, you may be interested about the mechanics. This is found in the Build Scripts section of the cargo documentation.

gl-yziquel commented 2 months ago

@CraZySacX thank you for taking that remark constructively.