| ... | @@ -1618,6 +1618,17 @@ fn buildOutputType( | ... | @@ -1618,6 +1618,17 @@ fn buildOutputType( |
| 1618 | defer argv.deinit(); | 1618 | defer argv.deinit(); |
| 1619 | | 1619 | |
| 1620 | if (test_exec_args.items.len == 0) { | 1620 | if (test_exec_args.items.len == 0) { |
| | 1621 | if (!std.Target.current.canExecBinariesOf(target_info.target)) { |
| | 1622 | switch (arg_mode) { |
| | 1623 | .zig_test => { |
| | 1624 | warn("created {s} but skipping execution because it is non-native", .{exe_path}); |
| | 1625 | if (!watch) return cleanExit(); |
| | 1626 | break :run; |
| | 1627 | }, |
| | 1628 | .run => fatal("unable to execute {s}: non-native", .{exe_path}), |
| | 1629 | else => unreachable, |
| | 1630 | } |
| | 1631 | } |
| 1621 | try argv.append(exe_path); | 1632 | try argv.append(exe_path); |
| 1622 | } else { | 1633 | } else { |
| 1623 | for (test_exec_args.items) |arg| { | 1634 | for (test_exec_args.items) |arg| { |
| ... | @@ -2128,8 +2139,8 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v | ... | @@ -2128,8 +2139,8 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v |
| 2128 | error.FileNotFound => { | 2139 | error.FileNotFound => { |
| 2129 | dirname = fs.path.dirname(dirname) orelse { | 2140 | dirname = fs.path.dirname(dirname) orelse { |
| 2130 | std.log.info("{}", .{ | 2141 | std.log.info("{}", .{ |
| 2131 | \\Initialize a 'build.zig' template file with `zig init-lib` or `zig init-exe`, | 2142 | \\Initialize a 'build.zig' template file with `zig init-lib` or `zig init-exe`, |
| 2132 | \\or see `zig --help` for more options. | 2143 | \\or see `zig --help` for more options. |
| 2133 | }); | 2144 | }); |
| 2134 | fatal("No 'build.zig' file found, in the current directory or any parent directories.", .{}); | 2145 | fatal("No 'build.zig' file found, in the current directory or any parent directories.", .{}); |
| 2135 | }; | 2146 | }; |