| ... | ... | @@ -653,7 +653,8 @@ pub const Builder = struct { |
| 653 | 653 | for (diags.arch.?.allCpuModels()) |cpu| { |
| 654 | 654 | warn(" {}\n", .{cpu.name}); |
| 655 | 655 | } |
| 656 | | process.exit(1); |
| 656 | self.markInvalidUserInput(); |
| 657 | return args.default_target; |
| 657 | 658 | }, |
| 658 | 659 | error.UnknownCpuFeature => { |
| 659 | 660 | warn( |
| ... | ... | @@ -667,7 +668,8 @@ pub const Builder = struct { |
| 667 | 668 | for (diags.arch.?.allFeaturesList()) |feature| { |
| 668 | 669 | warn(" {}: {}\n", .{ feature.name, feature.description }); |
| 669 | 670 | } |
| 670 | | process.exit(1); |
| 671 | self.markInvalidUserInput(); |
| 672 | return args.default_target; |
| 671 | 673 | }, |
| 672 | 674 | error.UnknownOperatingSystem => { |
| 673 | 675 | warn( |
| ... | ... | @@ -678,11 +680,13 @@ pub const Builder = struct { |
| 678 | 680 | inline for (std.meta.fields(std.Target.Os.Tag)) |field| { |
| 679 | 681 | warn(" {}\n", .{field.name}); |
| 680 | 682 | } |
| 681 | | process.exit(1); |
| 683 | self.markInvalidUserInput(); |
| 684 | return args.default_target; |
| 682 | 685 | }, |
| 683 | 686 | else => |e| { |
| 684 | 687 | warn("Unable to parse target '{}': {}\n", .{ triple, @errorName(e) }); |
| 685 | | process.exit(1); |
| 688 | self.markInvalidUserInput(); |
| 689 | return args.default_target; |
| 686 | 690 | }, |
| 687 | 691 | }; |
| 688 | 692 | |
| ... | ... | @@ -703,9 +707,8 @@ pub const Builder = struct { |
| 703 | 707 | const t_triple = t.zigTriple(self.allocator) catch unreachable; |
| 704 | 708 | warn(" {}\n", .{t_triple}); |
| 705 | 709 | } |
| 706 | | // TODO instead of process exit, return error and have a zig build flag implemented by |
| 707 | | // the build runner that turns process exits into error return traces |
| 708 | | process.exit(1); |
| 710 | self.markInvalidUserInput(); |
| 711 | return args.default_target; |
| 709 | 712 | } |
| 710 | 713 | |
| 711 | 714 | return selected_target; |