13

I recently installed rustup on my Windows machine and incorporated it into Atom as my editor. Everything works fine, but as soon as I do a cargo run on my project, the first thing that Cargo says is:

 Blocking waiting for file lock on build directory

This blocks the whole process for about a minute before the actual compile and run starts. As far as I remember this did not happen before (I use Cargo under OS X but without rustup).

Is there any way to disable this or at least reduce the timeout?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Norbert
  • 735
  • 8
  • 19
  • 4
    Perhaps you use an Atom plugin that runs `cargo build` to check the syntax? If it is the case, this is the issue because you cannot run `cargo` twice at the same time. – antoyo Sep 05 '16 at 18:44
  • Oh yes, that is a possible solution. I'm using the tokamak plugin and - as far as I know - it does syntax checking using cargo. Thanks for the hint. I'll look furhter into this direction. – Norbert Sep 05 '16 at 18:49
  • @antoyo: Sounds like an answer – Matthieu M. Sep 06 '16 at 07:50

2 Answers2

7

The tokamak Atom plugin runs cargo commands. Since you cannot run cargo twice at the same time, you get this notice.

I don't think there is something you can do, unless waiting for the compiler to speed up.

Perhaps playing with the options like save_buffers_before_run in tokamak.toml could make a difference.

antoyo
  • 11,097
  • 7
  • 51
  • 82
  • http://stackoverflow.com/a/38643019/155423 — use a different Cargo directory for tokamak and console. – Shepmaster Sep 06 '16 at 13:56
  • 1
    After quite some time that I spent with the settings of Atom, I finally found that there was a second plugin (rust-linter) that has obviously been installed along with tokamak. And this plugin has a settting named "use cargo". After unchecking this option, I don't get the block any longer :-)))) Thank you all for your hints that finally pointed me into the right direction. – Norbert Sep 07 '16 at 19:00
5

Today I facing the same problem, and this command works for me:

rm -rf ~/.cargo/.package-cache

Once you run the code, just run cargo build

Dolphin
  • 29,069
  • 61
  • 260
  • 539