Please describe the problem.
In the recent build of datalad/git-annex (8.20210803+git167-g608593fec) a test failed on Windows
readonly: FAIL (7.55s)
.\\Test\\Framework.hs:57:
drop vs readonly repo failed (transcript follows)
drop foo
failed
git-annex: .git\annex\objects\6cd\e82\SHA256E-s20--e394a389d787383843decc5d3d99b6d184ffa5fddeec23b911f9ee7fc8b9ea77\SHA256E-s20--e394a389d787383843decc5d3d99b6d184ffa5fddeec23b911f9ee7fc8b9ea77: DeleteFile "\\\\?\\C:\\Users\\runneradmin\\.t\\tmprepo3\\.git\\annex\\objects\\6cd\\e82\\SHA256E-s20--e394a389d787383843decc5d3d99b6d184ffa5fddeec23b911f9ee7fc8b9ea77\\SHA256E-s20--e394a389d787383843decc5d3d99b6d184ffa5fddeec23b911f9ee7fc8b9ea77": permission denied (Access is denied.)
drop: 1 failed
ignore deleted files: OK (2.51s)
this is the first and only occurrence so far according to
(git)smaug:/mnt/datasets/datalad/ci/git-annex/builds/2021/08[master]
$> git grep 'permission denied (Access is denied.)'
cron-20210831/build-windows.yaml-369-69466103-failed/1_test-annex.txt:2021-08-31T03:47:09.0093593Z ...
At my end I ran the
readonly
test with the--keep-failures
flags and found out the following:So it looks like the readonly status of the annex object got copied between r1 (
tmprepo0
) and r2 (temprepo1
) at the point ofget
and that prevented the removal of the file duringdrop
.(Btw. I found out that in Msys2/MinGW what is represented as the POSIX readonly mode bits seems to be really represented by the readonly file attribute and not as readonly permissions/ACLs on the file. At least that seems to be the default setting. Cygwin on the other hand defaults to mapping mode bits to ACLs in a rather complex fashion. All of this are just some details that lie behind what calling out to an external
chmod
binary entails on Windows both above in my Git Bash session and in git-annex' unit testtest_readonly
.)