Is it possible to deactivate file locking in a load?

I want to run the following commands side by side

cargo watch "check" cargo watch "build" 

I want to run cargo watch build in the background and use cargo watch check to view error messages.

The problem is that cargo watch check always starts after cargo watch build , and then you also need to wait for the file to lock

 cargo check Blocking waiting for file lock on build directory 

I do not think that a file lock will be required to verify the cargo. Can I disable file locking in a truck?

+4
source share
1 answer

I do not think that checking files will require locking files.

I can think for one reason: create scripts . The script construct can generate files that are included in the box, checking the box without generating files is likely to lead to errors. Running two instances of the script assembly in parallel is not a good idea (conflicting file entries, etc.), therefore locking is required.


I want to run the following commands side by side

You have two options:

  • Sequence: install cargo-do and run

     cargo watch "do check, build" 

this will run cargo check first and then cargo build (if cargo check does not detect an error).

  1. Parallel: change target-dir for one of two load commands:

     CARGO_TARGET_DIR=/tmp cargo watch check 
+5
source

All Articles