Skip to content

Commit 2c4cf1d

Browse files
committed
Auto merge of #14676 - weihanglo:env-doc, r=ehuss
docs(env): minor improvements in environment variables doc
2 parents e8adba9 + ffca7be commit 2c4cf1d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/doc/src/reference/environment-variables.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ corresponding environment variable is set to the empty string, `""`.
260260
* `CARGO_PRIMARY_PACKAGE` --- This environment variable will be set if the
261261
package being built is primary. Primary packages are the ones the user
262262
selected on the command-line, either with `-p` flags or the defaults based
263-
on the current directory and the default workspace members. This environment
264-
variable will not be set when building dependencies. This is only set when
265-
compiling the package (not when running binaries or tests).
263+
on the current directory and the default workspace members.
264+
This variable will not be set when building dependencies,
265+
unless a dependency is also a workspace member that was also selected on the command-line.
266+
This is only set when compiling the package (not when running binaries or tests).
266267
* `CARGO_TARGET_TMPDIR` --- Only set when building [integration test] or benchmark code.
267268
This is a path to a directory inside the target directory
268269
where integration tests or benchmarks are free to put any data needed by
@@ -355,6 +356,9 @@ let out_dir = env::var("OUT_DIR").unwrap();
355356
* `CARGO_CFG_TARGET_FEATURE=mmx,sse` --- List of CPU [target features] enabled.
356357
> Note that different [target triples][Target Triple] have different sets of `cfg` values,
357358
> hence variables present in one target triple might not be available in the other.
359+
>
360+
> Some cfg values like `debug_assertions`, `test`, and Cargo features like
361+
> `feature="foo"` are not available.
358362
* `OUT_DIR` --- the folder in which all output and intermediate artifacts should
359363
be placed. This folder is inside the build directory for the package being built,
360364
and it is unique for the package in question.

0 commit comments

Comments
 (0)