Skip to content

Commit

Permalink
fix: move the stdio ignoring code to the correct function: the incorr…
Browse files Browse the repository at this point in the history
…ect fix was regression `ct` generally

i applied the fix in a wrong way yesterday, which was leading to an exception
whenever running `readProcessOutput`, as it does use the stdio
  • Loading branch information
alehander92 authored and pxor committed Feb 26, 2025
1 parent 1eb390b commit ce23eb2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/frontend/lib.nim
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,8 @@ when defined(ctIndex) or defined(ctTest):
# debugPrint "OPTIONS: ", $(options.to(cstring))

setupLdLibraryPath()

var processOptions = options
# important to ignore stderr, as otherwise too much of it can lead to
# the spawned process hanging: this is a bugfix for such a situation
processOptions.stdio = cstring"ignore"
let process = nodeStartProcess.spawn(path, args, processOptions)

let process = nodeStartProcess.spawn(path, args, options)

process.stdout.setEncoding(cstring"utf8")

Expand Down Expand Up @@ -472,6 +468,11 @@ when defined(ctIndex) or defined(ctTest):

let process = nodeStartProcess.spawn(path, args, options)

var processOptions = options
# important to ignore stderr, as otherwise too much of it can lead to
# the spawned process hanging: this is a bugfix for such a situation
processOptions.stdio = cstring"ignore"

process.toJs.on("spawn", proc() =
resolve(Result[NodeSubProcess, JsObject].ok(process)))

Expand Down

0 comments on commit ce23eb2

Please sign in to comment.