@@ -3404,15 +3404,15 @@ fn buildOutputType(
34043404 },
34053405 }
34063406
3407- if (arg_mode == .translate_c ) {
3408- return cmdTranslateC (comp , arena , null );
3409- }
3410-
34113407 const root_prog_node = std .Progress .start (.{
34123408 .disable_printing = (color == .off ),
34133409 });
34143410 defer root_prog_node .end ();
34153411
3412+ if (arg_mode == .translate_c ) {
3413+ return cmdTranslateC (comp , arena , null , root_prog_node );
3414+ }
3415+
34163416 updateModule (comp , color , root_prog_node ) catch | err | switch (err ) {
34173417 error .SemanticAnalyzeFail = > {
34183418 assert (listen == .none );
@@ -4048,7 +4048,7 @@ fn serve(
40484048 defer arena_instance .deinit ();
40494049 const arena = arena_instance .allocator ();
40504050 var output : Compilation.CImportResult = undefined ;
4051- try cmdTranslateC (comp , arena , & output );
4051+ try cmdTranslateC (comp , arena , & output , main_progress_node );
40524052 defer output .deinit (gpa );
40534053 if (output .errors .errorMessageCount () != 0 ) {
40544054 try server .serveErrorBundle (output .errors );
@@ -4398,7 +4398,12 @@ fn updateModule(comp: *Compilation, color: Color, prog_node: std.Progress.Node)
43984398 }
43994399}
44004400
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 {
44024407 if (build_options .only_core_functionality ) @panic ("@translate-c is not available in a zig2.c build" );
44034408 const color : Color = .auto ;
44044409 assert (comp .c_source_files .len == 1 );
@@ -4459,6 +4464,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilati
44594464 .root_src_path = "aro_translate_c.zig" ,
44604465 .depend_on_aro = true ,
44614466 .capture = & stdout ,
4467+ .progress_node = prog_node ,
44624468 });
44634469 break :f stdout ;
44644470 },
@@ -5236,6 +5242,7 @@ const JitCmdOptions = struct {
52365242 capture : ? * []u8 = null ,
52375243 /// Send error bundles via std.zig.Server over stdout
52385244 server : bool = false ,
5245+ progress_node : std.Progress.Node = .{ .index = .none },
52395246};
52405247
52415248fn jitCmd (
@@ -5245,9 +5252,12 @@ fn jitCmd(
52455252 options : JitCmdOptions ,
52465253) ! void {
52475254 const color : Color = .auto ;
5248- const root_prog_node = std .Progress .start (.{
5249- .disable_printing = (color == .off ),
5250- });
5255+ const root_prog_node = if (options .progress_node .index != .none )
5256+ options .progress_node
5257+ else
5258+ std .Progress .start (.{
5259+ .disable_printing = (color == .off ),
5260+ });
52515261
52525262 const target_query : std.Target.Query = .{};
52535263 const resolved_target : Package.Module.ResolvedTarget = .{
0 commit comments