Skip to content

Commit

Permalink
Auto merge of #8896 - ehuss:beta-fix-primary, r=alexcrichton
Browse files Browse the repository at this point in the history
[beta] backport doc fix for CARGO_PRIMARY_PACKAGE

Beta backport of #8891, since this is a new feature, I think it would be good to have the documentation correct from the start.
  • Loading branch information
bors committed Nov 24, 2020
2 parents a6684b4 + 56ca6c8 commit b921683
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/doc/src/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ system:
* `TERM` — If this is set to `dumb`, it disables the progress bar.
* `BROWSER` — The web browser to execute to open documentation with [`cargo
doc`]'s' `--open` flag.
* `RUSTFMT` — Instead of running `rustfmt`,
* `RUSTFMT` — Instead of running `rustfmt`,
[`cargo fmt`](https://github.com/rust-lang/rustfmt) will execute this specified
`rustfmt` instance instead.

Expand Down Expand Up @@ -206,6 +206,12 @@ let version = env!("CARGO_PKG_VERSION");
example, `CARGO_BIN_EXE_my-program` for a binary named `my-program`.
Binaries are automatically built when the test is built, unless the binary
has required features that are not enabled.
* `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. This is only set when
compiling the package (not when running binaries or tests).

[integration test]: cargo-targets.md#integration-tests
[`env` macro]: ../../std/macro.env.html
Expand Down Expand Up @@ -266,12 +272,6 @@ 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
Expand Down

0 comments on commit b921683

Please sign in to comment.