diff options
author | 2022-09-25 13:08:51 -0700 | |
---|---|---|
committer | 2022-09-25 13:08:51 -0700 | |
commit | a4d46fc7db7459e3e7e895d3013ffe65b0f0078c (patch) | |
tree | 8c6d78f3ccc127b16ff38fe098223bd9b69c2736 /src/bun.js/api | |
parent | 7ce4a4e3d3f5f06a1258eefc49ce1da166e43886 (diff) | |
download | bun-jarred/subprocess.tar.gz bun-jarred/subprocess.tar.zst bun-jarred/subprocess.zip |
:sleepy:jarred/subprocess
Diffstat (limited to 'src/bun.js/api')
-rw-r--r-- | src/bun.js/api/bun/spawn.zig | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/bun.js/api/bun/spawn.zig b/src/bun.js/api/bun/spawn.zig index 58dac9e9f..c1deebd3a 100644 --- a/src/bun.js/api/bun/spawn.zig +++ b/src/bun.js/api/bun/spawn.zig @@ -4,14 +4,19 @@ const string = bun.string; const std = @import("std"); fn _getSystem() type { - if (comptime bun.Environment.isLinux) { - return struct { - pub usingnamespace std.os.system; - pub usingnamespace bun.C.linux; - }; - } + // this is a workaround for a Zig stage1 bug + // the "usingnamespace" is evaluating in dead branches + return brk: { + if (comptime bun.Environment.isLinux) { + const Type = bun.C.linux; + break :brk struct { + pub usingnamespace std.os.system; + pub usingnamespace Type; + }; + } - return std.os.system; + break :brk std.os.system; + }; } const system = _getSystem(); |