| ... | @@ -3404,15 +3404,15 @@ fn buildOutputType( | ... | @@ -3404,15 +3404,15 @@ fn buildOutputType( |
| 3404 | }, | 3404 | }, |
| 3405 | } | 3405 | } |
| 3406 | | 3406 | |
| 3407 | if (arg_mode == .translate_c) { | | |
| 3408 | return cmdTranslateC(comp, arena, null); | | |
| 3409 | } | | |
| 3410 | | | |
| 3411 | const root_prog_node = std.Progress.start(.{ | 3407 | const root_prog_node = std.Progress.start(.{ |
| 3412 | .disable_printing = (color == .off), | 3408 | .disable_printing = (color == .off), |
| 3413 | }); | 3409 | }); |
| 3414 | defer root_prog_node.end(); | 3410 | defer root_prog_node.end(); |
| 3415 | | 3411 | |
| | 3412 | if (arg_mode == .translate_c) { |
| | 3413 | return cmdTranslateC(comp, arena, null, root_prog_node); |
| | 3414 | } |
| | 3415 | |
| 3416 | updateModule(comp, color, root_prog_node) catch |err| switch (err) { | 3416 | updateModule(comp, color, root_prog_node) catch |err| switch (err) { |
| 3417 | error.SemanticAnalyzeFail => { | 3417 | error.SemanticAnalyzeFail => { |
| 3418 | assert(listen == .none); | 3418 | assert(listen == .none); |
| ... | @@ -4048,7 +4048,7 @@ fn serve( | ... | @@ -4048,7 +4048,7 @@ fn serve( |
| 4048 | defer arena_instance.deinit(); | 4048 | defer arena_instance.deinit(); |
| 4049 | const arena = arena_instance.allocator(); | 4049 | const arena = arena_instance.allocator(); |
| 4050 | var output: Compilation.CImportResult = undefined; | 4050 | var output: Compilation.CImportResult = undefined; |
| 4051 | try cmdTranslateC(comp, arena, &output); | 4051 | try cmdTranslateC(comp, arena, &output, main_progress_node); |
| 4052 | defer output.deinit(gpa); | 4052 | defer output.deinit(gpa); |
| 4053 | if (output.errors.errorMessageCount() != 0) { | 4053 | if (output.errors.errorMessageCount() != 0) { |
| 4054 | try server.serveErrorBundle(output.errors); | 4054 | try server.serveErrorBundle(output.errors); |
| ... | @@ -4398,7 +4398,12 @@ fn updateModule(comp: *Compilation, color: Color, prog_node: std.Progress.Node) | ... | @@ -4398,7 +4398,12 @@ fn updateModule(comp: *Compilation, color: Color, prog_node: std.Progress.Node) |
| 4398 | } | 4398 | } |
| 4399 | } | 4399 | } |
| 4400 | | 4400 | |
| 4401 | fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilation.CImportResult) !void { | 4401 | fn cmdTranslateC( |
| | 4402 | comp: *Compilation, |
| | 4403 | arena: Allocator, |
| | 4404 | fancy_output: ?*Compilation.CImportResult, |
| | 4405 | prog_node: std.Progress.Node, |
| | 4406 | ) !void { |
| 4402 | if (build_options.only_core_functionality) @panic("@translate-c is not available in a zig2.c build"); | 4407 | if (build_options.only_core_functionality) @panic("@translate-c is not available in a zig2.c build"); |
| 4403 | const color: Color = .auto; | 4408 | const color: Color = .auto; |
| 4404 | assert(comp.c_source_files.len == 1); | 4409 | assert(comp.c_source_files.len == 1); |
| ... | @@ -4459,6 +4464,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilati | ... | @@ -4459,6 +4464,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilati |
| 4459 | .root_src_path = "aro_translate_c.zig", | 4464 | .root_src_path = "aro_translate_c.zig", |
| 4460 | .depend_on_aro = true, | 4465 | .depend_on_aro = true, |
| 4461 | .capture = &stdout, | 4466 | .capture = &stdout, |
| | 4467 | .progress_node = prog_node, |
| 4462 | }); | 4468 | }); |
| 4463 | break :f stdout; | 4469 | break :f stdout; |
| 4464 | }, | 4470 | }, |
| ... | @@ -5236,6 +5242,7 @@ const JitCmdOptions = struct { | ... | @@ -5236,6 +5242,7 @@ const JitCmdOptions = struct { |
| 5236 | capture: ?*[]u8 = null, | 5242 | capture: ?*[]u8 = null, |
| 5237 | /// Send error bundles via std.zig.Server over stdout | 5243 | /// Send error bundles via std.zig.Server over stdout |
| 5238 | server: bool = false, | 5244 | server: bool = false, |
| | 5245 | progress_node: std.Progress.Node = .{ .index = .none }, |
| 5239 | }; | 5246 | }; |
| 5240 | | 5247 | |
| 5241 | fn jitCmd( | 5248 | fn jitCmd( |
| ... | @@ -5245,9 +5252,12 @@ fn jitCmd( | ... | @@ -5245,9 +5252,12 @@ fn jitCmd( |
| 5245 | options: JitCmdOptions, | 5252 | options: JitCmdOptions, |
| 5246 | ) !void { | 5253 | ) !void { |
| 5247 | const color: Color = .auto; | 5254 | const color: Color = .auto; |
| 5248 | const root_prog_node = std.Progress.start(.{ | 5255 | const root_prog_node = if (options.progress_node.index != .none) |
| 5249 | .disable_printing = (color == .off), | 5256 | options.progress_node |
| 5250 | }); | 5257 | else |
| | 5258 | std.Progress.start(.{ |
| | 5259 | .disable_printing = (color == .off), |
| | 5260 | }); |
| 5251 | | 5261 | |
| 5252 | const target_query: std.Target.Query = .{}; | 5262 | const target_query: std.Target.Query = .{}; |
| 5253 | const resolved_target: Package.Module.ResolvedTarget = .{ | 5263 | const resolved_target: Package.Module.ResolvedTarget = .{ |