-
Notifications
You must be signed in to change notification settings - Fork 1.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
Gracefully handle outdated .ninja_log during '-t recompact' #2390
Gracefully handle outdated .ninja_log during '-t recompact' #2390
Conversation
Thank you. The fix looks good to me, but can you add a regression test in misc/output_test.py to verify that this works correctly? E.g.: perform a build, then overwrite the version bytes in the build log, then run the recompact tool and verify it does not report an error? |
f693243
to
878653f
Compare
I added a test as suggested, @digit-google |
878653f
to
7f72db9
Compare
7f72db9
to
db07288
Compare
Thank you, this looks good to me. @jhasse what do you think? |
Should I try to work around Python 3.6 in AppVeyor not knowing |
Dropping Ubuntu 14.04, 16.04 and 18.04 in favor of 20.04, 22.04 and 24.04 is something I would want to do soon, so you might also just wait. But I think we'd also have to run these tests on RHEL 7 (or 8 soon), I don't know what Python version they are using. |
Looks like RHEL 7 supports Python 3.8 per https://access.redhat.com/documentation/en-us/red_hat_software_collections/3/html-single/3.5_release_notes/index#sect-RHSCL-Changes-python Depending on your timeline for dropping the older distros, I'd offer to get the test to work with the older Python version to wrap this PR up. |
Aargh, I was not aware of this limitation, remove the |
See #2399 |
Can you rebase against / merge master? |
db07288
to
035526f
Compare
Looking good now :) |
When we explicitly unlink the file we should return LOAD_NOT_FOUND instead of LOAD_SUCCESS
035526f
to
878aa46
Compare
LGTM now, thank you. |
Fixes #2048
I ran into a similar issue when migrating existing workspaces from ninja 1.9.0 to the latest revision from Git.
This change will cause
NinjaMain::OpenBuildLog()
to not callbuild_log_.Recompact()
afterbuild_log_.Load()
just deleted that file because it contained an invalid log version.