Skip to content

Commit b548d70

Browse files
keithaciidgh
authored andcommitted
Optionally use non-frontend color-diagnostics flag
This fixes Swift doing a full rebuild when you switch between a tty, and non-tty https://bugs.swift.org/browse/SR-7982
1 parent 10ac066 commit b548d70

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/Build/BuildPlan.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,11 @@ public final class SwiftTargetBuildDescription {
519519

520520
// Add arguments to colorize output if stdout is tty
521521
if buildParameters.isTTY {
522-
args += ["-Xfrontend", "-color-diagnostics"]
522+
if Process.env["SWIFTPM_USE_NEW_COLOR_DIAGNOSTICS"] != nil {
523+
args += ["-color-diagnostics"]
524+
} else {
525+
args += ["-Xfrontend", "-color-diagnostics"]
526+
}
523527
}
524528

525529
// Add the output for the `.swiftinterface`, if requested.

0 commit comments

Comments
 (0)