nightly: use exact branch name in $BUILDVERSION_EXEC#175
nightly: use exact branch name in $BUILDVERSION_EXEC#175dancrossnyc wants to merge 1 commit intomasterfrom
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. |
citrus-it
left a comment
There was a problem hiding this comment.
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.
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.
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.