Cargo build hangs with " Blocking waiting for file lock on the registry index" after building parity from source
Solution 1:
Running cargo clean
seems to fix the problem.
Solution 2:
I had the same issue and got around it with rm -rf ~/.cargo/registry/index/*
.
Edit: I suggest looking at this answer first.
Solution 3:
This happens when you run 2 compilations of the same project at the same time. The compiler uses a lock file to avoid having data race issues. There are some possibilities:
If you ran the 2 compilations yourself, the solution is obvious: you need to cancel one of them.
If you use an IDE that automatically compiles your project: you can wait for the job to be finished or close the IDE. If it does not work, this is probably because of RLS hanging out. You can just
pkill rls
to solve the issue.As a last resort, you can remove the lock forcefully:
rm -rf ~/.cargo/registry/index/*
as said in another answer.
Solution 4:
It is important to ensure you have no other rls or cargo running.
sudo pkill rls cargo
is a good way to ensure they are not.