I followed the readme instructions for building Parity from source and then executed:
cargo build --release
~/.cargo/bin/cargo build --release
as instructed, both of which returned the following message while the prompt hung:
Blocking waiting for file lock on the registry index
I'm on a Mac.
Running cargo clean
seems to fix the problem.
I had the same issue and got around it by using
rm -rf ~/.cargo/registry/index/*
I suggest looking at 'Cargo build hangs with " Blocking waiting for file lock on the registry index" after building parity from source' first.
This happens when you run two 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 two 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 run pkill rls
to solve the issue.
As a last resort, you can force the removal of the lock using rm -rf ~/.cargo/registry/index/*
as said in jvatic's answer.
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.
Removing rm $CARGO_HOME/.package-cache
worked for me.
I accidentally hit ctrl+z
instead of ctrl+c
while executing cargo run
and the next execution of cargo run
showed me Blocking waiting for file lock on the registry index
. I removed the said file and then it worked again.
Edit:
If you accidentally hit ctrl+z
like me, you can unsuspend the cargo run
process by running fg
instead of deleting the package cache file. ctrl+z
actually sends a SIGTSTP signal to the process and that process will be suspended until you tell it to continue. See this answer for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With