-
Notifications
You must be signed in to change notification settings - Fork 190
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
Download check for cache directory #559
base: master
Are you sure you want to change the base?
Conversation
Does this handle submodules well? The failures I most often saw were not that the main directory was empty, but that some required submodule didn't exist - most often with |
This will currently make no change if the download is aborted. CMake FetchContents makes some retries, then the job fails. If CMake reports this correctly, then the marker file is not created. The change is for cache and reusing the downloaded data. If no marker file, the directory is incomplete and will be deleted and downloaded again. If checksum is used, it could handle also failed checksums. |
@gerhardol This looks like something that was missing from CPM! Maybe it's jammed up because it fails the tests? IDK. You can fix that pretty easy, the instructions are in the last few lines of CONTRIBUTING.md. LMK when you get that done and I'll try to get a review in (but I can only really do a big review on the weekend, I think). Then we can ping a maintainer to get this merged. |
When I apply the style, there are many changes to lines I have not changed too. |
Enjoy your vacation! This can wait. :-) |
1539d3e
to
7d7113f
Compare
Test fails due to the example test/unit/checksum_directory.sh is used in tests and MacOs has other arguments. |
bc31cc5
to
b641804
Compare
Add a marker .download file to validate the contents in cache directories. Previously only the existence of the directory was used, so if the download was aborted the cache directory had to be deleted manually if this occurred (with a likely cryptic error message). If the .download check file does not exist, the directory will be deleted and downloaded again. It is also possible to check the contents with a checksum. If not matching, the directory will be deleted and downloaded again. For Git repos the repos can be deleted if the status is not clean, a checksum is not relevant (but used in the tests).
b641804
to
8fceb72
Compare
MacOs handled, Windows checksum example is not provided (it depends on if msys, cygwin or some native program is used, it is up to Win users to provide such an example). |
Can this be merged? |
I cannot do much. But if there are reviews and usage stories, maintainers are inspired and more comfortable merging. |
Add a marker .download file to validate the contents in cache directories. Previously only the existence of the directory was used, so if the download was aborted the cache directory had to be deleted manually if this occurred (with a likely cryptic error message). If the .download check file does not exist, the directory will be deleted and downloaded again.
It is also possible to check the contents with a checksum. If not matching, the directory will be deleted and downloaded again.
For Git repos the repos can be deleted if the status is not clean, a checksum is not relevant (but used in the tests).
Note: The important part of this PR is the .download file, that will cover the majority of the issues.