]> git.proxmox.com Git - cargo.git/commitdiff
Add documentation for CARGO_PRIMARY_PACKAGE
authorEduardo Broto <ebroto@tutanota.com>
Mon, 12 Oct 2020 13:25:33 +0000 (15:25 +0200)
committerEduardo Broto <ebroto@tutanota.com>
Wed, 14 Oct 2020 21:35:00 +0000 (23:35 +0200)
src/doc/src/reference/environment-variables.md

index eec0d0aac043529b75a82eb9f898636a96c28cc4..4e9f36bc20edca853c5456965cf2c3f40065da56 100644 (file)
@@ -265,6 +265,12 @@ let out_dir = env::var("OUT_DIR").unwrap();
                       Currently Cargo doesn't set the `MAKEFLAGS` variable,
                       but it's free for build scripts invoking GNU Make
                       to set it to the contents of `CARGO_MAKEFLAGS`.
+* `CARGO_PRIMARY_PACKAGE` — This environment variable will be set if the package being
+                            built is primary. Primary packages are the ones the user 
+                            selected on the command-line, either with `-p` flags or 
+                            the defaults based on the current directory and the default 
+                            workspace members.
+                            This environment variable will not be set when building dependencies.
 * `CARGO_FEATURE_<name>` — For each activated feature of the package being
                            built, this environment variable will be present
                            where `<name>` is the name of the feature uppercased