In my CI/CD pipeline, I generate docs with cargo doc --workspace --no-deps --document-private-items. This generates a lock file at target/doc/.lock. Now for some reason, this lock file doesn't get removed when cargo is done with generating the documentation, even when it exits with exit code 0.
In this case, my CI job uploads the entire target/docs directory as a CI artifact. But when I download these files again, copying them falls due to missing permissions on the lock file
$ cp -fr target/doc public/code-doc
cp: can't open 'target/doc/.lock': Permission denied
There seems to be some precedence on this issue, for example here and here where the workaround seems to je to delete the lock file. But I haven't been able to find a concrete post about fixing this issue, which is why I'm posting here.
Has anyone else encountered this issue? I unfortunately have been unable to reliably recreate it.