@@ -260,9 +260,10 @@ corresponding environment variable is set to the empty string, `""`.
260
260
* ` CARGO_PRIMARY_PACKAGE ` --- This environment variable will be set if the
261
261
package being built is primary. Primary packages are the ones the user
262
262
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).
266
267
* ` CARGO_TARGET_TMPDIR ` --- Only set when building [ integration test] or benchmark code.
267
268
This is a path to a directory inside the target directory
268
269
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();
355
356
* ` CARGO_CFG_TARGET_FEATURE=mmx,sse ` --- List of CPU [ target features] enabled.
356
357
> Note that different [ target triples] [ Target Triple ] have different sets of ` cfg ` values,
357
358
> 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.
358
362
* ` OUT_DIR ` --- the folder in which all output and intermediate artifacts should
359
363
be placed. This folder is inside the build directory for the package being built,
360
364
and it is unique for the package in question.
0 commit comments