]> git.proxmox.com Git - cargo.git/commitdiff
Document that cargo sets `CARGO` for build scripts
authorAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 29 Nov 2017 20:32:28 +0000 (23:32 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 29 Nov 2017 20:40:50 +0000 (23:40 +0300)
src/doc/book/src/reference/environment-variables.md
src/doc/environment-variables.md
tests/build-script.rs

index e95b79d6cbc2e46616c2931133040e6b147b47f1..08d2adaa8bb5de1bd64549094b4aa41e744bced3 100644 (file)
@@ -73,6 +73,7 @@ let out_dir = env::var("OUT_DIR").unwrap();
 
 `out_dir` will now contain the value of `OUT_DIR`.
 
+* `CARGO` - Path to the `cargo` binary performing the build.
 * `CARGO_MANIFEST_DIR` - The directory containing the manifest for the package
                          being built (the package containing the build
                          script). Also note that this is the value of the
index 6fe532d61a4487eb8fc5cb8a37f719bd534e49f6..f8b168401fc1af629ba3f7620eda3f0b7672b77b 100644 (file)
@@ -73,6 +73,7 @@ let out_dir = env::var("OUT_DIR").unwrap();
 
 `out_dir` will now contain the value of `OUT_DIR`.
 
+* `CARGO` - Path to the `cargo` binary performing the build.
 * `CARGO_MANIFEST_DIR` - The directory containing the manifest for the package
                          being built (the package containing the build
                          script). Also note that this is the value of the
index 0748b44ca2fce41c59cbf8f699c1c87c5d2a6ba9..3644235a3e6ffe2e4adcfddb40ec1a07bc262a48 100644 (file)
@@ -103,6 +103,8 @@ fn custom_build_env_vars() {
 
                 let _feat = env::var("CARGO_FEATURE_FOO").unwrap();
 
+                let _cargo = env::var("CARGO").unwrap();
+
                 let rustc = env::var("RUSTC").unwrap();
                 assert_eq!(rustc, "rustc");