Hey there. Every time I build my canisters, I get this kind of warning:
Checking for vulnerabilities in rust canisters.
Fetching advisory database from `https://github.com/RustSec/advisory-db.git`
warning: directory /home/alexander/.cargo/advisory-db is locked, waiting for up to 300 seconds for it to become available
5 minutes is quite a big timeout to wait every time, especially when you update canisters frequently. How do I lower it to something more meaningful, like 10 sec?
It shouldn’t be locked all the time. Do you have other processes running that may access the advisory-db? Or is it possible that the db was not released properly at some point?
I use turborepo to build stuff in my project. There are two subprojects, where canisters are built during this process. Turborepo tries to build them in parallel, which (as I think) is causing the problem.
I could make it build them sequentially, but it is kinda strange given that cargo is pretty much capable of parallel building.
The problem is that when you run something like dfx deploy and then interrupt it (by hitting ctrl+c for example), then the lock file is created but not purged properly.
Go to ~/.cargo/advisory-db and delete the *.lock file manually.
After that the problem should go away, until you interrupt the build process again.
Oh, found the lock file. For anyone running into this, it is not in the advisory-db folder but in the parent .cargo folder. Deleting it solved the issue.