@@ -3220,7 +3220,6 @@ fn buildOutputType(
32203220 .verbose_llvm_bc = verbose_llvm_bc ,
32213221 .verbose_cimport = verbose_cimport ,
32223222 .verbose_llvm_cpu_features = verbose_llvm_cpu_features ,
3223- .color = color ,
32243223 .time_report = time_report ,
32253224 .stack_report = stack_report ,
32263225 .each_lib_rpath = each_lib_rpath ,
@@ -3323,7 +3322,7 @@ fn buildOutputType(
33233322 return cmdTranslateC (comp , arena , null );
33243323 }
33253324
3326- updateModule (comp ) catch | err | switch (err ) {
3325+ updateModule (comp , color ) catch | err | switch (err ) {
33273326 error .SemanticAnalyzeFail = > {
33283327 assert (listen == .none );
33293328 saveState (comp , debug_incremental );
@@ -4436,13 +4435,13 @@ fn runOrTestHotSwap(
44364435 }
44374436}
44384437
4439- fn updateModule (comp : * Compilation ) ! void {
4438+ fn updateModule (comp : * Compilation , color : Color ) ! void {
44404439 {
44414440 // If the terminal is dumb, we dont want to show the user all the output.
44424441 var progress : std.Progress = .{ .dont_print_on_dumb = true };
44434442 const main_progress_node = progress .start ("" , 0 );
44444443 defer main_progress_node .end ();
4445- switch (comp . color ) {
4444+ switch (color ) {
44464445 .off = > {
44474446 progress .terminal = null ;
44484447 },
@@ -4460,13 +4459,14 @@ fn updateModule(comp: *Compilation) !void {
44604459 defer errors .deinit (comp .gpa );
44614460
44624461 if (errors .errorMessageCount () > 0 ) {
4463- errors .renderToStdErr (renderOptions (comp . color ));
4462+ errors .renderToStdErr (renderOptions (color ));
44644463 return error .SemanticAnalyzeFail ;
44654464 }
44664465}
44674466
44684467fn cmdTranslateC (comp : * Compilation , arena : Allocator , fancy_output : ? * Compilation.CImportResult ) ! void {
44694468 if (build_options .only_core_functionality ) @panic ("@translate-c is not available in a zig2.c build" );
4469+ const color : Color = .auto ;
44704470 assert (comp .c_source_files .len == 1 );
44714471 const c_source_file = comp .c_source_files [0 ];
44724472
@@ -4559,7 +4559,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilati
45594559 p .errors = errors ;
45604560 return ;
45614561 } else {
4562- errors .renderToStdErr (renderOptions (comp . color ));
4562+ errors .renderToStdErr (renderOptions (color ));
45634563 process .exit (1 );
45644564 }
45654565 },
@@ -5534,7 +5534,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
55345534 };
55355535 defer comp .destroy ();
55365536
5537- updateModule (comp ) catch | err | switch (err ) {
5537+ updateModule (comp , color ) catch | err | switch (err ) {
55385538 error .SemanticAnalyzeFail = > process .exit (2 ),
55395539 else = > | e | return e ,
55405540 };
0 commit comments