Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct mistake about supporting sub-makes and document CARGO_MAKEFLAGS #8741

Merged
merged 1 commit into from
Sep 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/doc/src/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ let out_dir = env::var("OUT_DIR").unwrap();
current working directory of the build script when it
starts.
* `CARGO_MANIFEST_LINKS` — the manifest `links` value.
* `CARGO_MAKEFLAGS` — Contains parameters needed for Cargo's [jobserver]
implementation to parallelize subprocesses.
Rustc or cargo invocations from build.rs can already
read `CARGO_MAKEFLAGS`, but GNU Make requires the
flags to be specified either directly as arguments,
or through the `MAKEFLAGS` environment variable.
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_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 Expand Up @@ -288,10 +297,9 @@ let out_dir = env::var("OUT_DIR").unwrap();
that care should be taken when interpreting this environment
variable. For historical purposes this is still provided but
recent versions of Cargo, for example, do not need to run `make
-j` as it'll automatically happen. Cargo implements its own
[jobserver] and will allow build scripts to inherit this
information, so programs compatible with GNU make jobservers will
already have appropriately configured parallelism.
-j`, and instead can set the `MAKEFLAGS` env var to the content
of `CARGO_MAKEFLAGS` to activate the use of Cargo's GNU Make
compatible [jobserver] for sub-make invocations.
* `OPT_LEVEL`, `DEBUG` — values of the corresponding variables for the
profile currently being built.
* `PROFILE` — `release` for release builds, `debug` for other builds.
Expand Down