aboutsummaryrefslogtreecommitdiff
path: root/lib/std/build/RunStep.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/build/RunStep.zig')
-rw-r--r--lib/std/build/RunStep.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/std/build/RunStep.zig b/lib/std/build/RunStep.zig
index 4e18d5d738..e8544921d9 100644
--- a/lib/std/build/RunStep.zig
+++ b/lib/std/build/RunStep.zig
@@ -10,6 +10,8 @@ const mem = std.mem;
const process = std.process;
const ArrayList = std.ArrayList;
const BufMap = std.BufMap;
+const Allocator = mem.Allocator;
+const ExecError = build.Builder.ExecError;
const max_stdout_size = 1 * 1024 * 1024; // 1 MiB
@@ -175,6 +177,13 @@ fn make(step: *Step) !void {
const argv = argv_list.items;
+ if (!std.process.can_spawn) {
+ const cmd = try std.mem.join(self.builder.allocator, " ", argv);
+ std.debug.print("the following command cannot be executed ({s} does not support spawning a child process):\n{s}", .{ @tagName(builtin.os.tag), cmd });
+ self.builder.allocator.free(cmd);
+ return ExecError.ExecNotSupported;
+ }
+
const child = std.ChildProcess.init(argv, self.builder.allocator) catch unreachable;
defer child.deinit();