Skip to content

Commit 1babcd0

Browse files
committed
Auto merge of #45304 - kennytm:travis-color-color-conflict, r=aturon
Fix rustbuild --color conflict when building on Travis outside of Docker When trying to build rust on Travis without using `stamp` or `docker`, both `RUSTC_COLOR=1` and `TRAVIS=true` will separately pass `--color always` to the command line. This causes the build to fail due to "*Option 'color' given more than once*". In this PR, the `RUSTC_COLOR=1` will not be passed in the CI environment.
2 parents fc1a03d + ebbcad9 commit 1babcd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bootstrap/compile.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use build_helper::{output, mtime, up_to_date};
2929
use filetime::FileTime;
3030
use serde_json;
3131

32-
use util::{exe, libdir, is_dylib, copy, read_stamp_file};
32+
use util::{exe, libdir, is_dylib, copy, read_stamp_file, CiEnv};
3333
use {Build, Compiler, Mode};
3434
use native;
3535
use tool;
@@ -792,7 +792,7 @@ fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path) {
792792
cargo.arg("--message-format").arg("json")
793793
.stdout(Stdio::piped());
794794

795-
if stderr_isatty() {
795+
if stderr_isatty() && build.ci_env == CiEnv::None {
796796
// since we pass message-format=json to cargo, we need to tell the rustc
797797
// wrapper to give us colored output if necessary. This is because we
798798
// only want Cargo's JSON output, not rustcs.

0 commit comments

Comments
 (0)