Repository: rust-lang/rust
File: src/bootstrap/src/core/builder/cargo.rs (Rust)

Code before:
        let color_logs = ["RUSTDOC_LOG_COLOR", "RUSTC_LOG_COLOR", "RUST_LOG_COLOR"];
        match self.build.config.color {
            Color::Always => {
                cargo.arg("--color=always");
                for log in &color_logs {
                    cargo.env(log, "always");
                }
            }
            Color::Never => {
                cargo.arg("--color=never");
                for log in &color_logs {
                    cargo.env(log, "never");
                }
            }
            Color::Auto => {} // nothing to do
        }

        if cmd_kind != Kind::Install {
            cargo.arg("--target").arg(target.rustc_target_arg());
        } else {
            assert_eq!(target, compiler.host);
        }

        cargo
    }

    /// This will create a [`BootstrapCommand`] that represents a pending execution of cargo. This
    /// cargo will be configured to use `compiler` as the actual rustc compiler, its output will be
    /// scoped by `mode`'s output directory, it will pass the `--target` flag for the specified
    /// `target`, and will be executing the Cargo command `cmd`. `cmd` can be `miri-cmd` for
    /// commands to be run with Miri.
    #[track_caller]
    fn cargo(
        &self,
        compiler: Compiler,
        mode: Mode,
        source_type: SourceType,
        target: TargetSelection,
        cmd_kind: Kind,
    ) -> Cargo {
        let mut cargo = self.bare_cargo(compiler, mode, target, cmd_kind);
        let out_dir = self.stage_out(compiler, mode);

        let mut hostflags = HostFlags::default();

        // Codegen backends are not yet tracked by -Zbinary-dep-depinfo,
        // so we need to explicitly clear out if they've been updated.
        for backend in self.codegen_backends(compiler) {
            build_stamp::clear_if_dirty(self, &out_dir, &backend);
        }


Review comment (suggestion):
This was intentional because of https://github.com/rust-lang/rust/pull/56090#issuecomment-446462488. I don't know if that issue has been fixed since or not.

Code after:
        let color_logs = ["RUSTDOC_LOG_COLOR", "RUSTC_LOG_COLOR", "RUST_LOG_COLOR"];
        match self.build.config.color {
            Color::Always => {
                cargo.arg("--color=always");
                for log in &color_logs {
                    cargo.env(log, "always");
                }
            }
            Color::Never => {
                cargo.arg("--color=never");
                for log in &color_logs {
                    cargo.env(log, "never");
                }
            }
            Color::Auto => {} // nothing to do
        }

        if cmd_kind != Kind::Install {
            cargo.arg("--target").arg(target.rustc_target_arg());
        } else {
            assert_eq!(target, compiler.host);
        }

        // Bootstrap only supports modern FIFO jobservers. Older pipe-based jobservers can run into
        // "invalid file descriptor" errors, as the jobserver file descriptors are not inherited by
        // scripts like bootstrap.py, while the environment variable is propagated. So, we pass
        // MAKEFLAGS only if we detect a FIFO jobserver, otherwise we clear it.
        let has_modern_jobserver = env::var("MAKEFLAGS")
            .map(|flags| flags.contains("--jobserver-auth=fifo:"))
            .unwrap_or(false);

        if !has_modern_jobserver {
            cargo.env_remove("MAKEFLAGS");
        }

        cargo
    }

    /// This will create a [`BootstrapCommand`] that represents a pending execution of cargo. This
    /// cargo will be configured to use `compiler` as the actual rustc compiler, its output will be
    /// scoped by `mode`'s output directory, it will pass the `--target` flag for the specified
    /// `target`, and will be executing the Cargo command `cmd`. `cmd` can be `miri-cmd` for
    /// commands to be run with Miri.
    #[track_caller]
    fn cargo(
        &self,
        compiler: Compiler,
        mode: Mode,
        source_type: SourceType,
        target: TargetSelection,
        cmd_kind: Kind,