Skip to content

Commit 6ac9e7c

Browse files
committed
Set CARGO_MAKEFLAGS, not MAKEFLAGS
1 parent f89e1f4 commit 6ac9e7c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ impl Client {
189189
/// Note, though, that on Windows it should be safe to call this function
190190
/// any number of times.
191191
pub unsafe fn from_env() -> Option<Client> {
192-
let var = match env::var("MAKEFLAGS").or(env::var("MFLAGS")) {
192+
let var = match env::var("CARGO_MAKEFLAGS")
193+
.or(env::var("MAKEFLAGS"))
194+
.or(env::var("MFLAGS")) {
193195
Ok(s) => s,
194196
Err(_) => return None,
195197
};
@@ -246,18 +248,16 @@ impl Client {
246248
///
247249
/// ## Platform-specific behavior
248250
///
249-
/// On Unix and Windows this will clobber the `MAKEFLAGS` and `MFLAGS`
250-
/// environment variables for the child process, and on Unix this will also
251-
/// allow the two file descriptors for this client to be inherited to the
252-
/// child.
251+
/// On Unix and Windows this will clobber the `CARGO_MAKEFLAGS` environment
252+
/// variables for the child process, and on Unix this will also allow the
253+
/// two file descriptors for this client to be inherited to the child.
253254
pub fn configure(&self, cmd: &mut Command) {
254255
let arg = self.inner.string_arg();
255256
// Older implementations of make use `--jobserver-fds` and newer
256257
// implementations use `--jobserver-auth`, pass both to try to catch
257258
// both implementations.
258259
let value = format!("--jobserver-fds={0} --jobserver-auth={0}", arg);
259-
cmd.env("MAKEFLAGS", &value);
260-
cmd.env("MFLAGS", &value);
260+
cmd.env("CARGO_MAKEFLAGS", &value);
261261
self.inner.configure(cmd);
262262
}
263263

0 commit comments

Comments
 (0)