-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Environment values should not be VERGEN_IDEMPOTENT_OUTPUT
on failure
#299
Comments
This behavior is intentional. As a build tool, I don't want |
I understand that it is intentional to fill in some value rather than fail by default, but this issue is to report that it should be a different value that indicates that the value is filled in because of an error, not because the value is not idempotent. It doesn't make sense for |
I also find the behavior not helpful. We use VERGEN_GIT_SHA to compute a version string. If we build from a tarball, with .git being absent, we get a string like In previous versions of vergen, the environment variable was simply absent. I think I'll try to go back to this behavior by opting in to the errors, and ignoring them. |
I think that leaving env variable unset and only showing a warning may be better. In my case, if there's no git tree, all I could do is to panic during building or got a meaningless Currently, my solution is separating
And got version str by
|
Here is some additional background on this "feature". There was an issue with packages built from tarballs where the user didn't have control over the source code (in this particular case a Linux package maintainer) and the git variables were causing failures because they weren't building from a repository. In parallel, there was a request to be able to force idempotent (or as close as possible with Rust) builds that didn't include non-idempotent items such as timestamps every time the code was built. This solution covered both bases. I can see how this fix of two issues with one type of output is causing some confusion in the regular use case of the tool. I'll probably tweak the "don't fail unless I've requested it" output to be different from the force idempotent output. |
I am using the following configuration:
Due to an error on my end, there was no
.git
folder in my build environment which means the git env vars could not be populated correctly. However, the value of each git environment value wasVERGEN_IDEMPOTENT_OUTPUT
which is very unexpected and cost me a lot of time troubleshooting in the wrong direction. Ideally, these should be filled with another value to indicate the error.I understand that the
.quiet()
call and lack of.fail_on_error()
make this error harder to spot, but I still think the current behavior is very weird.The text was updated successfully, but these errors were encountered: