Skip to content

Commit

Permalink
fix(windows): mimic an empty stdin input
Browse files Browse the repository at this point in the history
Prevents the stdin handle from waiting in an infinite loop for the read stream to finish

Fixes #141
  • Loading branch information
realtimetodie authored and alexeagle committed Jan 9, 2023
1 parent 8e899cd commit 447be9d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions swc/private/swc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,16 @@ def _impl(ctx):
])
inputs.append(ctx.file.swcrc)

ctx.actions.run(
ctx.actions.run_shell(
inputs = inputs,
arguments = [
args,
src_args,
ctx.files.srcs[0].path,
],
outputs = output_sources,
executable = swc_toolchain.swcinfo.swc_binary,
# TODO: Remove the redirection of the null device (windows fix)
command = swc_toolchain.swcinfo.swc_binary + " $@ < /dev/null",
mnemonic = "SWCCompile",
progress_message = "Compiling %{label} [swc %{input}]",
)
Expand Down Expand Up @@ -231,15 +232,16 @@ def _impl(ctx):

output_sources.extend(outputs)

ctx.actions.run(
ctx.actions.run_shell(
inputs = inputs,
arguments = [
args,
src_args,
src.path,
],
outputs = outputs,
executable = swc_toolchain.swcinfo.swc_binary,
# TODO: Remove the redirection of the null device (windows fix)
command = swc_toolchain.swcinfo.swc_binary + " $@ < /dev/null",
mnemonic = "SWCCompile",
progress_message = "Compiling %{label} [swc %{input}]",
)
Expand Down

0 comments on commit 447be9d

Please sign in to comment.