Is it possible to deactivate file locking in cargo?

拥有回忆 提交于 2019-12-01 19:26:31
malbarbo

I don't think that a file lock would be required for cargo check.

I can think of in one reason: build scripts. A build script can generate files that are included in the crate, checking the crate without generating the files would probably produce errors. Running 2 instances of a build script in parallel is not a good idea (conflicting file writes, etc), so the locking is required.


I want to run the following commands side by side

You have two options:

  1. Sequential: install cargo-do and run

    cargo watch "do check, build"
    

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

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

    CARGO_TARGET_DIR=/tmp cargo watch check
    
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!