-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix incremental updating of build version information #11035
Conversation
I'm confused, what was causing it to fail before? Looks like if Slight tangent, but is configure time really the best place to do this? Seems like it might be better to create an |
It would re-run the configure, yes, but the configure just takes the pre-existing variables. The variables are only set in this CMake file, and thus would only be called once. That's what it looks like to me, anyway. |
I looked into |
It's unwise to make a change when we aren't sure why it was previously broken, and why this change "fixes it". Hell, I've never noticed this bug, so does it only happen under some configurations? Is it some form of undefined behaviour in cmake? If so, this change might make it worse on other configurations. I suspect it might actually be the
The advantage of |
It's a very similar situation with Neither of these variables change with the revision, whereas the new variables set here do. |
In regards to the actual bug, not sure. You'd have to ask AdmiralCurtiss, as they were the one encountering the issue. |
I have never investigated why this happens either, but when using Visual Studio's built-in CMake support (the Open Folder thing) it generates the scmrev.h once and then never again -- my current build's header is stuck on a branch I worked on months ago. This may also result from a combination of using both CMake and the VS project files? Unsure. I asked Jos on IRC and they said it never updates for them either, so I assumed it to be a general issue with the CMake files. I do agree that doing it at build time rather than at configure time makes more sense -- in particular because it's not even guaranteed you'll even do a reconfigure after switching commit/branch. The way I've done this in the past on another project is by using |
Weird-- I failed to encounter this issue on either master or this pr. Admittedly, I was using Linux, and was calling make to test rather than reconfiguring. Both still worked for me. |
For the record, I was also using Visual Studio's built-in CMake support. |
So I debugged this now and, this PR does not fix the issue -- because the code actually worked fine as-is. Turns out the issue is elsewhere. My guess here is correct:
The VS project files generate the I suspect a |
So it was a VS skill issue all along. |
Previously, on CMake builds, version information would not be updated on subsequent rebuilds without a full clearing of the build dir. Now, version information will be updated whenever the git revision changes.
How it works:
On the first build,
DOLPHIN_WC_REVISION_CACHE
will not have been set thus will not be equal toDOLPHIN_WC_REVISION
. The version information will be generated, and thenDOLPHIN_WC_REVISION_CACHE
will be set.On subsequent builds,
DOLPHIN_WC_REVISION_CACHE
is set to the revision of the previous build. If it differs from the current revision (DOLPHIN_WC_REVISION
), version information will be re-generated.