| ... | @@ -3220,7 +3220,6 @@ fn buildOutputType( | ... | @@ -3220,7 +3220,6 @@ fn buildOutputType( |
| 3220 | .verbose_llvm_bc = verbose_llvm_bc, | 3220 | .verbose_llvm_bc = verbose_llvm_bc, |
| 3221 | .verbose_cimport = verbose_cimport, | 3221 | .verbose_cimport = verbose_cimport, |
| 3222 | .verbose_llvm_cpu_features = verbose_llvm_cpu_features, | 3222 | .verbose_llvm_cpu_features = verbose_llvm_cpu_features, |
| 3223 | .color = color, | | |
| 3224 | .time_report = time_report, | 3223 | .time_report = time_report, |
| 3225 | .stack_report = stack_report, | 3224 | .stack_report = stack_report, |
| 3226 | .each_lib_rpath = each_lib_rpath, | 3225 | .each_lib_rpath = each_lib_rpath, |
| ... | @@ -3323,7 +3322,7 @@ fn buildOutputType( | ... | @@ -3323,7 +3322,7 @@ fn buildOutputType( |
| 3323 | return cmdTranslateC(comp, arena, null); | 3322 | return cmdTranslateC(comp, arena, null); |
| 3324 | } | 3323 | } |
| 3325 | | 3324 | |
| 3326 | updateModule(comp) catch |err| switch (err) { | 3325 | updateModule(comp, color) catch |err| switch (err) { |
| 3327 | error.SemanticAnalyzeFail => { | 3326 | error.SemanticAnalyzeFail => { |
| 3328 | assert(listen == .none); | 3327 | assert(listen == .none); |
| 3329 | saveState(comp, debug_incremental); | 3328 | saveState(comp, debug_incremental); |
| ... | @@ -4436,13 +4435,13 @@ fn runOrTestHotSwap( | ... | @@ -4436,13 +4435,13 @@ fn runOrTestHotSwap( |
| 4436 | } | 4435 | } |
| 4437 | } | 4436 | } |
| 4438 | | 4437 | |
| 4439 | fn updateModule(comp: *Compilation) !void { | 4438 | fn updateModule(comp: *Compilation, color: Color) !void { |
| 4440 | { | 4439 | { |
| 4441 | // If the terminal is dumb, we dont want to show the user all the output. | 4440 | // If the terminal is dumb, we dont want to show the user all the output. |
| 4442 | var progress: std.Progress = .{ .dont_print_on_dumb = true }; | 4441 | var progress: std.Progress = .{ .dont_print_on_dumb = true }; |
| 4443 | const main_progress_node = progress.start("", 0); | 4442 | const main_progress_node = progress.start("", 0); |
| 4444 | defer main_progress_node.end(); | 4443 | defer main_progress_node.end(); |
| 4445 | switch (comp.color) { | 4444 | switch (color) { |
| 4446 | .off => { | 4445 | .off => { |
| 4447 | progress.terminal = null; | 4446 | progress.terminal = null; |
| 4448 | }, | 4447 | }, |
| ... | @@ -4460,13 +4459,14 @@ fn updateModule(comp: *Compilation) !void { | ... | @@ -4460,13 +4459,14 @@ fn updateModule(comp: *Compilation) !void { |
| 4460 | defer errors.deinit(comp.gpa); | 4459 | defer errors.deinit(comp.gpa); |
| 4461 | | 4460 | |
| 4462 | if (errors.errorMessageCount() > 0) { | 4461 | if (errors.errorMessageCount() > 0) { |
| 4463 | errors.renderToStdErr(renderOptions(comp.color)); | 4462 | errors.renderToStdErr(renderOptions(color)); |
| 4464 | return error.SemanticAnalyzeFail; | 4463 | return error.SemanticAnalyzeFail; |
| 4465 | } | 4464 | } |
| 4466 | } | 4465 | } |
| 4467 | | 4466 | |
| 4468 | fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilation.CImportResult) !void { | 4467 | fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilation.CImportResult) !void { |
| 4469 | if (build_options.only_core_functionality) @panic("@translate-c is not available in a zig2.c build"); | 4468 | if (build_options.only_core_functionality) @panic("@translate-c is not available in a zig2.c build"); |
| | 4469 | const color: Color = .auto; |
| 4470 | assert(comp.c_source_files.len == 1); | 4470 | assert(comp.c_source_files.len == 1); |
| 4471 | const c_source_file = comp.c_source_files[0]; | 4471 | const c_source_file = comp.c_source_files[0]; |
| 4472 | | 4472 | |
| ... | @@ -4559,7 +4559,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilati | ... | @@ -4559,7 +4559,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilati |
| 4559 | p.errors = errors; | 4559 | p.errors = errors; |
| 4560 | return; | 4560 | return; |
| 4561 | } else { | 4561 | } else { |
| 4562 | errors.renderToStdErr(renderOptions(comp.color)); | 4562 | errors.renderToStdErr(renderOptions(color)); |
| 4563 | process.exit(1); | 4563 | process.exit(1); |
| 4564 | } | 4564 | } |
| 4565 | }, | 4565 | }, |
| ... | @@ -5533,7 +5533,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi | ... | @@ -5533,7 +5533,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi |
| 5533 | }; | 5533 | }; |
| 5534 | defer comp.destroy(); | 5534 | defer comp.destroy(); |
| 5535 | | 5535 | |
| 5536 | updateModule(comp) catch |err| switch (err) { | 5536 | updateModule(comp, color) catch |err| switch (err) { |
| 5537 | error.SemanticAnalyzeFail => process.exit(2), | 5537 | error.SemanticAnalyzeFail => process.exit(2), |
| 5538 | else => |e| return e, | 5538 | else => |e| return e, |
| 5539 | }; | 5539 | }; |