-
Notifications
You must be signed in to change notification settings - Fork 10
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
nightly: use exact branch name in $BUILDVERSION_EXEC #175
base: master
Are you sure you want to change the base?
Conversation
caf8d35
to
39e3cde
Compare
I ran into seemingly odd behavior where I was on the Perhaps there's some simpler way to do this, but if so, I'm not sure what it is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this before but didn't look too closely, so thanks for investigating.
I had a quick look and couldn't find a better way to do this, which was a bit of a surprise given its clunkiness.
tools/helios-build/src/main.rs
Outdated
env += "export BUILDVERSION_EXEC=\"git describe --all --long --dirty\"\n"; | ||
env += "export BUILDVERSION_EXEC=\ | ||
\"git describe --all --long --dirty \ | ||
--match $(git branch --show-current) --exact-match 2>/dev/null || \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this being evaluated at the time the .env file is sourced, or when BUILDVERSION_EXEC
is used? It should be the latter but this looks like the former, which is a problem if you switch branches while in a bldenv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL; it was actually borked (but it takes a while in a build to get the point where one notices). It's evaluated when BUILDVERSION_EXEC
is used, but that caused syntax errors, so I've changed it to creating a function that does the branch ... stuff ... and then BUILDVERSION_EXEC
invokes that function.
Ugh. Yeah, this feels way uglier than it needs to be.
3e24cc6
to
5d6c71c
Compare
5d6c71c
to
f566ef9
Compare
I think given how complex this is, that I'd like to get it done in Rust. We should have a new (hidden) subcommand for helios-build that produces the correct value and then use that in the generated environment file. |
I agree. This is also hopelessly broken; the issue is that the way that |
No description provided.