CI failing with Blocking waiting for file lock on build directory

We are writing an email-based instant messenger in Rust (the UIs are in other languages): https://github.com/deltachat/deltachat-core-rust/

Now, our CIs are constantly failing with

Blocking waiting for file lock on build directory

For example: https://app.circleci.com/pipelines/github/deltachat/deltachat-core-rust/6528/workflows/806fb042-43af-4f78-9553-9fa83e629216/jobs/26964

My first try fixing this was to kill the process if it blocks, do cargo clean and retry (in Python): https://github.com/deltachat/deltachat-core-rust/pull/1921/files

But

  1. Is there any solution that does not take as long as cargo clean? (because everything has to be rebuilt afterwards)
  2. Not every CI script is in Rust, some are shell scripts. I could extract this to a Python script that can be invoked both from Python and Shell but is there any better solution?

Thanks for your help!

I started to see that message when using Visual Studio code and the rust-analyzer extension. There is some config one can set to stop it locking the build directory. Sorry I forget what exactly.

There can be a tug of war if one has two compilations going on at the same time or the Rust Language Server running.

Others have seen it with apparently different causes. See for example:


Thanks a lot for your quick answer!

However, I have seen both of the links you sent (and many more) but they didn't help me (well they did, the second one got me the idea with cargo clean but I still have the questions posted above)

This might be a great help if you remembered where to find this option because I was looking for a very long time for such an option.

This might help:

https://stackoverflow.com/questions/29971600/choose-folders-to-be-ignored-during-search-in-vs-code#:~:text=Changing%20settings,You%20can%20modify%20the%20search.

And see "Exclude Folders" here:

Both links you sent are about IDEs. I am talking about the CI (a server where only the tests are run in a container or VM, nothing else and definitely not another cargo command)