-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
add: empty files add broken when cache mode is hardlinks #3390
Comments
Found the root cause of this. This happens because of the optimization that we do if the file is empty (i.e. 0 bytes size). We never create a hardlink for the file with 0 bytes size and therefore it fails when we try to verify if the hardlink was created. Lines 170 to 182 in a9bc65e
I think, P.S. This only failed if the file was empty (not even a newline). So: echo > foo && dvc add foo # works because of extra-newline character added by `echo`
touch bar && dvc add bar # does not work as the file is empty Also, subsequent runs would not fail because before this error is thrown out, the file gets cached (however, deletes file from workspace), i.e. dvc init --no-scm
dvc config cache.type hardlink
touch foo && dvc add foo # fails and deletes foo from workspace
touch foo && dvc add foo # passes |
@skshetry Great investigation! 🙏 |
* add: do not verify hardlink if file is empty Fixes #3390 * tests: spy * fixup! tests: spy
DVC Version
Reproduce
outputs:
The text was updated successfully, but these errors were encountered: