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