| ... | @@ -3404,23 +3404,25 @@ fn buildOutputType( | ... | @@ -3404,23 +3404,25 @@ fn buildOutputType( |
| 3404 | }, | 3404 | }, |
| 3405 | } | 3405 | } |
| 3406 | | 3406 | |
| 3407 | const root_prog_node = std.Progress.start(.{ | 3407 | { |
| 3408 | .disable_printing = (color == .off), | 3408 | const root_prog_node = std.Progress.start(.{ |
| 3409 | }); | 3409 | .disable_printing = (color == .off), |
| 3410 | defer root_prog_node.end(); | 3410 | }); |
| | 3411 | defer root_prog_node.end(); |
| 3411 | | 3412 | |
| 3412 | if (arg_mode == .translate_c) { | 3413 | if (arg_mode == .translate_c) { |
| 3413 | return cmdTranslateC(comp, arena, null, root_prog_node); | 3414 | return cmdTranslateC(comp, arena, null, root_prog_node); |
| 3414 | } | 3415 | } |
| 3415 | | 3416 | |
| 3416 | updateModule(comp, color, root_prog_node) catch |err| switch (err) { | 3417 | updateModule(comp, color, root_prog_node) catch |err| switch (err) { |
| 3417 | error.SemanticAnalyzeFail => { | 3418 | error.SemanticAnalyzeFail => { |
| 3418 | assert(listen == .none); | 3419 | assert(listen == .none); |
| 3419 | saveState(comp, debug_incremental); | 3420 | saveState(comp, debug_incremental); |
| 3420 | process.exit(1); | 3421 | process.exit(1); |
| 3421 | }, | 3422 | }, |
| 3422 | else => |e| return e, | 3423 | else => |e| return e, |
| 3423 | }; | 3424 | }; |
| | 3425 | } |
| 3424 | if (build_options.only_c) return cleanExit(); | 3426 | if (build_options.only_c) return cleanExit(); |
| 3425 | try comp.makeBinFileExecutable(); | 3427 | try comp.makeBinFileExecutable(); |
| 3426 | saveState(comp, debug_incremental); | 3428 | saveState(comp, debug_incremental); |
| ... | @@ -4228,7 +4230,9 @@ fn runOrTest( | ... | @@ -4228,7 +4230,9 @@ fn runOrTest( |
| 4228 | // the error message and invocation below. | 4230 | // the error message and invocation below. |
| 4229 | if (process.can_execv and arg_mode == .run) { | 4231 | if (process.can_execv and arg_mode == .run) { |
| 4230 | // execv releases the locks; no need to destroy the Compilation here. | 4232 | // execv releases the locks; no need to destroy the Compilation here. |
| | 4233 | std.debug.lockStdErr(); |
| 4231 | const err = process.execve(gpa, argv.items, &env_map); | 4234 | const err = process.execve(gpa, argv.items, &env_map); |
| | 4235 | std.debug.unlockStdErr(); |
| 4232 | try warnAboutForeignBinaries(arena, arg_mode, target, link_libc); | 4236 | try warnAboutForeignBinaries(arena, arg_mode, target, link_libc); |
| 4233 | const cmd = try std.mem.join(arena, " ", argv.items); | 4237 | const cmd = try std.mem.join(arena, " ", argv.items); |
| 4234 | fatal("the following command failed to execve with '{s}':\n{s}", .{ @errorName(err), cmd }); | 4238 | fatal("the following command failed to execve with '{s}':\n{s}", .{ @errorName(err), cmd }); |
| ... | @@ -4244,7 +4248,12 @@ fn runOrTest( | ... | @@ -4244,7 +4248,12 @@ fn runOrTest( |
| 4244 | comp.destroy(); | 4248 | comp.destroy(); |
| 4245 | comp_destroyed.* = true; | 4249 | comp_destroyed.* = true; |
| 4246 | | 4250 | |
| 4247 | const term = child.spawnAndWait() catch |err| { | 4251 | const term_result = t: { |
| | 4252 | std.debug.lockStdErr(); |
| | 4253 | defer std.debug.unlockStdErr(); |
| | 4254 | break :t child.spawnAndWait(); |
| | 4255 | }; |
| | 4256 | const term = term_result catch |err| { |
| 4248 | try warnAboutForeignBinaries(arena, arg_mode, target, link_libc); | 4257 | try warnAboutForeignBinaries(arena, arg_mode, target, link_libc); |
| 4249 | const cmd = try std.mem.join(arena, " ", argv.items); | 4258 | const cmd = try std.mem.join(arena, " ", argv.items); |
| 4250 | fatal("the following command failed with '{s}':\n{s}", .{ @errorName(err), cmd }); | 4259 | fatal("the following command failed with '{s}':\n{s}", .{ @errorName(err), cmd }); |