mozilla/rust — comment on commit 2e63bc5d8293d38cb3be7cb07d6267c9db385062
File:  line 0
By tychosci:

No. "work dir" means system-level cargo directory, not `cargo/work` used to build packages.
I abbreviated that to "work dir" for < 50 characters summary. Sorry.

`cargo install` uses appropriate directory for building packages:

* `$sysroot/$libdir/cargo/work` on system mode;
* `$HOME/.cargo/work` on user mode;
* `$PWD/.cargo/work` on local mode (this is default)

And now `cargo` uses system mode by default (except `cargo install`, it uses local mode by default), to retrieve/save resources for cargo (but, all available commands except `cargo install {-G|--mode=system}`, `cargo init` and `cargo sync` do not change any contents of system-level cargo directory, so you don't need to care about write-permission of it to simply list/search packages with `cargo list`/`cargo search`). Of course, you need to get privileged (typically with `sudo`) when you want to `cargo init`, `cargo sync` or `cargo install` with `-G`/`--mode=system`, and do not have write-permission of $sysroot.

We can change its default mode to user mode from system mode by editing [here](https://github.com/mozilla/rust/blob/master/src/cargo/cargo.rs#L371) and [here](https://github.com/mozilla/rust/blob/master/src/cargo/cargo.rs#L377) to enable us to `init`/`sync` without worrying about write-permission, though.