Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find .cargo/config?

I don't have this file in c:/user/me/.cargo/

like image 733
druzhcom Avatar asked Oct 09 '17 15:10

druzhcom


People also ask

Where does Cargo build output go?

Cargo stores the output of a build into the "target" directory. By default, this is the directory named target in the root of your workspace. To change the location, you can set the CARGO_TARGET_DIR environment variable, the build. target-dir config value, or the --target-dir command-line flag.

Where is Cargo TOML?

Cargo. toml and Cargo. lock are stored in the root of your project (package root). Source code goes in the src directory.

What is Rustflags?

RUSTFLAGS — A space-separated list of custom flags to pass to all compiler invocations that Cargo performs. In contrast with cargo rustc , this is useful for passing a flag to all compiler instances.

What does Cargo run do?

When no target selection options are given, cargo run will run the binary target. If there are multiple binary targets, you must pass a target flag to choose one. Or, the default-run field may be specified in the [package] section of Cargo.


1 Answers

As described in the Cargo documentation, there's no one place for .cargo:

Cargo allows local configuration for a particular project as well as global configuration, like git. Cargo extends this to a hierarchical strategy. If, for example, Cargo were invoked in /projects/foo/bar/baz, then the following configuration files would be probed for and unified in this order:

  • /projects/foo/bar/baz/.cargo/config
  • /projects/foo/bar/.cargo/config
  • /projects/foo/.cargo/config
  • /projects/.cargo/config
  • /.cargo/config
  • $HOME/.cargo/config

The complete algorithm also searches in your home directory.

You are supposed to create the directory in whichever place is most appropriate for your needs.

like image 138
Shepmaster Avatar answered Nov 15 '22 09:11

Shepmaster