Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit custom values based on other AddEntries #365

Open
jRimbault opened this issue Aug 20, 2024 · 1 comment
Open

Emit custom values based on other AddEntries #365

jRimbault opened this issue Aug 20, 2024 · 1 comment

Comments

@jRimbault
Copy link

Hi, it's fairly easy to write a new independent provider by implementing AddCustomEntries, but I'd like to be able to take values emitted by other builders such that I could take those values and manipulate them in the build script and then emit my own custom environment variables.

The use case I have in mind is building a version string at build time rather that concatenating them at runtime in my crate.

@zesterer
Copy link

zesterer commented Sep 1, 2024

Agreed, it seems a little weird that there doesn't seem to be an API to ask vergen what, say, the commit hash is in the build script without scraping stdout after the fact.

Edit: Ah, it seems like .emit_and_set at the very least writes to the immediate environment, allowing it to be re-queried from within the build script.

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

No branches or pull requests

2 participants